Make suffix an array
[uci2wb.git] / Makefile
1 srcdir = .
2 prefix = /usr/local
3 exec_prefix=$(prefix)
4 bindir=$(exec_prefix)/bin
5 datadir=$(prefix)/share
6
7 CC?=gcc
8 CFLAGS?= -O2 -s
9 LDFLAGS?= -lpthread
10 VERSION?=`grep 'define VERSION' UCI2WB.c | sed -e 's/.*"\(.*\)".*/\1/'`
11
12 ALL= uci2wb uci2wb.6.gz
13
14 all: ${ALL}
15
16 uci2wb: UCI2WB.c
17         $(CC) $(CFLAGS) $(CPPFLAGS) UCI2WB.c -o uci2wb $(LDFLAGS)
18
19 install: ${ALL}
20         install -d -m0755 $(DESTDIR)$(bindir)
21         cp -u ${srcdir}/uci2wb $(DESTDIR)$(bindir)
22         install -d -m0755 $(DESTDIR)$(datadir)/man/man6
23         cp -u ${srcdir}/uci2wb.6.gz $(DESTDIR)$(datadir)/man/man6
24
25 uci2wb.6.gz: uci2wb.pod
26         pod2man -s 6 uci2wb.pod | gzip -9n > uci2wb.6.gz
27
28 clean:
29         rm -f ${ALL}
30
31 dist-clean:
32         rm -f ${ALL} *~ md5sums
33
34 dist:
35         install -d -m0755 UCI2WB
36         rm -f uci2wb.tar uci2wb.tar.gz
37         cp UCI2WB.c UCI2WB.rc rosetta.ico uci2wb.pod Makefile README.txt UCI2WB
38         md5sum UCI2WB/* > UCI2WB/md5sums
39         tar -cvvf uci2wb-$(VERSION).tar UCI2WB
40         gzip uci2wb-$(VERSION).tar
41         rm UCI2WB/*
42         rmdir UCI2WB
43
44 uninstall:
45         rm -f $(DESTDIR)$(datadir)/man/man6/uci2wb.6.gz
46         rm -f $(DESTDIR)$(bindir)/uci2wb
47