xref: /original-bsd/local/toolchest/ksh/sh/makefile (revision b3d44d98)
1# @(#)makefile	1.1
2U370 =
3DATA=data
4FIXDATA=text
5TESTDIR = .
6INS = /etc/install
7INSDIR =
8CFLAGS = -O
9LFLAGS = -n
10ARK = lib.a
11SHLIB = ../shlib
12D=  -DKSHELL
13D4_2 =
14sh = ksh
15# The following line must be set to make either the emacs or vi version of ksh
16EDIT = edit.o
17# The following two lines are used for one line emacs editor
18EMACS = emacs.o
19DESH = -DESH
20# The following two lines are used for one line vi editor
21VI = vi.o
22DVSH = -DVSH
23# The following line is used for vi mode always raw (u370 requires this)
24# VIRAW = -DRAWONLY
25VIRAW =
26# The following two to four lines are used for BSD Unix
27# DBSD = -DBSD
28# LFLAGS = -z
29# D4_2 = -DBSD_4_2
30# ECHO_N = -DECHO_N
31# The following two (three for BSD) lines are used for Job Control
32DJOBS = -DJOBS
33JOBS = jobs.o
34JOBLIB = -ljobs
35# The following is used if the stdio routines are taken from stdio.c
36# MYIO=stdio.o
37# The following line is used for machines with 16 bit integers
38# INT16=-DINT16
39# The following line is used for machines which do not define _sobuf & _sibuf
40# NOBUF=-DNOBUF
41# The following line is used for machines which can't recover for SIGSEGV
42# NOSEGV=-DNOSEGV
43# The following line is used to enable execute only and suid/sgid shell scripts
44SUID_EXEC=-DSUID_EXEC
45C = $(CC) $D $(DVSH) $(DESH) $(DJOBS) $(DBSD) $(D4_2) $(VIRAW) $(NOBUF) $(INT16) $(VENIX)$(XENIX) $(ECHO_N) $(DVFORK) $(DEVFD) $(NOSEGV) $(SXT) $(MULTIBYTE) $(ACCT) $(SUID_EXEC)
46CC_CMD = $(C) $(CFLAGS) -c
47OFILES = builtin.o \
48args.o \
49blok.o \
50cmd.o \
51ctype.o \
52defs.o \
53echo.o \
54error.o \
55expand.o\
56fault.o \
57history.o\
58io.o \
59macro.o \
60main.o \
61msg.o \
62name.o \
63print.o \
64service.o \
65string.o \
66stak.o \
67test.o \
68xec.o \
69word.o \
70$(EDIT) \
71$(EMACS) \
72$(VI) \
73$(VFORK) \
74$(JOBS) \
75$(MYIO)
76
77
78all: $(sh)
79
80$(sh): $(OFILES) $(SHLIB)/$(ARK)
81	$(C) $(LFLAGS) -o $(TESTDIR)/$(sh) $(OFILES) $(SHLIB)/$(ARK) \
82		$(SHLIB)/$(ARK) $(JOBLIB)
83
84	file $(TESTDIR)/$(sh)
85	size $(TESTDIR)/$(sh)
86
87ctype.o:	ctype.c
88		-set -ex; if test  "$(FIXDATA)" != "" ;\
89		then \
90		$(C) -O -S -c ctype.c ;\
91		sed 's/^\([ 	]*\.*\)$(DATA)/\1$(FIXDATA)/g' ctype.s > temp.s ;\
92		$(AS) -o ctype.o temp.s ;\
93		rm ctype.s temp.s ;\
94		else \
95		$(CC_CMD) ctype.c ;\
96		fi
97
98msg.o:		msg.c
99		-set -ex; if test  "$(FIXDATA)" != "" ;\
100		then \
101		$(C) -O -S -c msg.c ;\
102		sed 's/^\([ 	]*\.*\)$(DATA)/\1$(FIXDATA)/g' msg.s > temp.s ;\
103		$(AS) -o msg.o temp.s ;\
104		rm msg.s temp.s ;\
105		else \
106		$(CC_CMD) msg.c ;\
107		fi
108
109emacs.o:	emacs.c
110	-set -ex; if test  "$(U370)" = "" ;\
111	then \
112	$(CC_CMD) emacs.c ;\
113	else \
114	$(CC_CMD)  -b2,0 emacs.c ;\
115	fi
116
117service.o:	service.c
118	-set -ex; if test  "X$(ACCT)" = "X" ;\
119	then \
120	$(CC_CMD) service.c ;\
121	else \
122	$(CC_CMD)  -I/usr/src/cmd/acct service.c ;\
123	fi
124
125builtin.o:		builtin.c
126	-set -ex; if test  "$(U370)" = "" ;\
127	then \
128	$(CC_CMD) builtin.c ;\
129	else \
130	$(CC_CMD) -b2,0 builtin.c ;\
131	fi
132
133xec.o:		xec.c
134	-set -ex; if test  "$(U370)" = "" ;\
135	then \
136	$(CC_CMD) xec.c ;\
137	else \
138	$(CC_CMD) -b1,0 xec.c ;\
139	fi
140
141suid_exec:	suid_exec.o
142	$(C) $(LFLAGS) -o $(TESTDIR)/suid_exec suid_exec.o
143	strip suid_exec
144	-ln suid_exec ..
145
146suid_exec.o:	suid_exec.c
147	$(CC_CMD) suid_exec.c
148
149install:  all
150	  $(INS) -o -f $(INSDIR) $(TESTDIR)/$(sh)
151	  -rm -f $(INSDIR)/r$(sh)
152	  -ln $(INSDIR)/$(sh) $(INSDIR)/r$(sh)
153
154clean:
155	  -rm -f *.o
156
157clobber:  clean
158	  -rm -f $(TESTDIR)/$(sh) option.init suid_exec
159
160########
161#
162#	All dependencies and rules not explicitly stated
163#	(including header and nested header dependencies)
164#
165########
166
167args.o:	args.c
168args.o:	brkincr.h
169args.o:	builtins.h
170args.o:	defs.h
171args.o:	flags.h
172args.o:	io.h
173args.o:	mode.h
174args.o:	sym.h
175	$(CC_CMD) args.c
176
177blok.o:	blok.c
178blok.o:	brkincr.h
179blok.o:	defs.h
180blok.o:	stak.h
181	$(CC_CMD) blok.c
182
183builtin.o:	brkincr.h
184builtin.o:	builtins.h
185builtin.o:	defs.h
186builtin.o:	flags.h
187builtin.o:	history.h
188builtin.o:	io.h
189builtin.o:	jobs.h
190builtin.o:	mode.h
191builtin.o:	name.h
192builtin.o:	shtype.h
193builtin.o:	stak.h
194builtin.o:	sym.h
195
196cmd.o:	brkincr.h
197cmd.o:	builtins.h
198cmd.o:	cmd.c
199cmd.o:	defs.h
200cmd.o:	flags.h
201cmd.o:	history.h
202cmd.o:	io.h
203cmd.o:	mode.h
204cmd.o:	name.h
205cmd.o:	shtype.h
206cmd.o:	stak.h
207cmd.o:	sym.h
208	$(CC_CMD) cmd.c
209
210ctype.o:	shtype.h
211
212defs.o:	brkincr.h
213defs.o:	defs.h
214defs.o:	defs.c
215defs.o:	edit.h
216defs.o:	flags.h
217defs.o:	history.h
218defs.o:	jobs.h
219defs.o:	io.h
220defs.o:	name.h
221defs.o:	sym.h
222defs.o:	timeout.h
223	$(CC_CMD) defs.c
224
225edit.o:	brkincr.h
226edit.o:	builtins.h
227edit.o:	defs.h
228edit.o:	edit.c
229edit.o:	edit.h
230edit.o:	flags.h
231edit.o:	history.h
232edit.o:	io.h
233edit.o:	mode.h
234edit.o:	name.h
235edit.o:	national.h
236edit.o:	shtype.h
237edit.o:	sym.h
238	$(CC_CMD) edit.c
239
240emacs.o:	defs.h
241emacs.o:	edit.h
242emacs.o:	history.h
243emacs.o:	io.h
244emacs.o:	shtype.h
245
246echo.o:		brkincr.h
247echo.o:		defs.h
248	$(CC_CMD) echo.c
249
250error.o:	brkincr.h
251error.o:	defs.h
252error.o:	error.c
253error.o:	flags.h
254error.o:	io.h
255error.o:	jobs.h
256error.o:	sym.h
257	$(CC_CMD) error.c
258
259expand.o:	brkincr.h
260expand.o:	defs.h
261expand.o:	expand.c
262expand.o:	shtype.h
263expand.o:	stak.h
264expand.o:	sym.h
265	$(CC_CMD) expand.c
266
267fault.o:	brkincr.h
268fault.o:	defs.h
269fault.o:	fault.c
270fault.o:	flags.h
271fault.o:	jobs.h
272fault.o:	stak.h
273fault.o:	sym.h
274fault.o:	timeout.h
275	$(CC_CMD) fault.c
276
277history.o:	brkincr.h
278history.o:	builtins.h
279history.o:	defs.h
280history.o:	flags.h
281history.o:	history.c
282history.o:	history.h
283history.o:	io.h
284history.o:	name.h
285history.o:	shtype.h
286history.o:	stak.h
287	$(CC_CMD) history.c
288
289io.o:	defs.h
290io.o:	flags.h
291io.o:	io.c
292io.o:	io.h
293io.o:	shtype.h
294	$(CC_CMD) io.c
295
296jobs.o:	brkincr.h
297jobs.o:	defs.h
298jobs.o:	flags.h
299jobs.o:	history.h
300jobs.o:	io.h
301jobs.o:	jobs.c
302jobs.o:	jobs.h
303jobs.o:	shtype.h
304	$(CC_CMD) jobs.c
305
306macro.o:	brkincr.h
307macro.o:	builtins.h
308macro.o:	defs.h
309macro.o:	flags.h
310macro.o:	io.h
311macro.o:	jobs.h
312macro.o:	macro.c
313macro.o:	mode.h
314macro.o:	name.h
315macro.o:	national.h
316macro.o:	shtype.h
317macro.o:	stak.h
318macro.o:	sym.h
319	$(CC_CMD) macro.c
320
321main.o:	brkincr.h
322main.o:	builtins.h
323main.o:	defs.h
324main.o:	flags.h
325main.o:	history.h
326main.o:	io.h
327main.o:	main.c
328main.o:	mode.h
329main.o:	name.h
330main.o:	stak.h
331main.o:	sym.h
332main.o:	timeout.h
333	$(CC_CMD) main.c
334
335msg.o:	brkincr.h
336msg.o:	builtins.h
337msg.o:	defs.h
338msg.o:	flags.h
339msg.o:	name.h
340msg.o:	national.h
341msg.o:	sym.h
342msg.o:	test.h
343msg.o:	timeout.h
344
345name.o:	brkincr.h
346name.o:	builtins.h
347name.o:	defs.h
348name.o:	flags.h
349name.o:	io.h
350name.o:	name.c
351name.o:	name.h
352name.o:	shtype.h
353name.o:	stak.h
354name.o:	sym.h
355name.o:	timeout.h
356	$(CC_CMD) name.c
357
358print.o:	builtins.h
359print.o:	defs.h
360print.o:	flags.h
361print.o:	io.h
362print.o:	print.c
363print.o:	shtype.h
364	$(CC_CMD) print.c
365
366service.o:	brkincr.h
367service.o:	builtins.h
368service.o:	defs.h
369service.o:	flags.h
370service.o:	io.h
371service.o:	jobs.h
372service.o:	mode.h
373service.o:	name.h
374service.o:	service.c
375service.o:	shtype.h
376service.o:	stak.h
377service.o:	sym.h
378
379string.o:	string.c
380	$(CC_CMD) string.c
381
382stak.o:	brkincr.h
383stak.o:	defs.h
384stak.o:	stak.c
385stak.o:	stak.h
386	$(CC_CMD) stak.c
387
388stdio.o:	stdio.c
389	$(CC_CMD) stdio.c
390
391test.o:	defs.h
392test.o:	shtype.h
393test.o:	sym.h
394test.o:	test.h
395test.o:	test.c
396	$(CC_CMD) test.c
397
398vfork.o:	brkincr.h
399vfork.o:	builtins.h
400vfork.o:	defs.h
401vfork.o:	flags.h
402vfork.o:	io.h
403vfork.o:	jobs.h
404vfork.o:	mode.h
405vfork.o:	name.h
406vfork.o:	stak.h
407vfork.o:	sym.h
408vfork.o:	vfork.c
409	$(CC_CMD) vfork.c
410
411vi.o:	defs.h
412vi.o:	edit.h
413vi.o:	flags.h
414vi.o:	io.h
415vi.o:	history.h
416vi.o:	shtype.h
417vi.o:	vi.c
418	$(CC_CMD) vi.c
419
420word.o:	brkincr.h
421word.o:	builtins.h
422word.o:	defs.h
423word.o:	flags.h
424word.o:	history.h
425word.o:	io.h
426word.o:	name.h
427word.o:	shtype.h
428word.o:	stak.h
429word.o:	sym.h
430word.o:	word.c
431	$(CC_CMD) word.c
432
433xec.o:	brkincr.h
434xec.o:	builtins.h
435xec.o:	defs.h
436xec.o:	flags.h
437xec.o:	io.h
438xec.o:	jobs.h
439xec.o:	mode.h
440xec.o:	name.h
441xec.o:	shtype.h
442xec.o:	stak.h
443xec.o:	sym.h
444