Changes in uspace/Makefile.common [874ed210:6480827] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
r874ed210 r6480827 46 46 # STATIC_NEEDED set to 'y' for init binaries, will build statically 47 47 # linked version 48 # STATIC_ONLY set to 'y' if binary cannot be linked dynamically 49 # (e.g. uses thread-local variables) 48 50 # 49 51 # Optionally, for a library: … … 109 111 START_FILES = $(LIBC_PREFIX)/crt0.o $(LIBC_PREFIX)/crt1.o 110 112 113 AFLAGS = --fatal-warnings 111 114 LDFLAGS = -Wl,--fatal-warnings,--warn-common 112 113 STATIC_BUILD = n114 115 115 116 ifeq ($(STATIC_NEEDED),y) 116 117 STATIC_BUILD = y 117 endif 118 119 ifneq ($(CONFIG_BUILD_SHARED_LIBS),y) 120 STATIC_BUILD = y 121 endif 122 123 ifneq ($(CONFIG_USE_SHARED_LIBS),y) 124 ifeq ($(LIBRARY),) 118 else 119 ifeq ($(STATIC_ONLY),y) 125 120 STATIC_BUILD = y 121 else 122 ifeq ($(CONFIG_BUILD_SHARED_LIBS),y) 123 ifeq ($(CONFIG_USE_SHARED_LIBS),y) 124 STATIC_BUILD = n 125 else 126 ifeq ($(LIBRARY),) 127 STATIC_BUILD = y 128 else 129 STATIC_BUILD = n 130 endif 131 endif 132 else 133 STATIC_BUILD = y 134 endif 126 135 endif 127 136 endif 128 137 129 # LINK_DYNAMIC is only here to allow app/dltest to link dynamically in otherwise static build. 130 ifeq ($(LINK_DYNAMIC),y) 131 STATIC_BUILD = n 132 endif 133 134 ifeq ($(STATIC_BUILD),y) 135 LDFLAGS += -static 138 ifneq ($(STATIC_BUILD),y) 139 LINK_DYNAMIC = y 136 140 endif 137 141 … … 148 152 BASE_LIBS += -lgcc 149 153 154 ifneq ($(LINK_DYNAMIC),y) 155 LDFLAGS += -static 156 endif 157 150 158 INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS) 151 159 … … 156 164 INCLUDES_FLAGS += $(foreach lib,$(LIBS), -I$(LIB_PREFIX)/$(lib) -I$(LIB_PREFIX)/$(lib)/include) 157 165 158 DEPLIBS := $(LIBS) 159 160 ifneq ($(filter %.cpp %.cc %.cxx, $(SOURCES)),) 161 ifneq ($(LIBRARY),libcpp) 162 DEPLIBS += cpp 163 endif 164 endif 165 166 ifneq ($(LIBRARY),libc) 167 DEPLIBS += c 166 # TODO: get rid of this special case 167 ifneq ($(filter math, $(LIBS)),) 168 INCLUDES_FLAGS += $(LIBMATH_INCLUDES_FLAGS) 168 169 endif 169 170 … … 193 194 -Werror-implicit-function-declaration \ 194 195 -Wsystem-headers \ 195 -Wunknown-pragmas \ 196 -Wa,--fatal-warnings 196 -Wunknown-pragmas 197 197 198 198 # XXX: -fno-builtin-strftime is for a seemingly spurious format warning. … … 296 296 297 297 LIB_CFLAGS = $(CFLAGS) -fPIC 298 LIB_CXXFLAGS = $(CXXFLAGS) -fPIC299 298 LIB_LDFLAGS = $(LDFLAGS) -shared -Wl,-soname,$(LSONAME) -Wl,--no-undefined,--no-allow-shlib-undefined 299 300 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS)) 300 301 301 302 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) … … 304 305 DEPENDS := $(addsuffix .d,$(basename $(SOURCES))) $(addsuffix .test.d,$(basename $(TEST_SOURCES))) 305 306 306 LIBTAGS := $(foreach lib,$( DEPLIBS), $(USPACE_PREFIX)/lib/$(lib)/tag)307 LIBTAGS := $(foreach lib,$(LIBS), $(USPACE_PREFIX)/lib/$(lib)/tag) 307 308 LIBARGS := $(addprefix -L$(USPACE_PREFIX)/lib/, $(LIBS)) $(addprefix -l, $(LIBS)) 309 310 ifneq ($(LIBRARY),libc) 311 LIBTAGS := $(LIBC_PREFIX)/tag $(LIBTAGS) 312 endif 308 313 309 314 .PHONY: all all-test clean fasterclean depend … … 334 339 deps.mk: Makefile 335 340 echo > $@.new 336 for lib in $( DEPLIBS); do \341 for lib in $(LIBS); do \ 337 342 echo "$(SELF_TARGET): lib/$$lib.build" >> $@.new; \ 338 343 done … … 384 389 385 390 %.o: %.S | depend 386 $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) 391 $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) 387 392 388 393 %.o: %.s | depend 389 $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) 394 $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) 390 395 391 396 %.o: %.c | depend … … 405 410 406 411 %.lo: %.S | depend 407 $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) 412 $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) 408 413 409 414 %.lo: %.s | depend 410 $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) 415 $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) 411 416 412 417 %.lo: %.c | depend … … 414 419 415 420 %.lo: %.cpp | depend 416 $(CXX_JOB) -c -MD -MP $(DEFS) $( LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)421 $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) 417 422 418 423 %.lo: %.cxx | depend 419 $(CXX_JOB) -c -MD -MP $(DEFS) $( LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)424 $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) 420 425 421 426 %.lo: %.cc | depend 422 $(CXX_JOB) -c -MD -MP $(DEFS) $( LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)427 $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) 423 428 424 429 -include $(DEPENDS)
Note:
See TracChangeset
for help on using the changeset viewer.