]> granicus.if.org Git - fortune-mod/blob - fortune-mod/datfiles/Makefile
f53a082fec42379be006cbe87a9d818d011e1f6d
[fortune-mod] / fortune-mod / datfiles / Makefile
1 TOP = ..
2
3 COOKIES=art ascii-art computers cookie definitions drugs education ethnic \
4         food fortunes goedel humorists kids law linuxcookie literature \
5         love magic medicine men-women miscellaneous news people pets \
6         platitudes politics riddles science songs-poems sports \
7         startrek translate-me wisdom work linux perl knghtbrd \
8         paradoxum zippy debian
9
10 STRFILE=../util/strfile
11
12 .PHONY: all cookies o-cookies w-cookies install clean
13
14 all: cookies o-cookies w-cookies
15
16 check: local-check o-check
17
18 local-check:
19         for i in $(COOKIES) ; \
20                 do \
21                         if ! sh $(TOP)/tests/scripts/check-fortune-file.sh "$$i" ; then \
22                                 exit 1; \
23                         fi ; \
24                 done;
25
26 o-check:
27         cd off && $(MAKE) OCOOKIEDIR=$(OCOOKIEDIR) check
28
29 cookies: cookies-stamp
30
31 o-cookies:
32         if [ $(OFFENSIVE) = 1 ] ; then \
33             cd off && $(MAKE) OCOOKIEDIR=$(OCOOKIEDIR) ; fi
34
35 w-cookies:
36         if [ $(WEB) = 1 ] ; then \
37             cd html && $(MAKE) WCOOKIEDIR=$(WCOOKIEDIR); fi
38
39 cookies-stamp:
40         rm -f *.dat
41         for i in $(COOKIES) ; \
42             do \
43                 $(STRFILE) $$i ; \
44                 ln -sf $$i $$i.u8 || exit $? ; \
45             done
46         touch cookies-stamp
47
48 install: cookies-stamp
49         install -m 0755 -d $(COOKIEDIR)
50         if [ $(OFFENSIVE) = 1 ] ; then cd off && $(MAKE) install ; fi
51         if [ $(WEB) = 1 ] ; then cd html && $(MAKE) install ; fi
52         for i in $(COOKIES) ; do \
53                 install -m 0644 $$i $$i.dat $(COOKIEDIR) || exit $? ; \
54                 cp -d $$i.u8 $(COOKIEDIR) ; \
55                 done
56
57 clean:
58         rm -f cookies-stamp *.dat
59         rm -f *.u8
60         cd off && $(MAKE) clean
61         cd html && $(MAKE) clean