forked from gbdev/rgbds
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/Makefile b/Makefile | ||
index fc5b476..67f6a36 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -102,12 +102,16 @@ bin/%.${ROMEXT}: $(patsubst src/%.asm,obj/%.o,${SRCS}) | ||
# (and produce weird errors). | ||
obj/%.mk: src/%.asm | ||
@${MKDIR_P} ${@D} | ||
- ${RGBASM} ${ASFLAGS} -M $@ -MG -MP -MQ ${@:.mk=.o} -MQ $@ -o ${@:.mk=.o} $< | ||
+ ${RGBASM} ${ASFLAGS} -M $@ -MG -MP -MQ $@ -MQ obj/$*.o -o obj/$*.o $< | ||
# DO NOT merge this with the rule above, otherwise Make will assume that the `.o` file is generated, | ||
# even when it isn't! | ||
# This causes weird issues that depend, among other things, on the version of Make. | ||
+# The rule is duplicated to work around a bug on certain OSes, where Make truncates timestamps to | ||
+# 1-second resolution; this causes the rule above not to always be re-run when all dependencies have | ||
+# been created... which means the `.o` file doesn't exist. | ||
obj/%.o: obj/%.mk | ||
- @touch $@ | ||
+ @${MKDIR_P} ${@D} | ||
+ ${RGBASM} ${ASFLAGS} -o $@ src/$*.asm | ||
|
||
ifeq ($(filter clean,${MAKECMDGOALS}),) | ||
include $(patsubst src/%.asm,obj/%.mk,${SRCS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters