Skip to content

Commit

Permalink
Delete LF_SRC_GEN_PATH if make clean is run on RIOT OS with riot-lfc.…
Browse files Browse the repository at this point in the history
…mk (#184)
  • Loading branch information
LasseRosenow authored Jan 10, 2025
1 parent b09c2ed commit ef389c9
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions make/riot/riot-lfc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,28 @@ APPLICATION ?= $(LF_MAIN)
# Path of generated lf c-code
LF_SRC_GEN_PATH ?= $(CURDIR)/src-gen/$(LF_MAIN)

# Include the Makefile of the generated target application
include $(LF_SRC_GEN_PATH)/Makefile
# Only include generated files if build target is not "clean"
# In this case the src-gen folder was deleted
ifeq ($(MAKECMDGOALS),clean)
# Delete src-gen folder if build target is "clean"
_ := $(shell rm -rf $(LF_SRC_GEN_PATH))
else
# Include the Makefile of the generated target application
include $(LF_SRC_GEN_PATH)/Makefile

# Include generated c files
SRC += $(patsubst %, $(LF_SRC_GEN_PATH)/%, $(LFC_GEN_SOURCES))

# Include generated main file
SRC += $(LF_SRC_GEN_PATH)/${LFC_GEN_MAIN}

# Include generated h files
CFLAGS += -I$(LF_SRC_GEN_PATH)
endif

# Include generated c files
SRC += $(patsubst %, $(LF_SRC_GEN_PATH)/%, $(LFC_GEN_SOURCES))

# Include generated main file
SRC += $(LF_SRC_GEN_PATH)/${LFC_GEN_MAIN}
ifneq ($(MAKECMDGOALS),clean)

# Include generated h files
CFLAGS += -I$(LF_SRC_GEN_PATH)
endif

include $(RIOT_MK_DIR)/riot.mk

0 comments on commit ef389c9

Please sign in to comment.