tMakefile: use $OBJ for shared objects and simplify build rules - granular - granular dynamics simulation
(HTM) git clone git://src.adamsgaard.dk/granular
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit fef9eb22a304c90e4aed9a94978a8efe6c13fb26
(DIR) parent 77f4841b23dac005c3a158c00a2c03b42fce59e6
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 28 Mar 2021 09:19:55 +0200
Makefile: use $OBJ for shared objects and simplify build rules
Diffstat:
M Makefile | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -15,11 +15,18 @@ BIN = \
SCRIPTS = \
granular2pdf
-SRC = ${BIN:=.c} arrays.c grain.c granular.c packing.c simulation.c util.c
+SRC = \
+ arrays.c\
+ grain.c\
+ grains.c\
+ packing.c\
+ simulation.c\
+ util.c
HDR = \
arg.h\
arrays.h\
grain.h\
+ grains.h\
granular.h\
packing.h\
simulation.h\
t@@ -52,20 +59,14 @@ ${OBJ}: ${HDR}
.c.o:
${CC} ${GRANULAR_CFLAGS} ${GRANULAR_CPPFLAGS} -o $@ -c $<
-granularpacking: granularpacking.o arrays.o grain.o packing.o simulation.o util.o
- ${CC}\
- granularpacking.o arrays.o grain.o packing.o simulation.o util.o\
- -o $@ ${GRANULAR_LDFLAGS}
+granularpacking: granularpacking.o ${OBJ}
+ ${CC} granularpacking.o ${OBJ} -o $@ ${GRANULAR_LDFLAGS}
-granular2vtu: granular2vtu.o arrays.o grain.o simulation.o util.o
- ${CC}\
- granular2vtu.o arrays.o grain.o simulation.o util.o\
- -o $@ ${GRANULAR_LDFLAGS}
+granular2vtu: granular2vtu.o ${OBJ}
+ ${CC} granular2vtu.o ${OBJ} -o $@ ${GRANULAR_LDFLAGS}
-granular: granular.o arrays.o grain.o packing.o simulation.o util.o
- ${CC}\
- granular.o arrays.o grain.o packing.o simulation.o util.o\
- -o $@ ${GRANULAR_LDFLAGS}
+granular: granular.o ${OBJ}
+ ${CC} granular.o ${OBJ} -o $@ ${GRANULAR_LDFLAGS}
dist:
rm -rf "${NAME}-${VERSION}"