mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
make: make DIRS usable for applications
This commit is contained in:
parent
35e74ad725
commit
d19fc447ed
@ -2,6 +2,8 @@ ifeq (, $(__RIOTBUILD_FLAG))
|
|||||||
$(error You cannot build a module on its own. Use "make" in your application's directory instead.)
|
$(error You cannot build a module on its own. Use "make" in your application's directory instead.)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
unexport DIRS
|
||||||
|
|
||||||
MODULE ?= $(shell basename $(CURDIR))
|
MODULE ?= $(shell basename $(CURDIR))
|
||||||
|
|
||||||
.PHONY: all ${DIRS:%=ALL--%} ${DIRS:%=CLEAN--%}
|
.PHONY: all ${DIRS:%=ALL--%} ${DIRS:%=CLEAN--%}
|
||||||
|
@ -87,7 +87,7 @@ export HEXFILE ?= $(ELFFILE:.elf=.hex)
|
|||||||
|
|
||||||
## make script for your application. Build RIOT-base here!
|
## make script for your application. Build RIOT-base here!
|
||||||
all: ..build-message $(USEPKG:%=${BINDIR}%.a) $(APPDEPS)
|
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 (,$(RIOTNOLINK))
|
||||||
ifeq ($(BUILDOSXNATIVE),1)
|
ifeq ($(BUILDOSXNATIVE),1)
|
||||||
$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
|
$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
|
||||||
|
@ -8,7 +8,7 @@ ED = $(USEMODULE:%=-DMODULE_%)
|
|||||||
ED += $(USEPKG:%=-DMODULE_%)
|
ED += $(USEPKG:%=-DMODULE_%)
|
||||||
EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z')
|
EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z')
|
||||||
REALMODULES = $(filter-out $(PSEUDOMODULES), $(sort $(USEMODULE)))
|
REALMODULES = $(filter-out $(PSEUDOMODULES), $(sort $(USEMODULE)))
|
||||||
export BASELIBS = $(REALMODULES:%=$(BINDIR)%.a)
|
export BASELIBS += $(REALMODULES:%=$(BINDIR)%.a)
|
||||||
|
|
||||||
CFLAGS += $(EXTDEFINES)
|
CFLAGS += $(EXTDEFINES)
|
||||||
|
|
||||||
|
@ -25,27 +25,18 @@ endif
|
|||||||
# Pull in `Makefile.include`s from the test suites:
|
# Pull in `Makefile.include`s from the test suites:
|
||||||
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
|
-include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include)
|
||||||
|
|
||||||
|
DIRS += $(UNIT_TESTS)
|
||||||
|
BASELIBS += $(UNIT_TESTS:%=$(BINDIR)%.a)
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|
||||||
UNITTEST_LIBS := $(UNIT_TESTS:%=$(BINDIR)%.a)
|
|
||||||
|
|
||||||
all: $(UNITTEST_LIBS)
|
|
||||||
$(UNIT_TESTS): all
|
$(UNIT_TESTS): all
|
||||||
|
|
||||||
.FORCE:
|
|
||||||
|
|
||||||
$(UNITTEST_LIBS): $(BINDIR)%.a: .FORCE
|
|
||||||
"$(MAKE)" -C $(CURDIR)/$*
|
|
||||||
|
|
||||||
charEMPTY :=
|
|
||||||
charSPACE := $(charEMPTY) $(charEMPTY)
|
|
||||||
charCOMMA := ,
|
charCOMMA := ,
|
||||||
|
|
||||||
ifeq (, $(UNIT_TESTS))
|
ifeq (, $(UNIT_TESTS))
|
||||||
CFLAGS += -DNO_TEST_SUITES
|
CFLAGS += -DNO_TEST_SUITES
|
||||||
$(warning There was no test suite specified!)
|
$(warning There was no test suite specified!)
|
||||||
else
|
else
|
||||||
CFLAGS += -DTEST_SUITES='$(subst $(charSPACE),$(charCOMMA),$(UNIT_TESTS:tests-%=%))'
|
CFLAGS += -DTEST_SUITES='$(subst $() $(),$(charCOMMA),$(UNIT_TESTS:tests-%=%))'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BASELIBS += $(UNITTEST_LIBS)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user