1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

make: make DIRS usable for applications

This commit is contained in:
René Kijewski 2014-06-18 11:21:05 +02:00
parent 35e74ad725
commit d19fc447ed
4 changed files with 8 additions and 15 deletions

View File

@ -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--%}

View File

@ -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

View File

@ -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)

View File

@ -25,27 +25,18 @@ endif
# Pull in `Makefile.include`s from the test suites:
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
DIRS += $(UNIT_TESTS)
BASELIBS += $(UNIT_TESTS:%=$(BINDIR)%.a)
include $(RIOTBASE)/Makefile.include
UNITTEST_LIBS := $(UNIT_TESTS:%=$(BINDIR)%.a)
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)