1
0
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:
René Kijewski 2014-01-28 17:58:39 +01:00
parent d794900386
commit 5906f18a81
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -2,4 +2,4 @@ Packages are included to your project as external modules. Thus you only have
to add the following line to your project (and update your INCLUDE path
accordingly):
EXTERNAL+=$(RIOTBASE)/pkg/<pkg_name>
USEPKG += <pkg_name>