Changeset 83b64a59 in mainline


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

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    r58168e0 r83b64a59  
    223223#
    224224
    225 BASE_LIBS = \
    226         lib/c \
    227         lib/cpp
    228 
    229 LIBS = \
     225DIRS += \
    230226        lib/fs \
    231227        lib/block \
     228        lib/c \
     229        lib/cpp \
    232230        lib/crypto \
    233231        lib/clui \
     
    266264        lib/virtio
    267265
    268 BASE_BUILDS := $(addsuffix .build,$(BASE_LIBS))
    269 BUILDS := $(addsuffix .build,$(DIRS) $(LIBS))
    270 BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) $(BASE_LIBS))
    271 DEPS = $(addsuffix /deps.mk,$(DIRS) $(LIBS))
    272 CLEANS := $(addsuffix .clean,$(DIRS) $(LIBS) $(BASE_LIBS))
    273 
    274 .PHONY: all $(BASE_BUILDS) $(BUILDS) $(BUILDS_TESTS) $(CLEANS) clean export
     266BUILDS := $(addsuffix .build,$(DIRS))
     267BUILDS_TESTS := $(addsuffix .build-test,$(DIRS))
     268DEPS = $(addsuffix /deps.mk,$(DIRS))
     269CLEANS := $(addsuffix .clean,$(DIRS))
     270
     271.PHONY: all $(BUILDS) $(BUILDS_TESTS) $(CLEANS) clean export
    275272
    276273all: $(BUILDS) $(BUILDS_TESTS)
    277274
    278 $(BUILDS_TESTS): $(BASE_BUILDS) $(BUILDS)
     275$(BUILDS_TESTS): $(BUILDS)
    279276        $(MAKE) -r -C $(basename $@) all-test PRECHECK=$(PRECHECK)
    280277
     
    292289        -$(MAKE) -r -C $(basename $@) fasterclean
    293290
    294 $(BASE_BUILDS) $(BUILDS):
     291$(BUILDS):
    295292        $(MAKE) -r -C $(basename $@) all PRECHECK=$(PRECHECK)
    296293
     
    298295        $(MAKE) -r -C $(@D) deps.mk SELF_TARGET="$(@D).build"
    299296
    300 $(BUILDS): $(BASE_BUILDS)
    301 
    302297-include $(DEPS)
  • 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
  • uspace/srv/loader/Makefile

    r58168e0 r83b64a59  
    4646
    4747BINARY = loader
    48 STATIC_ONLY = y
     48STATIC_NEEDED = y
    4949
    5050GENERIC_SOURCES = \
Note: See TracChangeset for help on using the changeset viewer.