Reduce repetition in Makefile

This commit is contained in:
Jeremy Baxter 2023-05-11 18:58:16 +12:00
parent 7d96227dc2
commit 64fca717c6

View file

@ -1,26 +1,25 @@
PROG = esv
IMPORT = import IMPORT = import
PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = /usr/share/man MANPREFIX = /usr/share/man
DC = ldc2 DC = ldc2
CFLAGS = -O -I${IMPORT} CFLAGS = -O -I${IMPORT} -w
OBJS = main.o esv.o ini.o OBJS = main.o esv.o ini.o
all: esv all: esv
esv: ${OBJS} esv: ${OBJS}
${DC} ${CFLAGS} -of=${PROG} ${OBJS} ${DC} ${CFLAGS} -of$@ ${OBJS}
# main executable # main executable
main.o: main.d esv.o main.o: main.d esv.o
${DC} -c ${CFLAGS} main.d -of=main.o ${DC} ${CFLAGS} -c main.d -of$@
esv.o: esv.d esv.o: esv.d
${DC} -c -i ${CFLAGS} esv.d -of=esv.o ${DC} ${CFLAGS} -c esv.d -of$@
ini.o: ${IMPORT}/dini/*.d ini.o: ${IMPORT}/dini/*.d
${DC} -c -i ${CFLAGS} ${IMPORT}/dini/*.d -of=ini.o ${DC} ${CFLAGS} -c ${IMPORT}/dini/*.d -of$@
clean: clean:
rm -f ${PROG} ${OBJS} rm -f ${PROG} ${OBJS}