Updated makefile
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sun, 13 Jul 2014 09:25:17 +0000 (11:25 +0200)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Sun, 13 Jul 2014 09:25:17 +0000 (11:25 +0200)
2048-1.0.tar.gz [new file with mode: 0644]
Makefile

diff --git a/2048-1.0.tar.gz b/2048-1.0.tar.gz
new file mode 100644 (file)
index 0000000..f010e4f
Binary files /dev/null and b/2048-1.0.tar.gz differ
index bec914e..9649831 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,23 @@
-SRC = 2048.c
-CC=gcc
-clean:
-       rm -rf ./2048
+BINPATH=/usr/games
+MANPATH=/usr/share/man/man6
 all:
-       $(cc) 2048.c -o 2048
+       gcc 2048.c -o 2048
 install: all
-       mkdir -p /usr/games
-       cp 2048 /usr/games/2048
-       chmod 755 /usr/games/2048
-       mkdir -p /usr/share/man/man6
-       cp 2048.6 /usr/share/man/man6/
-       chmod 644 /usr/share/man/man6/2048.6
+       mkdir -p $(DESTDIR)$(BINPATH)
+       cp 2048 $(DESTDIR)$(BINPATH)/2048
+       chmod 755 $(DESTDIR)$(BINPATH)/2048
+       mkdir -p $(DESTDIR)$(MANPATH)
+       cp 2048.6 $(DESTDIR)$(MANPATH)/
+       chmod 644 $(DESTDIR)$(MANPATH)/2048.6
 uninstall :
-       rm -f /usr/games/2048
-       rm -f /usr/share/man/man6/2048.6
+       rm -f $(BINPATH)/2048
+       rm -f $(DESTDIR)$(MANPATH)/2048.6
+clean:
+       rm -rf ./2048
+       rm -rf ./2048-1.0.tar.gz
+dist: clean
+       mkdir -p 2048-1.0/
+       cp -R 2048.c 2048.6 Makefile 2048-1.0/
+       tar -czvf 2048-1.0.tar.gz 2048-1.0/
+       rm -rf 2048-1.0/
+       @echo Package created