commit 812fb3de573d8e4412dbf66aafd9f6b54828f635
parent eed6e94cd9af2c67920a537b5b2dd9fa41cf5378
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 11 Dec 2019 11:10:44 +0100
Move VERSION definition to Makefile
Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/1d_fd_simple_shear.c b/1d_fd_simple_shear.c
@@ -9,7 +9,6 @@
 #include "simulation.h"
 #include "fluid.h"
 
-#define VERSION "0.4.6"
 #define PROGNAME "1d_fd_simple_shear"
 
 #include "parameter_defaults.h"
diff --git a/Makefile b/Makefile
@@ -7,13 +7,16 @@ PREFIX ?= /usr/local
 INSTALL ?= install
 STRIP ?= strip
 
+VERSION = 0.4.6
+GLOBALCONST = -DVERSION=\"${VERSION}\"
+
 default: ${BIN}
 
 .o:
 	${CC} ${LDFLAGS} -o $@ ${LIBS}
 
 .c.o:
-	${CC} ${CFLAGS} -c $<
+	${CC} ${CFLAGS} ${GLOBALCONST} -c $<
 
 1d_fd_simple_shear: 1d_fd_simple_shear.o arrays.o fluid.o simulation.o ${HDR}
 	${CC} ${LDFLAGS} 1d_fd_simple_shear.o arrays.o fluid.o simulation.o -o $@
diff --git a/max_depth_simple_shear.c b/max_depth_simple_shear.c
@@ -9,7 +9,6 @@
 #include "simulation.h"
 #include "fluid.h"
 
-#define VERSION "0.4.6"
 #define PROGNAME "1d_fd_simple_shear"
 
 #include "parameter_defaults.h"