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