Let Makefile pay attention to $(DESTDIR)
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 17 Jan 2010 21:04:24 +0000 (22:04 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 17 Jan 2010 21:04:24 +0000 (22:04 +0100)
Patch requested by Debian

Makefile

index e4e2fc0..4788221 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,13 +18,13 @@ maxqi: maxqi.c
        $(CC) $(CFLAGS) -DINI_FILE=\"/usr/share/games/fairymax/qmax.ini\" maxqi.c -o maxqi
 
 install: ${ALL} ${srcdir}/data/*
-       cp -u ${srcdir}/fairymax /usr/games
-       cp -u ${srcdir}/shamax /usr/games
-       cp -u ${srcdir}/maxqi /usr/games
-       install -d -m0755 /usr/share/games/fairymax
-       cp -u ${srcdir}/data/* /usr/share/games/fairymax
-       install -d -m0755 /usr/share/man/man6
-       cp -u ${srcdir}/fairymax.6.gz /usr/share/man/man6
+       cp -u ${srcdir}/fairymax $(DESTDIR)/usr/games
+       cp -u ${srcdir}/shamax $(DESTDIR)/usr/games
+       cp -u ${srcdir}/maxqi $(DESTDIR)/usr/games
+       install -d -m0755 $(DESTDIR)/usr/share/games/fairymax
+       cp -u ${srcdir}/data/* $(DESTDIR)/usr/share/games/fairymax
+       install -d -m0755 $(DESTDIR)/usr/share/man/man6
+       cp -u ${srcdir}/fairymax.6.gz $(DESTDIR)/usr/share/man/man6
 
 fairymax.6.gz: fairymax.pod
        pod2man -s 6 fairymax.pod > fmax.man
@@ -45,10 +45,10 @@ dist:
        gzip fairymax.tar
 
 uninstall:
-       rm -f /usr/share/games/fairymax/*
-       rmdir /usr/share/games/fairymax
-       rm -f /usr/share/man/man6/fairymax.6.gz
-       rm -f /usr/games/fairymax
-       rm -f /usr/games/shamax
-       rm -f /usr/games/maxqi
+       rm -f $(DESTDIR)/usr/share/games/fairymax/*
+       rmdir $(DESTDIR)/usr/share/games/fairymax
+       rm -f $(DESTDIR)/usr/share/man/man6/fairymax.6.gz
+       rm -f $(DESTDIR)/usr/games/fairymax
+       rm -f $(DESTDIR)/usr/games/shamax
+       rm -f $(DESTDIR)/usr/games/maxqi