Slight improvements in Makefile
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 8 Oct 2011 12:45:54 +0000 (14:45 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sat, 8 Oct 2011 12:45:54 +0000 (14:45 +0200)
On request the Makefile is made more BSD friendly, and now also uses
DESTDIR in constructing the name of the ini files.

Makefile

index 8f259a8..ef2cc0a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
 srcdir = .
 
-CC=gcc
-CFLAGS += -O2
+CC?=gcc
+CFLAGS?= -O2 -s
+INI_F?=$(DESTDIR)/usr/share/games/fairymax/fmax.ini
+INI_Q?=$(DESTDIR)/usr/share/games/fairymax/qmax.ini
 
 
 ALL= fairymax shamax maxqi fairymax.6.gz
@@ -9,13 +11,13 @@ ALL= fairymax shamax maxqi fairymax.6.gz
 all: ${ALL}
 
 fairymax: fairymax.c
-       $(CC) $(CFLAGS) -DINI_FILE=\"/usr/share/games/fairymax/fmax.ini\" fairymax.c -o fairymax
+       $(CC) $(CFLAGS) -DINI_FILE=\"${INI_F}\" fairymax.c -o fairymax
 
 shamax: fairymax.c
-       $(CC) $(CFLAGS) -DINI_FILE=\"/usr/share/games/fairymax/fmax.ini\" -DSHATRANJ fairymax.c -o shamax
+       $(CC) $(CFLAGS) -DINI_FILE=\"${INI_F}\" -DSHATRANJ fairymax.c -o shamax
 
 maxqi: maxqi.c
-       $(CC) $(CFLAGS) -DINI_FILE=\"/usr/share/games/fairymax/qmax.ini\" maxqi.c -o maxqi
+       $(CC) $(CFLAGS) -DINI_FILE=\"${INI_Q}\" maxqi.c -o maxqi
 
 install: ${ALL} ${srcdir}/data/*
        cp -u ${srcdir}/fairymax $(DESTDIR)/usr/games