-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (66 loc) · 2.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# @(#)Makefile 1.6 2003/12/29 Connectathon Testsuite
#
# 'make all' makes test programs
# 'make clean' cleans directories
# 'make copy DESTDIR=path' copies test programs to path
# 'make dist DESTDIR=path' copies sources to path
# 'make tar DESTDIR=path' runs make dist and then packs the directory
# 'make rpm DESTDIR=path' runs make tar and runs rpmbuild -ta on it
DESTDIR=/no/such/path
COPYFILES=runtests tests.init server domount.c README READWIN.txt Testitems \
getopt.c tests.h unixdos.h cthon04.spec
# generate tests.init file
$(shell ./tests.init.sh $(FSTYPE) $(OS))
include tests.init
all: domount getopt
cd basic; $(MAKE)
cd general; $(MAKE)
cd special; $(MAKE)
cd tools; $(MAKE)
cd lock; $(MAKE)
if test ! -x runtests; then chmod a+x runtests; fi
lint:
cd basic; $(MAKE) lint
cd special; $(MAKE) lint
cd tools; $(MAKE) lint
cd lock; $(MAKE) lint
domount: domount.c
$(CC) $(CFLAGS) -o $@ [email protected]
-chown root domount && chmod u+s domount
getopt: getopt.c
$(CC) $(CFLAGS) -o $@ [email protected]
clean:
rm -f domount getopt
cd basic; $(MAKE) clean
cd general; $(MAKE) clean
cd special; $(MAKE) clean
cd tools; $(MAKE) clean
cd lock; $(MAKE) clean
copy: mknewdirs
cp -f domount $(COPYFILES) $(DESTDIR)
cd basic; $(MAKE) copy DESTDIR=$(DESTDIR)/basic
cd general; $(MAKE) copy DESTDIR=$(DESTDIR)/general
cd special; $(MAKE) copy DESTDIR=$(DESTDIR)/special
cd tools; $(MAKE) copy DESTDIR=$(DESTDIR)/tools
cd lock; $(MAKE) copy DESTDIR=$(DESTDIR)/lock
dist: mknewdirs
cp -f Makefile $(COPYFILES) $(DESTDIR)
cd basic; $(MAKE) dist DESTDIR=$(DESTDIR)/basic
cd general; $(MAKE) dist DESTDIR=$(DESTDIR)/general
cd special; $(MAKE) dist DESTDIR=$(DESTDIR)/special
cd tools; $(MAKE) dist DESTDIR=$(DESTDIR)/tools
cd lock; $(MAKE) dist DESTDIR=$(DESTDIR)/lock
chmod u+w $(DESTDIR)/tests.init
chmod a+x $(DESTDIR)/server
tar: dist
cd $(DESTDIR) && tar --transform 's,^,cthon04-1/,' -cv -f cthon04.tar *
mv $(DESTDIR)/cthon04.tar .
rpm: tar
rpmbuild -ta cthon04.tar
mknewdirs:
-mkdir $(DESTDIR)/basic $(DESTDIR)/general $(DESTDIR)/special \
$(DESTDIR)/tools $(DESTDIR)/lock
.PHONY: tests.init
tests.init:
sh ./tests.init.sh $(FSTYPE) $(OS)