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