diff --git a/examples/riot/hello_lf/Makefile b/examples/riot/hello_lf/Makefile index c4c53acd..c32fd990 100755 --- a/examples/riot/hello_lf/Makefile +++ b/examples/riot/hello_lf/Makefile @@ -24,12 +24,4 @@ QUIET ?= 1 # Enable reactor-uc features # CFLAGS += -DNETWORK_CHANNEL_TCP_POSIX -include $(SRC_GEN_PATH)/Makefile - -# Include generated c files -SRC += $(patsubst %, $(SRC_GEN_PATH)/%, $(LF_SOURCES)) main.c - -# Include generated h files -CFLAGS += -I$(SRC_GEN_PATH) - include $(SRC_GEN_PATH)/reactor-uc/make/riot/riot.mk diff --git a/make/riot/riot.mk b/make/riot/riot.mk index 9bcf50cc..4016fb53 100644 --- a/make/riot/riot.mk +++ b/make/riot/riot.mk @@ -1,5 +1,17 @@ RIOT_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +# Include generated sources and makefiles if SRC_GEN_PATH is defined +ifdef SRC_GEN_PATH +include $(SRC_GEN_PATH)/Makefile + +# Include generated c files +SRC += $(patsubst %, $(SRC_GEN_PATH)/%, $(LF_SOURCES)) main.c + +# Include generated h files +CFLAGS += -I$(SRC_GEN_PATH) +endif + +# Check if required environment variables exist ifndef RIOTBASE $(error RIOTBASE is not defined. Please define it!) endif @@ -23,7 +35,7 @@ QUIET ?= 1 # Use a peripheral timer for the delay, if available FEATURES_OPTIONAL += periph_timer -# External modules +# Include reactor-uc as an external module EXTERNAL_MODULE_DIRS += $(RIOT_MK_DIR)/external_modules USEMODULE += reactor-uc