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