shithub: rgbds

Download patch

ref: 6d9399e3a047a82b84f43d3ab5a2c51c30a5c4cf
parent: 4dfa3157e568137e71b4351f16fb7fc0927d740e
author: ISSOtm <[email protected]>
date: Wed Jan 8 19:27:22 EST 2020

Always update version
Implements https://github.com/rednex/rgbds/pull/378#issuecomment-569836686

--- a/Makefile
+++ b/Makefile
@@ -35,12 +35,12 @@
 CFLAGS		:= -g -O0
 # Non-overridable CFLAGS
 REALCFLAGS	:= ${CFLAGS} ${WARNFLAGS} -std=c11 -D_POSIX_C_SOURCE=200809L \
-		   -D_DEFAULT_SOURCE -Iinclude \
-		   -DBUILD_VERSION_STRING=\"${VERSION_STRING}\"
+		   -D_DEFAULT_SOURCE -Iinclude
 # Overridable LDFLAGS
 LDFLAGS		:=
 # Non-overridable LDFLAGS
-REALLDFLAGS	:= ${LDFLAGS} ${WARNFLAGS}
+REALLDFLAGS	:= ${LDFLAGS} ${WARNFLAGS} \
+		   -DBUILD_VERSION_STRING=\"${VERSION_STRING}\"
 
 YFLAGS		:=
 
@@ -67,8 +67,7 @@
 	src/asm/warning.o \
 	src/extern/err.o \
 	src/extern/getopt.o \
-	src/extern/utf8decoder.o \
-	src/version.o
+	src/extern/utf8decoder.o
 
 src/asm/globlex.o src/asm/lexer.o src/asm/constexpr.o: src/asm/asmy.h
 
@@ -83,14 +82,12 @@
 	src/link/symbol.o \
 	src/extern/err.o \
 	src/extern/getopt.o \
-	src/hashmap.o \
-	src/version.o
+	src/hashmap.o
 
 rgbfix_obj := \
 	src/fix/main.o \
 	src/extern/err.o \
-	src/extern/getopt.o \
-	src/version.o
+	src/extern/getopt.o
 
 rgbgfx_obj := \
 	src/gfx/gb.o \
@@ -97,20 +94,19 @@
 	src/gfx/main.o \
 	src/gfx/makepng.o \
 	src/extern/err.o \
-	src/extern/getopt.o \
-	src/version.o
+	src/extern/getopt.o
 
 rgbasm: ${rgbasm_obj}
-	$Q${CC} ${REALLDFLAGS} -o $@ ${rgbasm_obj} -lm
+	$Q${CC} ${REALLDFLAGS} -o $@ ${rgbasm_obj} ${REALCFLAGS} src/version.c -lm
 
 rgblink: ${rgblink_obj}
-	$Q${CC} ${REALLDFLAGS} -o $@ ${rgblink_obj}
+	$Q${CC} ${REALLDFLAGS} -o $@ ${rgblink_obj} ${REALCFLAGS} src/version.c
 
 rgbfix: ${rgbfix_obj}
-	$Q${CC} ${REALLDFLAGS} -o $@ ${rgbfix_obj}
+	$Q${CC} ${REALLDFLAGS} -o $@ ${rgbfix_obj} ${REALCFLAGS} src/version.c
 
 rgbgfx: ${rgbgfx_obj}
-	$Q${CC} ${REALLDFLAGS} ${PNGLDFLAGS} -o $@ ${rgbgfx_obj} ${PNGLDLIBS}
+	$Q${CC} ${REALLDFLAGS} ${PNGLDFLAGS} -o $@ ${rgbgfx_obj} ${REALCFLAGS} src/version.c ${PNGLDLIBS}
 
 # Rules to process files