Allow filtering out files from build.

This commit is contained in:
Steven Smith 2016-04-12 19:41:47 -07:00
parent b26c7e3ffa
commit d940eec592

View file

@ -33,6 +33,11 @@ EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
STRIPPED_NAME := $(subst $(SPACE),,$(NAME))
BUILT_FILTER := $(patsubst %.bin,$(BUILD_DIR)/%.bin.o,$(BUILD_FILTER)) \
$(patsubst %.c,$(BUILD_DIR)/%.o,$(BUILD_FILTER)) \
$(patsubst %.cpp,$(BUILD_DIR)/%.o,$(BUILD_FILTER)) \
$(patsubst %.s,$(BUILD_DIR)/%.o,$(BUILD_FILTER))
OBJECT_FILES := $(foreach dir,$(SOURCE_DIRS), \
$(patsubst %.bin,$(BUILD_DIR)/%.bin.o,$(call rwildcard,$(dir),*.bin)) \
$(patsubst %.c,$(BUILD_DIR)/%.o,$(call rwildcard,$(dir),*.c)) \
@ -40,6 +45,8 @@ OBJECT_FILES := $(foreach dir,$(SOURCE_DIRS), \
$(patsubst %.s,$(BUILD_DIR)/%.o,$(call rwildcard,$(dir),*.s)) \
)
OBJECT_FILES := $(filter-out $(BUILT_FILTER),$(OBJECT_FILES))
OUTPUT_ZIP_FILE := $(OUTPUT_DIR)/$(STRIPPED_NAME).zip
LD_FLAGS := $(patsubst %,-L%/lib,$(LIBRARY_DIRS)) $(patsubst %,-l%,$(LIBRARIES))
@ -58,11 +65,16 @@ endif
# TARGET SETUP #
ifeq ($(TARGET),3DS)
BUILT_FILTER := $(patsubst %.v.pica,$(BUILD_DIR)/%.shbin.o,$(BUILD_FILTER)) \
$(patsubst %.shlist,$(BUILD_DIR)/%.shbin.o,$(BUILD_FILTER)) \
OBJECT_FILES := $(foreach dir,$(SOURCE_DIRS), \
$(patsubst %.v.pica,$(BUILD_DIR)/%.shbin.o,$(call rwildcard,$(dir),*.v.pica)) \
$(patsubst %.shlist,$(BUILD_DIR)/%.shbin.o,$(call rwildcard,$(dir),*.shlist)) \
) $(OBJECT_FILES)
OBJECT_FILES := $(filter-out $(BUILT_FILTER),$(OBJECT_FILES))
ifeq ($(strip $(TITLE)),)
TITLE := $(NAME)
endif