xref: /original-bsd/local/toolchest/ksh/ksh.mk (revision 951fd614)
1# make [ OPTIONS= ]
2CMD=/bin/make
3CC = cc
4DAYS=28
5ARK=lib.a
6TAR=tar
7CPIO=cpio
8TROFF=nroff
9LPR=lpr
10UTIME=$(SH).$(CPIO)
11SH=ksh
12JSH=jsh
13ELIB=libedit.a
14RJE= $(HOME)/rje
15INSDIR = /usr/lbin
16OPTIONS=
17# the following make options are automatically configured but can be explicitly set
18# options can be used to turn on (-)  or off (+) certain features
19# possible options and defaults are:
20#	a	shell accounting	off
21#	v	vi editmode		on
22#	e	emacs edit mode		on
23#	r	viraw mode		on
24#	j	monitor(job control)	on
25#	m	multibyte mode(on only)	automatically configured
26#	f	vfork mode		on for BSD, off for Sys V
27#	s	allow suid scripts	on and requires /etc/suid_exec
28#	4.2	BSD 4.2			on for BSD 4.2, off for Sys V
29
30LIBFILES = \
31shlib/adjust.c \
32shlib/arith.c \
33shlib/assign.c \
34shlib/assnum.c \
35shlib/builtins.h \
36shlib/cannon.c \
37shlib/chkid.c \
38shlib/convert.c \
39shlib/failed.c \
40shlib/findnod.c \
41shlib/flags.h \
42shlib/gettree.c \
43shlib/gmatch.c \
44shlib/growaray.c \
45shlib/gsort.c \
46shlib/linknod.c \
47shlib/makefile \
48shlib/name.h \
49shlib/national.h \
50shlib/namscan.c \
51shlib/rjust.c \
52shlib/shtype.h \
53shlib/tilde.c \
54shlib/unassign.c \
55shlib/utos.c \
56shlib/valup.c
57
58SHFILES= \
59sh/Makefile \
60sh/apollo.c \
61sh/args.c \
62sh/blok.c \
63sh/brkincr.h \
64sh/builtin.c \
65sh/builtins.h \
66sh/cmd.c \
67sh/ctype.c \
68sh/defs.h \
69sh/defs.c \
70sh/edit.c \
71sh/editlib.c \
72sh/edit.h \
73sh/emacs.c \
74sh/echo.c \
75sh/error.c \
76sh/expand.c \
77sh/fault.c \
78sh/flags.h \
79sh/history.c \
80sh/history.h \
81sh/io.c \
82sh/io.h \
83sh/jobs.c \
84sh/jobs.h \
85sh/macro.c \
86sh/main.c \
87sh/makefile \
88sh/makelib \
89sh/makesh \
90sh/mode.h \
91sh/msg.c \
92sh/name.c \
93sh/name.h \
94sh/national.h \
95sh/print.c \
96sh/service.c \
97sh/shtype.h \
98sh/string.c \
99sh/stdio.c \
100sh/stak.c \
101sh/stak.h \
102sh/suid_exec.c \
103sh/sym.h \
104sh/syscall.s \
105sh/test.c \
106sh/test.h \
107sh/timeout.h \
108sh/vfork.c \
109sh/vi.c \
110sh/word.c \
111sh/xec.c
112
113JSHFILES= \
114jsh/defs.h \
115jsh/defs.c \
116jsh/jsh.c \
117jsh/makefile \
118jsh/mpx.c
119
120DOCFILES=\
121getopts \
122substring \
123sh.memo \
124sh.1 \
125README \
126RELEASE \
127COMPATIBILITY \
128ksh.mk
129
130$(SH): shlib/$(ARK) sh/$(SH)
131	-rm -f $(SH)
132	ln sh/$(SH) $(SH)
133
134cpio: $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile
135	ls $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile \
136	| cpio -ocBv > $(RJE)/$(SH).$@
137
138ucpio: $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile
139	find $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile   \
140	-newer $(RJE)/$(UTIME)  -print | cpio -ocBv > $(RJE)/$(SH).$@
141
142tar: $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile
143	tar -cvpf $(RJE)/$(SH).$@ $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES)\
144		 makefile
145
146utar: $(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile
147	tar -cvfp $(RJE)/$(SH).$@ `find \
148	$(SHFILES) $(LIBFILES) $(JSHFILES) $(DOCFILES) makefile \
149	-newer $(RJE)/$(UTIME)  -print`
150
151shlib/$(ARK): $(LIBFILES)
152	-cd shlib; if test -f /vmunix  \
153		-o '(' -f /usr/include/sys/stream.h \
154			 -a -f /usr/include/sys/vmparam.h ')'\
155		-o -f /venix \
156		-o "$$SYSTYPE" = bsd4.1 \
157		-o "$$SYSTYPE" = bsd4.2 \
158		-o "$$SYSTYPE" = bsd4.3 ;then \
159			BSD="BSD=-DBSD ucb";else BSD=;fi  \
160	;if test -f /usr/lib/dic/euc.dic \
161		;then MULTIBYTE="MULTIBYTE=-DMULTIBYTE" \
162		;else	case $$OPTIONS in \
163			*-m*)	MULTIBYTE="MULTIBYTE=-DMULTIBYTE";; \
164			*)	MULTIBYTE= ;; \
165			esac \
166		;fi \
167	;$(CMD) CC=$(CC) ARK=$(ARK) $$BSD $$MULTIBYTE \
168	;touch $(ARK)
169
170sh/$(SH):	$(SHFILES) $(LIBFILES)
171	cd sh;CMD=$(CMD) ARK=$(ARK) CC=$(CC) ./makesh $(OPTIONS) $(SH); touch $(SH)
172
173jsh/$(JSH):	$(JSHFILES)
174	cd jsh; if test -d /dev/sxt;then $(CMD) CC=$(CC) ; fi
175
176sh/$(ELIB):
177	cd sh;CMD=$(CMD) CC=$(CC) ./makelib; touch $(ELIB)
178
179clean:
180	cd shlib; $(CMD) clean
181	cd sh; $(CMD) clean
182	cd jsh; $(CMD) clean
183
184clobber:
185	cd shlib; $(CMD) clobber
186	cd sh; $(CMD) clobber
187	cd jsh; $(CMD) clobber
188	rm -f $(SH) suid_exec
189
190install:
191	cd sh; $(CMD) install INSDIR=$(INSDIR)
192
193xcl: $(SHFILES) $(LIBFILES) $(JSHFILES) makefile
194	xcl $(SHFILES) $(LIBFILES) $(JSHFILES) makefile
195
196man:	sh.1
197	$(TROFF) -man sh.1 | $(LPR)
198