Add Linux Makefile
authorH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 30 Oct 2014 11:46:51 +0000 (12:46 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 30 Oct 2014 15:00:44 +0000 (16:00 +0100)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..6adf5c6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+srcdir = .
+
+CC?=gcc
+CFLAGS?= -O2 -s
+LDFLAGS?= -lpthread
+VERSION?=`grep 'define VERSION' UCI2WB.c | sed -e 's/.*"\(.*\)".*/\1/'`
+
+ALL= uci2wb uci2wb.6.gz
+
+all: ${ALL}
+
+uci2wb: UCI2WB.c
+       $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) UCI2WB.c -o uci2wb
+
+install: ${ALL}
+       install -d -m0755 $(DESTDIR)/usr/games
+       cp -u ${srcdir}/uci2wb $(DESTDIR)/usr/games
+       install -d -m0755 $(DESTDIR)/usr/share/man/man6
+       cp -u ${srcdir}/uci2wb.6.gz $(DESTDIR)/usr/share/man/man6
+
+uci2wb.6.gz: uci2wb.pod
+       pod2man -s 6 uci2wb.pod | gzip -9n > uci2wb.6.gz
+
+clean:
+       rm -f ${ALL}
+
+dist-clean:
+       rm -f ${ALL} *~ md5sums
+
+dist:
+       install -d -m0755 UCI2WB
+       rm -f uci2wb.tar uci2wb.tar.gz
+       cp UCI2WB.c uci2wb.pod Makefile README.txt UCI2WB
+       md5sum UCI2WB/* > UCI2WB/md5sums
+       tar -cvvf uci2wb-$(VERSION).tar UCI2WB
+       gzip uci2wb-$(VERSION).tar
+       rm UCI2WB/*
+       rmdir UCI2WB
+
+uninstall:
+       rm -f $(DESTDIR)/usr/share/man/man6/uci2wb.6.gz
+       rm -f $(DESTDIR)/usr/games/uci2wb
+