Changeset 83b64a59 in mainline for uspace/Makefile.common


Ignore:
Timestamp:
2019-06-05T16:03:03Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b401b33
Parents:
58168e0
Message:

Minor cleanup of uspace makefiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    r58168e0 r83b64a59  
    4646#   STATIC_NEEDED      set to 'y' for init binaries, will build statically
    4747#                      linked version
    48 #   STATIC_ONLY        set to 'y' if binary cannot be linked dynamically
    49 #                      (e.g. uses thread-local variables)
    5048#
    5149# Optionally, for a library:
     
    114112LDFLAGS = -Wl,--fatal-warnings,--warn-common
    115113
     114STATIC_BUILD = n
     115
    116116ifeq ($(STATIC_NEEDED),y)
    117117        STATIC_BUILD = y
    118 else
    119         ifeq ($(STATIC_ONLY),y)
     118endif
     119
     120ifneq ($(CONFIG_BUILD_SHARED_LIBS),y)
     121        STATIC_BUILD = y
     122endif
     123
     124ifneq ($(CONFIG_USE_SHARED_LIBS),y)
     125        ifeq ($(LIBRARY),)
    120126                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
    135127        endif
    136128endif
    137129
    138 ifneq ($(STATIC_BUILD),y)
    139         LINK_DYNAMIC = y
     130ifeq ($(STATIC_BUILD),y)
     131        LDFLAGS += -static
    140132endif
    141133
     
    152144BASE_LIBS += -lgcc
    153145
    154 ifneq ($(LINK_DYNAMIC),y)
    155         LDFLAGS += -static
    156 endif
    157 
    158146INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS)
    159147
     
    164152INCLUDES_FLAGS += $(foreach lib,$(LIBS), -I$(LIB_PREFIX)/$(lib) -I$(LIB_PREFIX)/$(lib)/include)
    165153
    166 # TODO: get rid of this special case
    167 ifneq ($(filter math, $(LIBS)),)
    168         INCLUDES_FLAGS += $(LIBMATH_INCLUDES_FLAGS)
     154DEPLIBS := $(LIBS)
     155
     156ifneq ($(filter %.cpp %.cc %.cxx, $(SOURCES)),)
     157        ifneq ($(LIBRARY),libcpp)
     158                DEPLIBS += cpp
     159        endif
     160endif
     161
     162ifneq ($(LIBRARY),libc)
     163        DEPLIBS += c
    169164endif
    170165
     
    305300DEPENDS := $(addsuffix .d,$(basename $(SOURCES))) $(addsuffix .test.d,$(basename $(TEST_SOURCES)))
    306301
    307 LIBTAGS := $(foreach lib,$(LIBS), $(USPACE_PREFIX)/lib/$(lib)/tag)
     302LIBTAGS := $(foreach lib,$(DEPLIBS), $(USPACE_PREFIX)/lib/$(lib)/tag)
    308303LIBARGS := $(addprefix -L$(USPACE_PREFIX)/lib/, $(LIBS)) $(addprefix -l, $(LIBS))
    309 
    310 ifneq ($(LIBRARY),libc)
    311         LIBTAGS := $(LIBC_PREFIX)/tag $(LIBTAGS)
    312 endif
    313304
    314305.PHONY: all all-test clean fasterclean depend
     
    339330deps.mk: Makefile
    340331        echo > $@.new
    341         for lib in $(LIBS); do \
     332        for lib in $(DEPLIBS); do \
    342333                echo "$(SELF_TARGET): lib/$$lib.build" >> $@.new; \
    343334        done
Note: See TracChangeset for help on using the changeset viewer.