Commit | Line | Data |
---|---|---|
9f2804c5 MT |
1 | |
2 | # | |
3 | # Copyright (c) 1984, 1985, 1986 AT&T | |
4 | # All Rights Reserved | |
5 | # | |
6 | # THIS IS UNPUBLISHED PROPRIETARY SOURCE | |
7 | # CODE OF AT&T. | |
8 | # The copyright notice above does not | |
9 | # evidence any actual or intended | |
10 | # publication of such source code. | |
11 | # | |
12 | /* | |
13 | * Fourth Generation make, makefile | |
14 | */ | |
15 | ||
16 | .OPTIONS: -m -u | |
17 | ||
18 | .SOURCE: sh shlib jsh | |
19 | ||
20 | /* These are files that contain documentation */ | |
21 | ||
22 | DOCFILES= shlib/makefile jsh/makefile sh/makefile sh/makelib sh/makesh \ | |
23 | sh/Makefile sh.memo sh.1 ksh.mk makefile getopts substring \ | |
24 | README RELEASE COMPATIBILITY | |
25 | ||
26 | KSHELL = 1 | |
27 | MULTIBYTE = /* set to 1 for multi-byte character sets */ | |
28 | BSD = /* set to 1 for BSD Unix */ | |
29 | BSD_4_2 = /* set to 1 for BSD 4.2 */ | |
30 | BSD_4_1c = /* set to 1 for BSD 4.1c */ | |
31 | ARK = lib.a /* name for library for common shell procedures */ | |
32 | EDITLIB = libedit.a /* name for editing library */ | |
33 | SH = ksh /* name of the shell program */ | |
34 | JSH = jsh /* name of jobs control shell for shell layers */ | |
35 | ESH = 1 /* set for emacs/gmacs edit mode */ | |
36 | VSH = 1 /* set for vi edit mode */ | |
37 | JOBS = 1 /* needed if jobs monitor option is selected */ | |
38 | VFORK = /* needed if vfork option is selected */ | |
39 | JOBLIB = /* set to name of library needed for job control */ | |
40 | LDFLAGS = -n /* default loader option */ | |
41 | NOBUF = /* set if _sibuf and _sobuf not in stdio library */ | |
42 | RAWONLY = /* set to 1 if tty does not have alternate eof char */ | |
43 | INT16 = /* set to -DINT16 for sixteen bit machines */ | |
44 | MYIO = /* set to stdio.c if you don't want to use native stdio */ | |
45 | ACCT = /* set to 1 for shell accounting (Sys V only ) */ | |
46 | APOLLO = /* set to apollo.c for DOMAIN/IX */ | |
47 | SYSCALL= /* set to syscall.s for 3b20's */ | |
48 | EMACS = emacs.c /* name of the file needed for ESH */ | |
49 | VI = vi.c /* name of the file needed for VSH */ | |
50 | EDIT = edit.c /* name of file needed if ESH|VSH selected */ | |
51 | JOBFILE = jobs.c /* name of file needed if jobs option is selected */ | |
52 | VFORKFILE = /* name of file needed for VFORK option */ | |
53 | SUID_EXEC = suid_exec /* set to null to disallow suid/sgid shell scripts */ | |
54 | ||
55 | #if release(bsd) || release(research) | |
56 | BSD = 1 | |
57 | ECHO_N = 1 | |
58 | LDFLAGS = -z | |
59 | # if version(4.2) || version(4.3) | |
60 | BSD_4_2 = 1 | |
61 | # else | |
62 | JOBLIB = -ljobs | |
63 | # endif | |
64 | # if machine(sun) | |
65 | NOBUF = 1 | |
66 | # endif | |
67 | #endif | |
68 | ||
69 | #undef apollo | |
70 | #if machine(apollo) | |
71 | VFORK = 1 | |
72 | VFORKFILE = vfork.c /* name of file needed for VFORK option */ | |
73 | RAWONLY = 1 | |
74 | NOBUF = 1 | |
75 | APOLLO=apollo.c | |
76 | #endif | |
77 | ||
78 | #ifdef future | |
79 | #if exists("/dev/sxt/.") | |
80 | SXT = 1 /* set to 1 if there is an SXT driver */ | |
81 | #endif | |
82 | #endif future | |
83 | ||
84 | #if exists("/dev/fd/.") | |
85 | DEVFD = 1 /* set to 1 if there is a /dev/fd directory */ | |
86 | #endif | |
87 | ||
88 | #if architecture(ibm) || release(uts) | |
89 | DRAWONLY = 1 | |
90 | U370 = U370 /* for ibms and amdahls */ | |
91 | NOBUF = 1 | |
92 | #endif | |
93 | ||
94 | #if architecture(pdp11) || architecture(i8086) | |
95 | INT16 = 1 | |
96 | LDFLAGS = -i | |
97 | #endif | |
98 | ||
99 | .ALL: $(SH) $(SUID_EXEC:T=V) | |
100 | ||
101 | $(SH):: (KSHELL) (BSD) (BSD_4_2) (BSD_4_1c) (INT16) (SXT) \ | |
102 | shlib/$(ARK) shlib/$(ARK) $(JOBLIB) \ | |
103 | $(APOLLO) args.c blok.c brkincr.h builtin.c sh/builtins.h cmd.c \ | |
104 | ctype.c defs.h sh/defs.c $(EDIT) edit.h $(EMACS) echo.c \ | |
105 | error.c expand.c fault.c sh/flags.h history.c history.h \ | |
106 | io.c io.h $(JOBFILE) jobs.h macro.c main.c mode.h msg.c name.c \ | |
107 | sh/name.h sh/national.h print.c service.c string.c $(MYIO) \ | |
108 | sh/shtype.h stak.c stak.h sym.h test.c test.h timeout.h \ | |
109 | $(VFORKFILE) $(VI) word.c xec.c | |
110 | ||
111 | args.o defs.o error.o history.o io.o $(JOBFILE:BS=.o) main.o msg.o \ | |
112 | print.o xec.o: (ESH) (VSH) | |
113 | ||
114 | args.o edit.o vi.o: (RAWONLY) | |
115 | ||
116 | builtin.o args.o defs.o error.o fault.o $(JOBFILE:BS=.o) macro.o main.o msg.o \ | |
117 | print.o service.o word.o $(VFORKFILE:BS=.o) xec.o: (JOBS) | |
118 | ||
119 | args.o cmd.o msg.o word.o xec.o: (DEVFD) | |
120 | ||
121 | builtin.o msg.o name.o: (ECHO_N) | |
122 | ||
123 | error.o fault.o main.o service.o xec.o: (VFORK) | |
124 | ||
125 | emacs.o edit.o history.o macro.o msg.o string.o vi.o assign.o gmatch.o: (MULTIBYTE) | |
126 | ||
127 | error.o main.o msg.o service.o xec.o: (ACCT) | |
128 | ||
129 | main.o msg.o service.o: (SUID_EXEC) | |
130 | ||
131 | defs.o: (NOBUF) | |
132 | ||
133 | (ECHO_N): | |
134 | if test -f /bin/echo -a X"`/bin/echo -n`" = X | |
135 | then @ ECHO_N=1 | |
136 | fi | |
137 | ||
138 | jsh/$(JSH):: (BSD) jsh/defs.h jsh/defs.c jsh.c mpx.c | |
139 | ||
140 | ||
141 | shlib/$(ARK):: (BSD) (KSHELL) adjust.c arith.c assign.c \ | |
142 | assnum.c shlib/builtins.h cannon.c chkid.c convert.c failed.c \ | |
143 | findnod.c shlib/flags.h gettree.c gmatch.c growaray.c gsort.c \ | |
144 | linknod.c shlib/name.h shlib/national.h namscan.c rjust.c \ | |
145 | shlib/shtype.h tilde.c unassign.c utos.c valup.c | |
146 | ||
147 | suid_exec:: suid_exec.c (BSD) (BSD_4_2) | |
148 | ||
149 | editlib: nokshell sh/$(EDITLIB) | |
150 | ||
151 | nokshell: .MAKE | |
152 | KSHELL= | |
153 | ||
154 | sh/$(EDITLIB):: nokshell (BSD) edit.c edit.h editlib.c $(EMACS) \ | |
155 | history.c history.h $(VI) $(SYSCALL) | |
156 | ||
157 | msg.o ctype.o: .READONLY | |
158 | ||
159 | /* The following rule is only for the benefit of cpio, tar and print */ | |
160 | ConditionalFiles:: syscall.s apollo.c edit.c jobs.c vi.c emacs.c \ | |
161 | stdio.c vfork.c $(DOCFILES) | |
162 |