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