mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Add USEPKG variable for Makefiles
Currently pkg/USING says one should use `EXTERNAL+=$(RIOTBASE)/pkg/<pkg_name>` to enable PKG modules. Using this line the PKG will be compiled but not linked. This change adds a USEPKG variable to be used like `USEPKG += <pkg_name>`, which looks less clumsy and gets the PKG linked in the binary.
This commit is contained in:
parent
d794900386
commit
5906f18a81
@ -49,6 +49,7 @@ include $(RIOTBASE)/Makefile.dep
|
||||
# your binaries to link
|
||||
BASELIBS += $(BINDIR)$(BOARD)_base.a
|
||||
BASELIBS += $(BINDIR)${PROJECT}.a
|
||||
BASELIBS += $(USEPKG:%=${BINDIR}%.a)
|
||||
|
||||
.PHONY: all clean flash doc term
|
||||
|
||||
@ -57,7 +58,7 @@ all: $(BINDIR)$(PROJECT).a
|
||||
@echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
|
||||
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
|
||||
"$(MAKE)" -C $(RIOTBASE)
|
||||
@for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i ; done ;
|
||||
@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTBASE)/pkg/$$i ; done ;
|
||||
ifeq ($(BUILDOSXNATIVE),1)
|
||||
$(AD)$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
|
||||
else
|
||||
@ -91,7 +92,7 @@ $(BINDIR)$(PROJECT)/%.o: %.c $(PROJDEPS)
|
||||
clean:
|
||||
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD) clean
|
||||
"$(MAKE)" -C $(RIOTBASE) clean
|
||||
@for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i clean ; done ;
|
||||
@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTBASE)/pkg/$$i clean ; done ;
|
||||
rm -rf $(BINDIR)
|
||||
|
||||
flash: all
|
||||
|
Loading…
Reference in New Issue
Block a user