diff options
author | yenatch <yenatch@gmail.com> | 2018-04-06 01:05:42 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2018-04-06 01:05:42 -0400 |
commit | ada00970875cd1f00532aa88e62cea941f497e0d (patch) | |
tree | 145a4a34ca2deda12feb7bae0d86eadd41d2057e | |
parent | ed5847cb41c48357d83b92823e08393a1ca54bdd (diff) |
wildcard source dirs
-rw-r--r-- | Makefile | 22 |
1 files changed, 5 insertions, 17 deletions
@@ -29,29 +29,17 @@ CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef -Werror -Wno ROM := poke$(BUILD_NAME).gba MAP := $(ROM:%.gba=%.map) -SUBDIRS := \ - sound \ - sound/songs \ - asm \ - data \ - src \ - src/battle \ - src/battle/anim \ - src/field \ - src/debug \ - src/scene \ - src/pokemon \ - src/engine \ - src/libs BUILD_DIR := build/$(BUILD_NAME) -C_SOURCES := $(foreach dir, $(SUBDIRS), $(wildcard $(dir)/*.c)) -ASM_SOURCES := $(foreach dir, $(SUBDIRS), $(wildcard $(dir)/*.s)) +C_SOURCES := $(wildcard src/*.c src/*/*.c src/*/*/*.c) +ASM_SOURCES := $(wildcard src/*.s src/*/*.s asm/*.s data/*.s sound/*.s sound/*/*.s) C_OBJECTS := $(addprefix $(BUILD_DIR)/, $(C_SOURCES:%.c=%.o)) ASM_OBJECTS := $(addprefix $(BUILD_DIR)/, $(ASM_SOURCES:%.s=%.o)) ALL_OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS) +SUBDIRS := $(sort $(dir $(ALL_OBJECTS))) + LIBC := tools/agbcc/lib/libc.a LIBGCC := tools/agbcc/lib/libgcc.a @@ -101,7 +89,7 @@ endif .DELETE_ON_ERROR: # Create build subdirectories -$(shell mkdir -p $(addprefix $(BUILD_DIR)/, $(SUBDIRS))) +$(shell mkdir -p $(SUBDIRS)) all: $(ROM) ifeq ($(COMPARE),1) |