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! |
d8f2e4cc |
21 | # $Header: Makefile.SH,v 3.0.1.3 89/12/21 20:29:00 lwall Locked $ |
8d063cd8 |
22 | # |
23 | # $Log: Makefile.SH,v $ |
d8f2e4cc |
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 | # |
0d3e774c |
27 | # Revision 3.0.1.2 89/11/17 15:49:55 lwall |
d8f2e4cc |
28 | # patch: in x2p/Makefile.SH, removed reference to nm library |
0d3e774c |
29 | # |
03a14243 |
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 | # |
a687059c |
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 | # |
378cc40b |
42 | # Revision 2.0 88/06/05 00:15:31 root |
43 | # Baseline version 2.0. |
8d063cd8 |
44 | # |
45 | # |
46 | |
47 | CC = $cc |
d8f2e4cc |
48 | YACC = $yacc |
8d063cd8 |
49 | bin = $bin |
50 | lib = $lib |
51 | mansrc = $mansrc |
52 | manext = $manext |
a687059c |
53 | CFLAGS = $ccflags $optimize |
8d063cd8 |
54 | LDFLAGS = $ldflags |
55 | SMALL = $small |
56 | LARGE = $large $split |
a1cc2bdc |
57 | mallocsrc = $mallocsrc |
58 | mallocobj = $mallocobj |
8d063cd8 |
59 | |
0d3e774c |
60 | libs = $libs -lm |
8d063cd8 |
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 | |
a1cc2bdc |
77 | c = hash.c $(mallocsrc) str.c util.c walk.c |
8d063cd8 |
78 | |
a1cc2bdc |
79 | obj = hash.o $(mallocobj) str.o util.o walk.o |
8d063cd8 |
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 |
a687059c |
95 | $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p |
8d063cd8 |
96 | |
97 | a2p.c: a2p.y |
a687059c |
98 | @ echo Expect 208 shift/reduce conflicts... |
d8f2e4cc |
99 | $(YACC) a2p.y |
8d063cd8 |
100 | mv y.tab.c a2p.c |
101 | |
378cc40b |
102 | a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h |
8d063cd8 |
103 | $(CC) -c $(CFLAGS) $(LARGE) a2p.c |
104 | |
8d063cd8 |
105 | install: a2p s2p |
106 | # won't work with csh |
107 | export PATH || exit 1 |
378cc40b |
108 | - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null |
a687059c |
109 | - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null |
8d063cd8 |
110 | - if test `pwd` != $(bin); then cp $(public) $(bin); fi |
111 | cd $(bin); \ |
112 | for pub in $(public); do \ |
378cc40b |
113 | chmod +x `basename $$pub`; \ |
8d063cd8 |
114 | done |
378cc40b |
115 | # chmod +x makedir |
116 | # - ./makedir `filexp $(lib)` |
8d063cd8 |
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 \ |
378cc40b |
123 | #chmod +x `basename $$priv`; \ |
8d063cd8 |
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 | |
03a14243 |
157 | config.sh: ../config.sh |
158 | rm -f config.sh |
159 | ln ../config.sh . |
160 | |
8d063cd8 |
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 |