1166ff62 |
1 | # for `make release' and `make html' |
8a48d402 |
2 | DESTDIR = . |
3 | |
1166ff62 |
4 | # for `make install' |
5 | PREFIX = /usr/local |
6 | BINDIR = $(PREFIX)/bin |
c51c76d1 |
7 | SCRIPTDIR = $(PREFIX)/bin |
1166ff62 |
8 | MANDIR = $(PREFIX)/man/man1 |
f6cacff9 |
9 | INSTALL = install |
10 | IPROG =# flags for installing programs (default none) |
11 | IDATA = -m 0644 # flags for installing data |
1166ff62 |
12 | |
9acadc2b |
13 | X11LIB=-L/usr/X11R6/lib -lX11 |
14 | |
15 | all: xcopy.1 xcopy |
16 | |
17 | xcopy: xcopy.c |
18 | $(CC) $(CFLAGS) -o $@ $< $(X11LIB) |
19 | |
20 | %.1: %.but |
21 | halibut --man=$@ $< |
22 | |
23 | clean: |
8a48d402 |
24 | rm -f *.1 xcopy *.html *.tar.gz |
25 | |
26 | html: |
27 | halibut --html=$(DESTDIR)/xcopy.html xcopy.but |
28 | |
29 | release: xcopy.1 |
30 | mkdir -p reltmp/xcopy |
31 | ln -s ../../xcopy.c reltmp/xcopy |
32 | ln -s ../../xcopy.1 reltmp/xcopy |
33 | ln -s ../../xcopy.but reltmp/xcopy |
34 | ln -s ../../Makefile reltmp/xcopy |
ef397e72 |
35 | tar -C reltmp -chzf $(DESTDIR)/xcopy.tar.gz xcopy |
8a48d402 |
36 | rm -rf reltmp |
37 | |
1166ff62 |
38 | install: xcopy xcopy.1 |
39 | mkdir -p $(BINDIR) |
f6cacff9 |
40 | $(INSTALL) $(IPROG) xcopy $(BINDIR)/xcopy |
1166ff62 |
41 | mkdir -p $(MANDIR) |
f6cacff9 |
42 | $(INSTALL) $(IDATA) xcopy.1 $(MANDIR)/xcopy.1 |