1# Don't edit Makefile! Use conf-* for configuration.
2
3SHELL=/bin/sh
4
5default: it
6
7alloc.o: \
8compile alloc.c alloc.h error.h
9	./compile alloc.c
10
11alloc_re.o: \
12compile alloc_re.c alloc.h byte.h
13	./compile alloc_re.c
14
15auto-str: \
16load auto-str.o unix.a byte.a
17	./load auto-str unix.a byte.a
18
19auto-str.o: \
20compile auto-str.c buffer.h readwrite.h exit.h
21	./compile auto-str.c
22
23auto_home.c: \
24auto-str conf-home
25	./auto-str auto_home `head -1 conf-home` > auto_home.c
26
27auto_home.o: \
28compile auto_home.c
29	./compile auto_home.c
30
31buffer.o: \
32compile buffer.c buffer.h
33	./compile buffer.c
34
35buffer_2.o: \
36compile buffer_2.c readwrite.h buffer.h
37	./compile buffer_2.c
38
39buffer_copy.o: \
40compile buffer_copy.c buffer.h
41	./compile buffer_copy.c
42
43buffer_get.o: \
44compile buffer_get.c buffer.h byte.h error.h
45	./compile buffer_get.c
46
47buffer_put.o: \
48compile buffer_put.c buffer.h str.h byte.h error.h
49	./compile buffer_put.c
50
51byte.a: \
52makelib byte_copy.o byte_cr.o byte_diff.o str_chr.o str_len.o \
53str_start.o
54	./makelib byte.a byte_copy.o byte_cr.o byte_diff.o \
55	str_chr.o str_len.o str_start.o
56
57byte_copy.o: \
58compile byte_copy.c byte.h
59	./compile byte_copy.c
60
61byte_cr.o: \
62compile byte_cr.c byte.h
63	./compile byte_cr.c
64
65byte_diff.o: \
66compile byte_diff.c byte.h
67	./compile byte_diff.c
68
69check: \
70it instcheck
71	./instcheck
72
73checkpassword: \
74load checkpassword.o prot.o unix.a byte.a shadow.lib crypt.lib s.lib
75	./load checkpassword prot.o unix.a byte.a  `cat \
76	shadow.lib` `cat crypt.lib` `cat s.lib`
77
78checkpassword.o: \
79compile checkpassword.c error.h pathexec.h prot.h hasspnam.h \
80hasuserpw.h
81	./compile checkpassword.c
82
83chkshsgr: \
84load chkshsgr.o
85	./load chkshsgr
86
87chkshsgr.o: \
88compile chkshsgr.c exit.h
89	./compile chkshsgr.c
90
91choose: \
92warn-auto.sh choose.sh conf-home
93	cat warn-auto.sh choose.sh \
94	| sed s}HOME}"`head -1 conf-home`"}g \
95	> choose
96	chmod 755 choose
97
98compile: \
99warn-auto.sh conf-cc systype print-cc.sh trycpp.c
100	sh print-cc.sh > compile
101	chmod 755 compile
102
103crypt.lib: \
104trycrypt.c compile load
105	( ( ./compile trycrypt.c && \
106	./load trycrypt -lcrypt ) >/dev/null 2>&1 \
107	&& echo -lcrypt || exit 0 ) > crypt.lib
108	rm -f trycrypt.o trycrypt
109
110env.o: \
111compile env.c str.h env.h
112	./compile env.c
113
114error.o: \
115compile error.c error.h
116	./compile error.c
117
118error_str.o: \
119compile error_str.c error.h
120	./compile error_str.c
121
122hasshsgr.h: \
123choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \
124warn-shsgr
125	./chkshsgr || ( cat warn-shsgr; exit 1 )
126	./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
127
128hasspnam.h: \
129tryspnam.c compile load
130	( ( ./compile tryspnam.c && ./load tryspnam ) >/dev/null \
131	2>&1 \
132	&& echo \#define HASGETSPNAM 1 || exit 0 ) > hasspnam.h
133	rm -f tryspnam.o tryspnam
134
135hasuserpw.h: \
136tryuserpw.c s.lib compile load
137	( ( ./compile tryuserpw.c \
138	  && ./load tryuserpw `cat s.lib` ) >/dev/null 2>&1 \
139	&& echo \#define HASGETUSERPW 1 || exit 0 ) > hasuserpw.h
140	rm -f tryuserpw.o tryuserpw
141
142hier.o: \
143compile hier.c auto_home.h
144	./compile hier.c
145
146install: \
147load install.o hier.o auto_home.o unix.a byte.a
148	./load install hier.o auto_home.o unix.a byte.a
149
150install.o: \
151compile install.c buffer.h strerr.h error.h open.h readwrite.h exit.h
152	./compile install.c
153
154instcheck: \
155load instcheck.o hier.o auto_home.o unix.a byte.a
156	./load instcheck hier.o auto_home.o unix.a byte.a
157
158instcheck.o: \
159compile instcheck.c strerr.h error.h readwrite.h exit.h
160	./compile instcheck.c
161
162it: \
163prog install instcheck
164
165load: \
166warn-auto.sh conf-ld
167	( cat warn-auto.sh; \
168	echo 'main="$$1"; shift'; \
169	echo exec "`head -1 conf-ld`" \
170	'-o "$$main" "$$main".o $${1+"$$@"}' \
171	) > load
172	chmod 755 load
173
174makelib: \
175warn-auto.sh systype
176	( cat warn-auto.sh; \
177	echo 'main="$$1"; shift'; \
178	echo 'rm -f "$$main"'; \
179	echo 'ar cr "$$main" $${1+"$$@"}'; \
180	case "`cat systype`" in \
181	sunos-5.*) ;; \
182	unix_sv*) ;; \
183	irix64-*) ;; \
184	irix-*) ;; \
185	dgux-*) ;; \
186	hp-ux-*) ;; \
187	sco*) ;; \
188	*) echo 'ranlib "$$main"' ;; \
189	esac \
190	) > makelib
191	chmod 755 makelib
192
193open_read.o: \
194compile open_read.c open.h
195	./compile open_read.c
196
197open_trunc.o: \
198compile open_trunc.c open.h
199	./compile open_trunc.c
200
201pathexec_env.o: \
202compile pathexec_env.c stralloc.h gen_alloc.h alloc.h str.h byte.h \
203env.h pathexec.h
204	./compile pathexec_env.c
205
206pathexec_run.o: \
207compile pathexec_run.c error.h stralloc.h gen_alloc.h str.h env.h \
208pathexec.h
209	./compile pathexec_run.c
210
211prog: \
212checkpassword
213
214prot.o: \
215compile prot.c hasshsgr.h prot.h
216	./compile prot.c
217
218s.lib: \
219tryslib.c compile load
220	( ( ./compile tryslib.c && \
221	./load tryslib -ls ) >/dev/null 2>&1 \
222	&& echo -ls || exit 0 ) > s.lib
223	rm -f tryslib.o tryslib
224
225setup: \
226it install
227	./install
228
229shadow.lib: \
230tryshadow.c compile load
231	( ( ./compile tryshadow.c && \
232	./load tryshadow -lshadow ) >/dev/null 2>&1 \
233	&& echo -lshadow || exit 0 ) > shadow.lib
234	rm -f tryshadow.o tryshadow
235
236str_chr.o: \
237compile str_chr.c str.h
238	./compile str_chr.c
239
240str_len.o: \
241compile str_len.c str.h
242	./compile str_len.c
243
244str_start.o: \
245compile str_start.c str.h
246	./compile str_start.c
247
248stralloc_cat.o: \
249compile stralloc_cat.c byte.h stralloc.h gen_alloc.h
250	./compile stralloc_cat.c
251
252stralloc_catb.o: \
253compile stralloc_catb.c stralloc.h gen_alloc.h byte.h
254	./compile stralloc_catb.c
255
256stralloc_cats.o: \
257compile stralloc_cats.c byte.h str.h stralloc.h gen_alloc.h
258	./compile stralloc_cats.c
259
260stralloc_eady.o: \
261compile stralloc_eady.c alloc.h stralloc.h gen_alloc.h \
262gen_allocdefs.h
263	./compile stralloc_eady.c
264
265stralloc_opyb.o: \
266compile stralloc_opyb.c stralloc.h gen_alloc.h byte.h
267	./compile stralloc_opyb.c
268
269stralloc_opys.o: \
270compile stralloc_opys.c byte.h str.h stralloc.h gen_alloc.h
271	./compile stralloc_opys.c
272
273stralloc_pend.o: \
274compile stralloc_pend.c alloc.h stralloc.h gen_alloc.h \
275gen_allocdefs.h
276	./compile stralloc_pend.c
277
278strerr_die.o: \
279compile strerr_die.c buffer.h exit.h strerr.h
280	./compile strerr_die.c
281
282strerr_sys.o: \
283compile strerr_sys.c error.h strerr.h
284	./compile strerr_sys.c
285
286systype: \
287find-systype.sh trycpp.c x86cpuid.c
288	sh find-systype.sh > systype
289
290unix.a: \
291makelib alloc.o alloc_re.o buffer.o buffer_2.o buffer_copy.o \
292buffer_get.o buffer_put.o env.o error.o error_str.o open_read.o \
293open_trunc.o pathexec_env.o pathexec_run.o prot.o stralloc_cat.o \
294stralloc_catb.o stralloc_cats.o stralloc_eady.o stralloc_opyb.o \
295stralloc_opys.o stralloc_pend.o strerr_die.o strerr_sys.o
296	./makelib unix.a alloc.o alloc_re.o buffer.o buffer_2.o \
297	buffer_copy.o buffer_get.o buffer_put.o env.o error.o \
298	error_str.o open_read.o open_trunc.o pathexec_env.o \
299	pathexec_run.o prot.o stralloc_cat.o stralloc_catb.o \
300	stralloc_cats.o stralloc_eady.o stralloc_opyb.o \
301	stralloc_opys.o stralloc_pend.o strerr_die.o strerr_sys.o
302