freebsd.mk (386ca866) | freebsd.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 --- 242 unchanged lines hidden (view full) --- 251gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 252 253define gb_LinkTarget__command_dynamiclink 254$(call gb_Helper_abbreviate_dirs,\ 255 mkdir -p $(dir $(1)) && \ 256 $(gb_CXX) \ 257 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 258 $(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 --- 242 unchanged lines hidden (view full) --- 251gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) 252 253define gb_LinkTarget__command_dynamiclink 254$(call gb_Helper_abbreviate_dirs,\ 255 mkdir -p $(dir $(1)) && \ 256 $(gb_CXX) \ 257 $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ 258 $(if $(VERSIONMAP),$(gb_Library_VERSIONMAPFLAG) $(VERSIONMAP)) \ |
259 $(if $(call gb_Library_is_udk_versioned,$(1)),-Wl$(COMMA)-h$(notdir $(1)).$(gb_UDK_MAJOR)) \ |
|
259 $(subst \d,$$,$(RPATH)) \ 260 $(T_LDFLAGS) \ 261 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 262 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 263 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 264 -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ 265 $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ 266 $(patsubst %,-l%,$(EXTERNAL_LIBS)) \ 267 $(LIBS) \ | 260 $(subst \d,$$,$(RPATH)) \ 261 $(T_LDFLAGS) \ 262 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 263 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 264 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 265 -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ 266 $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ 267 $(patsubst %,-l%,$(EXTERNAL_LIBS)) \ 268 $(LIBS) \ |
268 -o $(1)) | 269 -o $(if $(call gb_Library_is_udk_versioned,$(1)),$(1).$(gb_UDK_MAJOR),$(1))) |
269endef 270 | 270endef 271 |
272define gb_LinkTarget__command_symlink_udk_versioned_library 273 $(if $(call gb_Library_is_udk_versioned,$(1)), 274 $(call gb_Helper_abbreviate_dirs,\ 275 rm -f $(1) && ln -s $(notdir $(1)).$(gb_UDK_MAJOR) $(1))) 276endef 277 |
|
271define gb_LinkTarget__command_staticlink 272$(call gb_Helper_abbreviate_dirs,\ 273 mkdir -p $(dir $(1)) && \ 274 $(gb_AR) -rsu $(1) \ 275 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 276 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 277 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 278 2> /dev/null) 279endef 280 281define gb_LinkTarget__command 282$(call gb_Output_announce,$(2),$(true),LNK,4) 283$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) | 278define gb_LinkTarget__command_staticlink 279$(call gb_Helper_abbreviate_dirs,\ 280 mkdir -p $(dir $(1)) && \ 281 $(gb_AR) -rsu $(1) \ 282 $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ 283 $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ 284 $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ 285 2> /dev/null) 286endef 287 288define gb_LinkTarget__command 289$(call gb_Output_announce,$(2),$(true),LNK,4) 290$(if $(filter Library GoogleTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1))) |
291$(if $(filter Library,$(TARGETTYPE)),$(call gb_LinkTarget__command_symlink_udk_versioned_library,$(1))) |
|
284$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) 285endef 286 287 288# Library class 289 290gb_Library_DEFS := 291gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack --- 55 unchanged lines hidden (view full) --- 347define gb_Library_get_rpath 348-Wl,-z,origin '-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \ 349'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)' 350endef 351 352define gb_Library_Library_platform 353$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) 354 | 292$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) 293endef 294 295 296# Library class 297 298gb_Library_DEFS := 299gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack --- 55 unchanged lines hidden (view full) --- 355define gb_Library_get_rpath 356-Wl,-z,origin '-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \ 357'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)' 358endef 359 360define gb_Library_Library_platform 361$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) 362 |
363ifneq (,$(call gb_Library_is_udk_versioned,$(call gb_Library_get_target,$(1)))) 364$(call gb_Library_get_target,$(1)) \ 365$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \ 366 $(call gb_Library_get_target,$(1)).$(gb_UDK_MAJOR) 367 368endif |
|
355endef 356 357 358# StaticLibrary class 359 360gb_StaticLibrary_DEFS := 361gb_StaticLibrary_SYSPRE := lib 362gb_StaticLibrary_PLAINEXT := .a --- 97 unchanged lines hidden --- | 369endef 370 371 372# StaticLibrary class 373 374gb_StaticLibrary_DEFS := 375gb_StaticLibrary_SYSPRE := lib 376gb_StaticLibrary_PLAINEXT := .a --- 97 unchanged lines hidden --- |