Fixed sources sub folder support and added a second depth of recursion (should be enough)
@@ -27,18 +27,22 @@ MKDIR= $(BIN)/mkdir
SRC_C= $(wildcard *.c)
SRC_C+= $(wildcard $(SRC)/*.c)
-SRC_C+= $(wildcard $(SRC)/**/*.c)
+SRC_C+= $(wildcard $(SRC)/*/*.c)
+SRC_C+= $(wildcard $(SRC)/*/*/*.c)
SRC_C:= $(filter-out $(SRC)/boot/rom_head.c,$(SRC_C))
SRC_S= $(wildcard *.s)
SRC_S+= $(wildcard $(SRC)/*.s)
-SRC_S+= $(wildcard $(SRC)/**/*.s)
+SRC_S+= $(wildcard $(SRC)/*/*.s)
+SRC_S+= $(wildcard $(SRC)/*/*/*.s)
SRC_S:= $(filter-out $(SRC)/boot/sega.s,$(SRC_S))
SRC_ASM= $(wildcard *.asm)
SRC_ASM+= $(wildcard $(SRC)/*.asm)
-SRC_ASM+= $(wildcard $(SRC)/**/*.asm)
+SRC_ASM+= $(wildcard $(SRC)/*/*.asm)
+SRC_ASM+= $(wildcard $(SRC)/*/*/*.asm)
SRC_S80= $(wildcard *.s80)
SRC_S80+= $(wildcard $(SRC)/*.s80)
-SRC_S80+= $(wildcard $(SRC)/**/*.s80)
+SRC_S80+= $(wildcard $(SRC)/*/*.s80)
+SRC_S80+= $(wildcard $(SRC)/*/*/*.s80)
RES_C= $(wildcard $(RES)/*.c)
RES_S= $(wildcard $(RES)/*.s)
@@ -75,6 +79,7 @@ FLAGSZ80= -i$(SRC) -i$(INCLUDE) -i$(RES) -i$(LIBSRC) -i$(LIBINCLUDE)
release: FLAGS= $(DEFAULT_FLAGS) -O3 -fuse-linker-plugin -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -flto
release: LIBMD= $(LIB)/libmd.a
release: pre-build out/rom.bin out/symbol.txt
+#release: $(info $$var is [${SRC_C}])
debug: FLAGS= $(DEFAULT_FLAGS) -O1 -ggdb -DDEBUG=1
debug: LIBMD= $(LIB)/libmd_debug.a
@@ -128,8 +133,6 @@ cleanAsm: cleanasm
pre-build:
$(MKDIR) -p $(SRC)/boot
$(MKDIR) -p out
- $(MKDIR) -p out/src
- $(MKDIR) -p out/res
out/rom.bin: out/rom.out
@@ -163,15 +166,19 @@ $(SRC)/boot/rom_head.c: $(LIBSRC)/boot/rom_head.c
out/%.lst: %.c
+ $(MKDIR) -p $(dir $@)
$(CC) $(FLAGS) -c $< -o $@
out/%.o: %.c
+ $(MKDIR) -p $(dir $@)
$(CC) $(FLAGS) -MMD -c $< -o $@
out/%.o: %.s
+ $(MKDIR) -p $(dir $@)
$(CC) -x assembler-with-cpp $(FLAGS) -MMD -c $< -o $@
out/%.o: %.rs
+ $(MKDIR) -p $(dir $@)
$(CC) -x assembler-with-cpp $(FLAGS) -c $*.rs -o $@
$(CP) $*.d out/$*.d
$(RM) $*.d
