diff --git a/pkg/semtech-loramac/Makefile b/pkg/semtech-loramac/Makefile index 87edb202c9..96c36e9e52 100644 --- a/pkg/semtech-loramac/Makefile +++ b/pkg/semtech-loramac/Makefile @@ -5,10 +5,21 @@ PKG_LICENSE=BSD-3-Clause include $(RIOTBASE)/pkg/pkg.mk -all: - @cp Makefile.loramac $(PKG_BUILDDIR)/Makefile - @cp Makefile.loramac_mac $(PKG_BUILDDIR)/src/mac/Makefile - @cp Makefile.loramac_region $(PKG_BUILDDIR)/src/mac/region/Makefile - @cp Makefile.loramac_crypto $(PKG_BUILDDIR)/src/system/crypto/Makefile - @cp Makefile.loramac_arch $(PKG_BUILDDIR)/src/boards/mcu/Makefile - "$(MAKE)" -C $(PKG_BUILDDIR) +INCLUDES += -I$(PKGDIRBASE)/semtech-loramac/src/mac \ + -I$(PKGDIRBASE)/semtech-loramac/src/boards/mcu \ + -I$(PKGDIRBASE)/semtech-loramac/src/system/crypto \ + -I$(PKGDIRBASE)/semtech-loramac/src + +LORAMAC_MODULES = loramac_arch loramac_crypto loramac_mac loramac_region + +DIR_loramac_arch = boards/mcu +DIR_loramac_crypto = system/crypto +DIR_loramac_mac = mac +DIR_loramac_region = mac/region + +.PHONY: loramac_% + +all: $(LORAMAC_MODULES) + +loramac_%: + "$(MAKE)" -C $(PKG_BUILDDIR)/src/$(DIR_$@) -f $(CURDIR)/Makefile.$@ diff --git a/pkg/semtech-loramac/Makefile.include b/pkg/semtech-loramac/Makefile.include index 0cb55cc644..17561da88d 100644 --- a/pkg/semtech-loramac/Makefile.include +++ b/pkg/semtech-loramac/Makefile.include @@ -7,3 +7,7 @@ LORA_REGION ?= EU868 CFLAGS += -DREGION_$(LORA_REGION) CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_$(LORA_REGION) + +# There's no concrete semtech-loramac module that is built so declare it as a +# pseudo module. +PSEUDOMODULES += semtech-loramac diff --git a/pkg/semtech-loramac/Makefile.loramac b/pkg/semtech-loramac/Makefile.loramac deleted file mode 100644 index f69a33033f..0000000000 --- a/pkg/semtech-loramac/Makefile.loramac +++ /dev/null @@ -1,11 +0,0 @@ -DIRS += src/mac -DIRS += src/mac/region -DIRS += src/system/crypto -DIRS += src/boards/mcu - -INCLUDES += -I$(PKGDIRBASE)/semtech-loramac/src/mac \ - -I$(PKGDIRBASE)/semtech-loramac/src/boards/mcu \ - -I$(PKGDIRBASE)/semtech-loramac/src/system/crypto \ - -I$(PKGDIRBASE)/semtech-loramac/src - -include $(RIOTBASE)/Makefile.base diff --git a/pkg/semtech-loramac/Makefile.loramac_arch b/pkg/semtech-loramac/Makefile.loramac_arch index 322226aa18..6ebfa64707 100644 --- a/pkg/semtech-loramac/Makefile.loramac_arch +++ b/pkg/semtech-loramac/Makefile.loramac_arch @@ -1,6 +1,6 @@ -MODULE := semtech_loramac_arch +MODULE = semtech_loramac_arch -SRCS := utilities.c +SRC = utilities.c CFLAGS += -Wno-sign-compare diff --git a/pkg/semtech-loramac/Makefile.loramac_crypto b/pkg/semtech-loramac/Makefile.loramac_crypto index d191c20add..d164ab6dde 100644 --- a/pkg/semtech-loramac/Makefile.loramac_crypto +++ b/pkg/semtech-loramac/Makefile.loramac_crypto @@ -1,4 +1,4 @@ -MODULE := semtech_loramac_crypto +MODULE = semtech_loramac_crypto INCLUDES += -I$(PKGDIRBASE)/semtech-loramac/src/boards diff --git a/pkg/semtech-loramac/Makefile.loramac_mac b/pkg/semtech-loramac/Makefile.loramac_mac index 3fd69001a4..e0346d600c 100644 --- a/pkg/semtech-loramac/Makefile.loramac_mac +++ b/pkg/semtech-loramac/Makefile.loramac_mac @@ -1,4 +1,4 @@ -MODULE := semtech_loramac_mac +MODULE = semtech_loramac_mac CFLAGS += -Wno-sign-compare diff --git a/pkg/semtech-loramac/Makefile.loramac_region b/pkg/semtech-loramac/Makefile.loramac_region index 1d9ce93aa2..9e14bddaf1 100644 --- a/pkg/semtech-loramac/Makefile.loramac_region +++ b/pkg/semtech-loramac/Makefile.loramac_region @@ -1,4 +1,4 @@ -MODULE := semtech_loramac_mac_region +MODULE = semtech_loramac_mac_region CFLAGS += -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare