Browse Source

make: make DIRS usable for applications

dev/timer
René Kijewski 9 years ago
parent
commit
d19fc447ed
  1. 2
      Makefile.base
  2. 2
      Makefile.include
  3. 2
      Makefile.modules
  4. 17
      tests/unittests/Makefile

2
Makefile.base

@ -2,6 +2,8 @@ ifeq (, $(__RIOTBUILD_FLAG))
$(error You cannot build a module on its own. Use "make" in your application's directory instead.)
endif
unexport DIRS
MODULE ?= $(shell basename $(CURDIR))
.PHONY: all ${DIRS:%=ALL--%} ${DIRS:%=CLEAN--%}

2
Makefile.include

@ -87,7 +87,7 @@ export HEXFILE ?= $(ELFFILE:.elf=.hex)
## make script for your application. Build RIOT-base here!
all: ..build-message $(USEPKG:%=${BINDIR}%.a) $(APPDEPS)
"$(MAKE)" -C $(CURDIR) -f $(RIOTBASE)/Makefile.application
$(AD)DIRS="$(DIRS)" "$(MAKE)" -C $(CURDIR) -f $(RIOTBASE)/Makefile.application
ifeq (,$(RIOTNOLINK))
ifeq ($(BUILDOSXNATIVE),1)
$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie

2
Makefile.modules

@ -8,7 +8,7 @@ ED = $(USEMODULE:%=-DMODULE_%)
ED += $(USEPKG:%=-DMODULE_%)
EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z')
REALMODULES = $(filter-out $(PSEUDOMODULES), $(sort $(USEMODULE)))
export BASELIBS = $(REALMODULES:%=$(BINDIR)%.a)
export BASELIBS += $(REALMODULES:%=$(BINDIR)%.a)
CFLAGS += $(EXTDEFINES)

17
tests/unittests/Makefile

@ -25,27 +25,18 @@ endif
# Pull in `Makefile.include`s from the test suites:
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
include $(RIOTBASE)/Makefile.include
DIRS += $(UNIT_TESTS)
BASELIBS += $(UNIT_TESTS:%=$(BINDIR)%.a)
UNITTEST_LIBS := $(UNIT_TESTS:%=$(BINDIR)%.a)
include $(RIOTBASE)/Makefile.include
all: $(UNITTEST_LIBS)
$(UNIT_TESTS): all
.FORCE:
$(UNITTEST_LIBS): $(BINDIR)%.a: .FORCE
"$(MAKE)" -C $(CURDIR)/$*
charEMPTY :=
charSPACE := $(charEMPTY) $(charEMPTY)
charCOMMA := ,
ifeq (, $(UNIT_TESTS))
CFLAGS += -DNO_TEST_SUITES
$(warning There was no test suite specified!)
else
CFLAGS += -DTEST_SUITES='$(subst $(charSPACE),$(charCOMMA),$(UNIT_TESTS:tests-%=%))'
CFLAGS += -DTEST_SUITES='$(subst $() $(),$(charCOMMA),$(UNIT_TESTS:tests-%=%))'
endif
BASELIBS += $(UNITTEST_LIBS)

Loading…
Cancel
Save