perl 2.0 (no announcement message available)
[p5sagit/p5-mst-13.2.git] / x2p / Makefile.SH
1 case $CONFIG in
2 '')
3     if test ! -f config.sh; then
4         ln ../config.sh . || \
5         ln ../../config.sh . || \
6         ln ../../../config.sh . || \
7         (echo "Can't find config.sh."; exit 1)
8     fi
9     . ./config.sh
10     ;;
11 esac
12 case "$0" in
13 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
14 esac
15 case "$mallocsrc" in
16 '') ;;
17 *) mallocsrc="../$mallocsrc";;
18 esac
19 echo "Extracting x2p/Makefile (with variable substitutions)"
20 cat >Makefile <<!GROK!THIS!
21 # $Header: Makefile.SH,v 2.0 88/06/05 00:15:31 root Exp $
22 #
23 # $Log: Makefile.SH,v $
24 # Revision 2.0  88/06/05  00:15:31  root
25 # Baseline version 2.0.
26
27
28
29 CC = $cc
30 bin = $bin
31 lib = $lib
32 mansrc = $mansrc
33 manext = $manext
34 CFLAGS = $ccflags -O
35 LDFLAGS = $ldflags
36 SMALL = $small
37 LARGE = $large $split
38 mallocsrc = $mallocsrc
39 mallocobj = $mallocobj
40
41 libs = $libnm -lm
42 !GROK!THIS!
43
44 cat >>Makefile <<'!NO!SUBS!'
45
46 public = a2p s2p
47
48 private = 
49
50 manpages = a2p.man s2p.man
51
52 util =
53
54 sh = Makefile.SH makedepend.SH
55
56 h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
57
58 c = hash.c $(mallocsrc) str.c util.c walk.c
59
60 obj = hash.o $(mallocobj) str.o util.o walk.o
61
62 lintflags = -phbvxac
63
64 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
65
66 # grrr
67 SHELL = /bin/sh
68
69 .c.o:
70         $(CC) -c $(CFLAGS) $(LARGE) $*.c
71
72 all: $(public) $(private) $(util)
73         touch all
74
75 a2p: $(obj) a2p.o
76         $(CC) $(LDFLAGS) $(LARGE) $(obj) a2p.o $(libs) -o a2p
77
78 a2p.c: a2p.y
79         @ echo Expect 103 shift/reduce errors...
80         yacc a2p.y
81         mv y.tab.c a2p.c
82
83 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
84         $(CC) -c $(CFLAGS) $(LARGE) a2p.c
85
86 # if a .h file depends on another .h file...
87 $(h):
88         touch $@
89 install: a2p s2p
90 # won't work with csh
91         export PATH || exit 1
92         - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
93         - mv $(bin)/s2p $(bin)/s2p.old
94         - if test `pwd` != $(bin); then cp $(public) $(bin); fi
95         cd $(bin); \
96 for pub in $(public); do \
97 chmod +x `basename $$pub`; \
98 done
99 #       chmod +x makedir
100 #       - ./makedir `filexp $(lib)`
101 #       - \
102 #if test `pwd` != `filexp $(lib)`; then \
103 #cp $(private) `filexp $(lib)`; \
104 #fi
105 #       cd `filexp $(lib)`; \
106 #for priv in $(private); do \
107 #chmod +x `basename $$priv`; \
108 #done
109         - if test `pwd` != $(mansrc); then \
110 for page in $(manpages); do \
111 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
112 done; \
113 fi
114
115 clean:
116         rm -f *.o
117
118 realclean:
119         rm -f a2p *.orig */*.orig *.o core $(addedbyconf)
120
121 # The following lint has practically everything turned on.  Unfortunately,
122 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
123 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
124 # for that spot.
125
126 lint:
127         lint $(lintflags) $(defs) $(c) > a2p.fuzz
128
129 depend: ../makedepend
130         ../makedepend
131
132 clist:
133         echo $(c) | tr ' ' '\012' >.clist
134
135 hlist:
136         echo $(h) | tr ' ' '\012' >.hlist
137
138 shlist:
139         echo $(sh) | tr ' ' '\012' >.shlist
140
141 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
142 $(obj):
143         @ echo "You haven't done a "'"make depend" yet!'; exit 1
144 makedepend: makedepend.SH
145         /bin/sh makedepend.SH
146 !NO!SUBS!
147 $eunicefix Makefile
148 case `pwd` in
149 *SH)
150     $rm -f ../Makefile
151     ln Makefile ../Makefile
152     ;;
153 esac