Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ISSOtm committed Nov 5, 2023
1 parent 408adaa commit ea472e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions test/patches/gb-starter-kit.patch
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})
2 changes: 1 addition & 1 deletion test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test_downstream() { # owner/repo make-target
return 1
fi
make clean
make -j4 $2 RGBDS=../../
make -drj4 $2 RGBDS=../../
popd
}

Expand Down

0 comments on commit ea472e8

Please sign in to comment.