linux.mk (386ca866) | linux.mk (f006f9b4) |
---|---|
1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 231 unchanged lines hidden (view full) --- 240gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 241 242define gb_LinkTarget__command_dynamiclink 243$(call gb_Helper_abbreviate_dirs,\ 244 mkdir -p $(dir $(1)) && \ 245 $(gb_CXX) \ 246 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 247 $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \ | 1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 231 unchanged lines hidden (view full) --- 240gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 241 242define gb_LinkTarget__command_dynamiclink 243$(call gb_Helper_abbreviate_dirs,\ 244 mkdir -p $(dir $(1)) && \ 245 $(gb_CXX) \ 246 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 247 $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \ |
248 $(if $(call gb_Library_is_udk_versioned,$(1)),-Wl$(COMMA)-h$(notdir $(1)).$(gb_UDK_MAJOR)) \ |
|
248 $(subst \d,$$,$(RPATH)) \ 249 $(T_LDFLAGS) \ 250 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 251 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 252 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 253 -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ 254 $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ 255 $(patsubst %,-l%,$(EXTERNAL_LIBS)) \ 256 $(LIBS) \ 257 -lc \ | 249 $(subst \d,$$,$(RPATH)) \ 250 $(T_LDFLAGS) \ 251 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 252 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 253 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 254 -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ 255 $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ 256 $(patsubst %,-l%,$(EXTERNAL_LIBS)) \ 257 $(LIBS) \ 258 -lc \ |
258 -o $(1)) | 259 -o $(if $(call gb_Library_is_udk_versioned,$(1)),$(1).$(gb_UDK_MAJOR),$(1))) |
259endef 260 | 260endef 261 |
262define gb_LinkTarget__command_symlink_udk_versioned_library 263 $(if $(call gb_Library_is_udk_versioned,$(1)), 264 $(call gb_Helper_abbreviate_dirs,\ 265 rm -f $(1) && ln -s $(notdir $(1)).$(gb_UDK_MAJOR) $(1))) 266endef 267 |
|
261define gb_LinkTarget__command_staticlink 262$(call gb_Helper_abbreviate_dirs,\ 263 mkdir -p $(dir $(1)) && \ 264 $(gb_AR) -rsu $(1) \ 265 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 266 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 267 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 268 2> /dev/null) 269endef 270 271define gb_LinkTarget__command 272$(call gb_Output_announce,$(2),$(true),LNK,4) 273$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) | 268define gb_LinkTarget__command_staticlink 269$(call gb_Helper_abbreviate_dirs,\ 270 mkdir -p $(dir $(1)) && \ 271 $(gb_AR) -rsu $(1) \ 272 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 273 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 274 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 275 2> /dev/null) 276endef 277 278define gb_LinkTarget__command 279$(call gb_Output_announce,$(2),$(true),LNK,4) 280$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) |
281$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_symlink_udk_versioned_library,$(1))) |
|
274$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) 275endef 276 277 278# Library class 279 280gb_Library_DEFS := 281gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack --- 55 unchanged lines hidden (view full) --- 337define gb_Library_get_rpath 338'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \ 339'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)' 340endef 341 342define gb_Library_Library_platform 343$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) 344 | 282$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) 283endef 284 285 286# Library class 287 288gb_Library_DEFS := 289gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack --- 55 unchanged lines hidden (view full) --- 345define gb_Library_get_rpath 346'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \ 347'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)' 348endef 349 350define gb_Library_Library_platform 351$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) 352 |
353ifneq (,$(call gb_Library_is_udk_versioned,$(call gb_Library_get_target,$(1)))) 354$(call gb_Library_get_target,$(1)) \ 355$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \ 356 $(call gb_Library_get_target,$(1)).$(gb_UDK_MAJOR) 357endif |
|
345endef 346 347 348# StaticLibrary class 349 350gb_StaticLibrary_DEFS := 351gb_StaticLibrary_SYSPRE := lib 352gb_StaticLibrary_PLAINEXT := .a --- 97 unchanged lines hidden --- | 358endef 359 360 361# StaticLibrary class 362 363gb_StaticLibrary_DEFS := 364gb_StaticLibrary_SYSPRE := lib 365gb_StaticLibrary_PLAINEXT := .a --- 97 unchanged lines hidden --- |