Commit | Line | Data |
---|---|---|
a687059c | 1 | case "$0" in |
2 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
3 | esac | |
8d063cd8 | 4 | case $CONFIG in |
5 | '') | |
6 | if test ! -f config.sh; then | |
7 | ln ../config.sh . || \ | |
7e1cf235 | 8 | ln -s ../config.sh . || \ |
8d063cd8 | 9 | ln ../../config.sh . || \ |
10 | ln ../../../config.sh . || \ | |
11 | (echo "Can't find config.sh."; exit 1) | |
fe14fcc3 | 12 | fi 2>/dev/null |
378cc40b | 13 | . ./config.sh |
8d063cd8 | 14 | ;; |
15 | esac | |
8d063cd8 | 16 | echo "Extracting x2p/Makefile (with variable substitutions)" |
bf10efe7 | 17 | rm -f Makefile |
8d063cd8 | 18 | cat >Makefile <<!GROK!THIS! |
79072805 | 19 | # $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:07 $ |
8d063cd8 | 20 | # |
21 | # $Log: Makefile.SH,v $ | |
79072805 | 22 | # Revision 4.1 92/08/07 18:29:07 lwall |
23 | # | |
bf10efe7 | 24 | # Revision 4.0.1.3 92/06/08 16:11:32 lwall |
25 | # patch20: SH files didn't work well with symbolic links | |
26 | # patch20: cray didn't give enough memory to /bin/sh | |
27 | # patch20: makefiles now display new shift/reduce expectations | |
28 | # | |
f1ca563b | 29 | # Revision 4.0.1.2 91/11/05 19:19:04 lwall |
30 | # patch11: random cleanup | |
31 | # | |
d48672a2 | 32 | # Revision 4.0.1.1 91/06/07 12:12:14 lwall |
33 | # patch4: cflags now emits entire cc command except for the filename | |
34 | # | |
fe14fcc3 | 35 | # Revision 4.0 91/03/20 01:57:03 lwall |
36 | # 4.0 baseline. | |
8d063cd8 | 37 | # |
38 | # | |
39 | ||
40 | CC = $cc | |
d8f2e4cc | 41 | YACC = $yacc |
8d063cd8 | 42 | bin = $bin |
43 | lib = $lib | |
44 | mansrc = $mansrc | |
45 | manext = $manext | |
8d063cd8 | 46 | LDFLAGS = $ldflags |
47 | SMALL = $small | |
48 | LARGE = $large $split | |
a1cc2bdc | 49 | mallocsrc = $mallocsrc |
50 | mallocobj = $mallocobj | |
bf10efe7 | 51 | shellflags = $shellflags |
8d063cd8 | 52 | |
b6ccd89c | 53 | libs = $libs |
8d063cd8 | 54 | !GROK!THIS! |
55 | ||
56 | cat >>Makefile <<'!NO!SUBS!' | |
57 | ||
bf10efe7 | 58 | CCCMD = `sh $(shellflags) cflags $@` |
d48672a2 | 59 | |
fe14fcc3 | 60 | public = a2p s2p find2perl |
8d063cd8 | 61 | |
62 | private = | |
63 | ||
64 | manpages = a2p.man s2p.man | |
65 | ||
66 | util = | |
67 | ||
68 | sh = Makefile.SH makedepend.SH | |
69 | ||
bf10efe7 | 70 | h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h |
8d063cd8 | 71 | |
a1cc2bdc | 72 | c = hash.c $(mallocsrc) str.c util.c walk.c |
8d063cd8 | 73 | |
a1cc2bdc | 74 | obj = hash.o $(mallocobj) str.o util.o walk.o |
8d063cd8 | 75 | |
76 | lintflags = -phbvxac | |
77 | ||
78 | addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 | |
79 | ||
80 | # grrr | |
81 | SHELL = /bin/sh | |
82 | ||
83 | .c.o: | |
d48672a2 | 84 | $(CCCMD) $*.c |
8d063cd8 | 85 | |
86 | all: $(public) $(private) $(util) | |
87 | touch all | |
88 | ||
89 | a2p: $(obj) a2p.o | |
d48672a2 | 90 | $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p |
8d063cd8 | 91 | |
92 | a2p.c: a2p.y | |
bf10efe7 | 93 | @ echo Expect 231 shift/reduce conflicts... |
d8f2e4cc | 94 | $(YACC) a2p.y |
8d063cd8 | 95 | mv y.tab.c a2p.c |
96 | ||
b6ccd89c | 97 | a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h |
d48672a2 | 98 | $(CCCMD) $(LARGE) a2p.c |
8d063cd8 | 99 | |
8d063cd8 | 100 | install: a2p s2p |
101 | # won't work with csh | |
102 | export PATH || exit 1 | |
378cc40b | 103 | - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null |
a687059c | 104 | - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null |
8d063cd8 | 105 | - if test `pwd` != $(bin); then cp $(public) $(bin); fi |
106 | cd $(bin); \ | |
107 | for pub in $(public); do \ | |
378cc40b | 108 | chmod +x `basename $$pub`; \ |
8d063cd8 | 109 | done |
8d063cd8 | 110 | - if test `pwd` != $(mansrc); then \ |
111 | for page in $(manpages); do \ | |
112 | cp $$page $(mansrc)/`basename $$page .man`.$(manext); \ | |
113 | done; \ | |
114 | fi | |
115 | ||
116 | clean: | |
bf10efe7 | 117 | rm -f a2p *.o a2p.c |
8d063cd8 | 118 | |
b6ccd89c | 119 | realclean: clean |
d48672a2 | 120 | rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags |
8d063cd8 | 121 | |
122 | # The following lint has practically everything turned on. Unfortunately, | |
123 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. | |
124 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message | |
125 | # for that spot. | |
126 | ||
127 | lint: | |
128 | lint $(lintflags) $(defs) $(c) > a2p.fuzz | |
129 | ||
f1ca563b | 130 | depend: $(mallocsrc) ../makedepend |
8d063cd8 | 131 | ../makedepend |
132 | ||
133 | clist: | |
134 | echo $(c) | tr ' ' '\012' >.clist | |
135 | ||
136 | hlist: | |
137 | echo $(h) | tr ' ' '\012' >.hlist | |
138 | ||
139 | shlist: | |
140 | echo $(sh) | tr ' ' '\012' >.shlist | |
141 | ||
03a14243 | 142 | config.sh: ../config.sh |
143 | rm -f config.sh | |
144 | ln ../config.sh . | |
145 | ||
f1ca563b | 146 | malloc.c: ../malloc.c |
79072805 | 147 | sed <../malloc.c >malloc.c \ |
148 | -e 's/"perl.h"/"..\/perl.h"/' \ | |
149 | -e 's/my_exit/exit/' | |
f1ca563b | 150 | |
8d063cd8 | 151 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
152 | $(obj): | |
153 | @ echo "You haven't done a "'"make depend" yet!'; exit 1 | |
154 | makedepend: makedepend.SH | |
bf10efe7 | 155 | /bin/sh $(shellflags) makedepend.SH |
8d063cd8 | 156 | !NO!SUBS! |
157 | $eunicefix Makefile | |
158 | case `pwd` in | |
159 | *SH) | |
160 | $rm -f ../Makefile | |
161 | ln Makefile ../Makefile | |
162 | ;; | |
163 | esac | |
f1ca563b | 164 | rm -f makefile |