1# Don't edit Makefile! Use conf-* for configuration.
2
3SHELL=/bin/sh
4
5default: it
6
7install:
8
9alloc.a: \
10makelib alloc.o
11	./makelib alloc.a alloc.o
12
13alloc.o: \
14compile alloc.c alloc.h error.h
15	./compile alloc.c
16
17auto-str: \
18load auto-str.o buffer.a unix.a byte.a
19	./load auto-str buffer.a unix.a byte.a
20
21auto-str.o: \
22compile auto-str.c buffer.h readwrite.h exit.h
23	./compile auto-str.c
24
25auto_home.c: \
26auto-str conf-home
27	./auto-str auto_home `head -1 conf-home` > auto_home.c
28
29auto_home.o: \
30compile auto_home.c
31	./compile auto_home.c
32
33buffer.a: \
34makelib strerr_sys.o buffer.o buffer_put.o buffer_2.o strerr_die.o \
35buffer_get.o buffer_copy.o buffer_1.o buffer_0.o buffer_1s.o
36	./makelib buffer.a strerr_sys.o buffer.o buffer_put.o \
37	buffer_2.o strerr_die.o buffer_get.o buffer_copy.o \
38	buffer_1.o buffer_0.o buffer_1s.o
39
40buffer.o: \
41compile buffer.c buffer.h
42	./compile buffer.c
43
44buffer_0.o: \
45compile buffer_0.c readwrite.h buffer.h
46	./compile buffer_0.c
47
48buffer_1.o: \
49compile buffer_1.c readwrite.h buffer.h
50	./compile buffer_1.c
51
52buffer_1s.o: \
53compile buffer_1s.c readwrite.h buffer.h
54	./compile buffer_1s.c
55
56buffer_2.o: \
57compile buffer_2.c readwrite.h buffer.h
58	./compile buffer_2.c
59
60buffer_copy.o: \
61compile buffer_copy.c buffer.h
62	./compile buffer_copy.c
63
64buffer_get.o: \
65compile buffer_get.c buffer.h byte.h error.h
66	./compile buffer_get.c
67
68buffer_put.o: \
69compile buffer_put.c buffer.h str.h byte.h error.h
70	./compile buffer_put.c
71
72byte.a: \
73makelib byte_copy.o byte_cr.o str_len.o fmt_ulong.o uint32_unpack.o \
74byte_diff.o uint32_pack.o scan_ulong.o
75	./makelib byte.a byte_copy.o byte_cr.o str_len.o \
76	fmt_ulong.o uint32_unpack.o byte_diff.o uint32_pack.o \
77	scan_ulong.o
78
79byte_copy.o: \
80compile byte_copy.c byte.h
81	./compile byte_copy.c
82
83byte_cr.o: \
84compile byte_cr.c byte.h
85	./compile byte_cr.c
86
87byte_diff.o: \
88compile byte_diff.c byte.h
89	./compile byte_diff.c
90
91cdb.a: \
92makelib cdb.o cdb_hash.o cdb_make.o cdb_unpack.o cdb_seek.o
93	./makelib cdb.a cdb.o cdb_hash.o cdb_make.o cdb_unpack.o cdb_seek.o
94
95cdb_unpack.o: \
96compile cdb_unpack.c cdb.h uint32.h
97	./compile cdb_unpack.c
98
99cdb_seek.o: \
100compile cdb_seek.c cdb.h uint32.h
101	./compile cdb_seek.c
102
103cdb.o: \
104compile cdb.c readwrite.h error.h seek.h byte.h cdb.h uint32.h
105	./compile cdb.c
106
107cdb_hash.o: \
108compile cdb_hash.c cdb.h uint32.h
109	./compile cdb_hash.c
110
111cdb_make.o: \
112compile cdb_make.c readwrite.h seek.h error.h alloc.h cdb.h uint32.h \
113cdb_make.h buffer.h uint32.h
114	./compile cdb_make.c
115
116cdbdump: \
117load cdbdump.o buffer.a unix.a byte.a
118	./load cdbdump buffer.a unix.a byte.a
119
120cdbdump.o: \
121compile cdbdump.c uint32.h fmt.h buffer.h strerr.h
122	./compile cdbdump.c
123
124cdbget: \
125load cdbget.o cdb.a buffer.a unix.a byte.a
126	./load cdbget cdb.a buffer.a unix.a byte.a
127
128cdbget.o: \
129compile cdbget.c exit.h scan.h str.h buffer.h strerr.h cdb.h uint32.h
130	./compile cdbget.c
131
132cdbmake: \
133load cdbmake.o cdb.a alloc.a buffer.a unix.a byte.a
134	./load cdbmake cdb.a alloc.a buffer.a unix.a byte.a
135
136cdbmake-12: \
137warn-auto.sh cdbmake-12.sh conf-home
138	cat warn-auto.sh cdbmake-12.sh \
139	| sed s}HOME}"`head -1 conf-home`"}g \
140	> cdbmake-12
141	chmod 755 cdbmake-12
142
143cdbmake-sv: \
144warn-auto.sh cdbmake-sv.sh conf-home
145	cat warn-auto.sh cdbmake-sv.sh \
146	| sed s}HOME}"`head -1 conf-home`"}g \
147	> cdbmake-sv
148	chmod 755 cdbmake-sv
149
150cdbmake.o: \
151compile cdbmake.c error.h open.h strerr.h cdb_make.h buffer.h \
152uint32.h cdb.h uint32.h
153	./compile cdbmake.c
154
155cdbstats: \
156load cdbstats.o cdb.a buffer.a unix.a byte.a
157	./load cdbstats cdb.a buffer.a unix.a byte.a
158
159cdbstats.o: \
160compile cdbstats.c uint32.h fmt.h buffer.h strerr.h seek.h cdb.h \
161uint32.h
162	./compile cdbstats.c
163
164cdbtest: \
165load cdbtest.o cdb.a buffer.a unix.a byte.a
166	./load cdbtest cdb.a buffer.a unix.a byte.a
167
168cdbtest.o: \
169compile cdbtest.c uint32.h fmt.h buffer.h strerr.h seek.h cdb.h \
170uint32.h
171	./compile cdbtest.c
172
173check: \
174it instcheck
175	./instcheck
176
177compile: \
178warn-auto.sh conf-cc
179	( cat warn-auto.sh; \
180	echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
181	) > compile
182	chmod 755 compile
183
184error.o: \
185compile error.c error.h
186	./compile error.c
187
188error_str.o: \
189compile error_str.c error.h
190	./compile error_str.c
191
192fmt_ulong.o: \
193compile fmt_ulong.c fmt.h
194	./compile fmt_ulong.c
195
196hier.o: \
197compile hier.c auto_home.h
198	./compile hier.c
199
200instcheck: \
201load instcheck.o hier.o auto_home.o buffer.a unix.a byte.a
202	./load instcheck hier.o auto_home.o buffer.a unix.a byte.a
203
204instcheck.o: \
205compile instcheck.c strerr.h error.h readwrite.h exit.h
206	./compile instcheck.c
207
208it: \
209prog instcheck
210
211distclean: clean
212
213clean:
214	rm -rf *.o *.a uint32.h systype auto-str cdbdump cdbget cdbmake \
215cdbmake-12 cdbmake-sv cdbstats cdbtest compile instcheck load makelib \
216rts testzero
217
218all: \
219cdb.a buffer.a unix.a byte.a alloc.a
220
221
222load: \
223warn-auto.sh conf-ld
224	( cat warn-auto.sh; \
225	echo 'main="$$1"; shift'; \
226	echo exec "`head -1 conf-ld`" \
227	'-o "$$main" "$$main".o $${1+"$$@"}' \
228	) > load
229	chmod 755 load
230
231makelib: \
232warn-auto.sh systype
233	( cat warn-auto.sh; \
234	echo 'main="$$1"; shift'; \
235	echo 'rm -f "$$main"'; \
236	echo 'ar cr "$$main" $${1+"$$@"}'; \
237	case "`cat systype`" in \
238	sunos-5.*) ;; \
239	unix_sv*) ;; \
240	irix64-*) ;; \
241	irix-*) ;; \
242	dgux-*) ;; \
243	hp-ux-*) ;; \
244	sco*) ;; \
245	*) echo 'ranlib "$$main"' ;; \
246	esac \
247	) > makelib
248	chmod 755 makelib
249
250open_read.o: \
251compile open_read.c open.h
252	./compile open_read.c
253
254open_trunc.o: \
255compile open_trunc.c open.h
256	./compile open_trunc.c
257
258prog: \
259cdbget cdbmake cdbdump cdbstats cdbtest cdbmake-12 cdbmake-sv rts \
260testzero
261
262rts: \
263warn-auto.sh rts.sh conf-home
264	cat warn-auto.sh rts.sh \
265	| sed s}HOME}"`head -1 conf-home`"}g \
266	> rts
267	chmod 755 rts
268
269scan_ulong.o: \
270compile scan_ulong.c scan.h
271	./compile scan_ulong.c
272
273seek_cur.o: \
274compile seek_cur.c seek.h
275	./compile seek_cur.c
276
277seek_set.o: \
278compile seek_set.c seek.h
279	./compile seek_set.c
280
281str_len.o: \
282compile str_len.c str.h
283	./compile str_len.c
284
285strerr_die.o: \
286compile strerr_die.c buffer.h exit.h strerr.h
287	./compile strerr_die.c
288
289strerr_sys.o: \
290compile strerr_sys.c error.h strerr.h
291	./compile strerr_sys.c
292
293systype: \
294find-systype.sh conf-cc conf-ld trycpp.c x86cpuid.c
295	( cat warn-auto.sh; \
296	echo CC=\'`head -1 conf-cc`\'; \
297	echo LD=\'`head -1 conf-ld`\'; \
298	cat find-systype.sh; \
299	) | sh > systype
300
301testzero: \
302load testzero.o cdb.a alloc.a buffer.a unix.a byte.a
303	./load testzero cdb.a alloc.a buffer.a unix.a byte.a
304
305testzero.o: \
306compile testzero.c uint32.h scan.h strerr.h cdb_make.h buffer.h \
307uint32.h
308	./compile testzero.c
309
310uint32.h: \
311tryulong32.c compile load uint32.h1 uint32.h2
312	( ( ./compile tryulong32.c && ./load tryulong32 && \
313	./tryulong32 ) >/dev/null 2>&1 \
314	&& cat uint32.h2 || cat uint32.h1 ) > uint32.h
315	rm -f tryulong32.o tryulong32
316
317uint32_pack.o: \
318compile uint32_pack.c uint32.h
319	./compile uint32_pack.c
320
321uint32_unpack.o: \
322compile uint32_unpack.c uint32.h
323	./compile uint32_unpack.c
324
325unix.a: \
326makelib error.o open_read.o open_trunc.o error_str.o seek_set.o \
327seek_cur.o
328	./makelib unix.a error.o open_read.o open_trunc.o \
329	error_str.o seek_set.o seek_cur.o
330