I recently wanted the change the name of the "out" directory for my current project. When trying to introduce a variable "$(OUT)" for this in the makefile, I ran into the problem that the output location is hardcoded in boot/sega.s:
Code: Select all
.incbin "out/rom_head.bin", 0x10, 0x100
So, if we rename sega.s to sega.S we can write:
Code: Select all
.incbin ROM_HEAD, 0x10, 0x100
Code: Select all
OUT=...
$(OUT)/sega.o: $(OUT)/rom_head.bin $(SRC)/boot/sega.S
$(CC) $(DEFAULT_FLAGS) -DROM_HEAD="\"$<\"" -c $(SRC)/boot/sega.S -o $@