Commit | Line | Data |
---|---|---|
f6e43951 KB |
1 | # |
2 | # Copyright (c) 1988 Regents of the University of California. | |
3 | # All rights reserved. | |
4 | # | |
5 | # Redistribution and use in source and binary forms are permitted | |
ca67e7b4 C |
6 | # provided that this notice is preserved and that due credit is given |
7 | # to the University of California at Berkeley. The name of the University | |
8 | # may not be used to endorse or promote products derived from this | |
9 | # software without specific prior written permission. This software | |
10 | # is provided ``as is'' without express or implied warranty. | |
f6e43951 | 11 | # |
ca67e7b4 | 12 | # @(#)makefile 3.3 (Berkeley) 3/28/88 |
f6e43951 | 13 | # |
7ffa2088 | 14 | # Makefile for tn3270 and friends... |
7ffa2088 | 15 | # |
ca67e7b4 | 16 | # This is the makefile for tn3270. Note that we use ../telnet.c |
7ffa2088 GM |
17 | # (compiled with special options; see below) to provide the telnet |
18 | # support we need. | |
19 | # | |
20 | # The following are the defines that may be passed (via the cc | |
21 | # -D option) to the compiler. | |
22 | # | |
ca67e7b4 C |
23 | # The first group relate only to ../telnet.c: |
24 | # | |
7ffa2088 | 25 | # TN3270 - This is to be linked with tn3270. Necessary |
ca67e7b4 | 26 | # for creating tn3270. |
7ffa2088 | 27 | # |
7ffa2088 GM |
28 | # NOT43 - Allows the program to compile and run on |
29 | # a 4.2BSD system. | |
30 | # | |
31 | # PUTCHAR - Within tn3270, on a NOT43 system, | |
32 | # allows the use of the 4.3 curses | |
33 | # (greater speed updating the screen). | |
34 | # You need the 4.3 curses for this to work. | |
35 | # | |
36 | # FD_SETSIZE - On whichever system, if this isn't defined, | |
37 | # we patch over the FD_SET, etc., macros with | |
38 | # some homebrewed ones. | |
39 | # | |
40 | # SO_OOBINLINE - This is a socket option which we would like | |
41 | # to set to allow TCP urgent data to come | |
42 | # to us "inline". This is NECESSARY for | |
43 | # CORRECT operation, and desireable for | |
44 | # simpler operation. | |
45 | # | |
46 | # LNOFLSH - Detects the presence of the LNOFLSH bit | |
47 | # in the tty structure. | |
48 | # | |
49 | # | |
50 | # Here are some which are used throughout the system: | |
51 | # | |
7ffa2088 GM |
52 | # unix - Compiles in unix specific stuff. |
53 | # | |
54 | # msdos - Compiles in msdos specific stuff. | |
55 | # | |
56 | ||
fc70b5f7 GM |
57 | # msdos versus unix defines |
58 | O = .o | |
df7a539a | 59 | #PC_O = .obj |
fc70b5f7 GM |
60 | |
61 | X = | |
df7a539a GM |
62 | #PC_X = .exe |
63 | ||
64 | L = | |
65 | #PC_L = -link | |
fc70b5f7 | 66 | |
7ffa2088 | 67 | CC = cc |
df7a539a | 68 | #PC_CC = cl |
dd6c8c3e GM |
69 | |
70 | MV = mv | |
df7a539a | 71 | #PC_MV = rename |
dd6c8c3e GM |
72 | |
73 | RM = rm -f | |
df7a539a | 74 | #PC_RM= erase |
dd6c8c3e GM |
75 | |
76 | LINT_ARGS = | |
df7a539a | 77 | #PC_LINT_ARGS = -DLINT_ARGS |
dd6c8c3e GM |
78 | |
79 | DEBUG_FLAGS = -g | |
df7a539a | 80 | #PC_DEBUG_FLAGS = -Zi -Od |
dd6c8c3e GM |
81 | |
82 | AR = ar | |
df7a539a GM |
83 | AR1 = cr |
84 | AR2 = | |
85 | AR3 = | |
86 | #PC_AR = lib | |
87 | #PC_AR1 = | |
88 | #PC_AR2 = + | |
89 | #PC_AR3 = ";" | |
dd6c8c3e GM |
90 | |
91 | RANLIB = ranlib | |
df7a539a | 92 | #PC_RANLIB = echo "Done with " |
dd6c8c3e GM |
93 | |
94 | ||
7ffa2088 | 95 | PRINT = print |
ca67e7b4 | 96 | ACTION = sccs tell |
7ffa2088 | 97 | |
dd6c8c3e | 98 | DEFINES = ${LINT_ARGS} |
7ffa2088 | 99 | |
04b5f59e | 100 | INCLUDES = -I. -I.. |
7ffa2088 GM |
101 | |
102 | OPTIMIZE = -O | |
dd6c8c3e | 103 | OPTIMIZE = ${DEBUG_FLAGS} |
7ffa2088 GM |
104 | |
105 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) | |
106 | ||
107 | # Lint flags | |
108 | LINTFLAGS = -hbxaz | |
109 | # How to install the bloody thing... | |
110 | ||
111 | DESTDIR= | |
112 | ||
113 | BINDIR = $(DESTDIR)/usr/ucb | |
7ffa2088 GM |
114 | |
115 | # Names for the terminal libraries... | |
116 | LIBCURSES = -lcurses | |
117 | LIBTERM = -ltermlib | |
118 | ||
df7a539a GM |
119 | #PC_LIBCURSES = |
120 | #PC_LIBTERM = | |
121 | ||
7ffa2088 | 122 | # The source files... |
ca67e7b4 | 123 | ALLH = telnet.ext |
7ffa2088 | 124 | |
ca67e7b4 C |
125 | TNMAIN = ../telnet.c |
126 | TNMAIN = telnet.c | |
3d05654e | 127 | MSMAIN = ascii/mset.c |
7ffa2088 | 128 | |
ca67e7b4 | 129 | ALLC = ${TNMAIN} |
eb82b98e | 130 | |
ca67e7b4 | 131 | ALLO = telnet$O mset$O |
eb82b98e | 132 | |
ca67e7b4 | 133 | ALLPRINT = ${ALLH} ${ALLC} |
eb82b98e | 134 | |
ca67e7b4 | 135 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README |
eb82b98e | 136 | |
df7a539a GM |
137 | SYS = sys_curses |
138 | #PC_SYS = sys_dos | |
dd6c8c3e | 139 | |
7ffa2088 | 140 | # The places where the various components live... |
a63f9327 | 141 | |
ca67e7b4 | 142 | SUBDIR = api ascii ctlr general ${SYS} |
d86829c0 | 143 | |
eb82b98e GM |
144 | # The following are directories we don't do regular make's in, but |
145 | # we do make everywhere, print, and sourcelist in. | |
a63f9327 | 146 | |
78f0cc47 | 147 | EXTRADIR = arpa sys_dos tools utilities |
eb82b98e | 148 | |
d86829c0 | 149 | # The libraries we use. The order here is important. |
c0c987e5 GM |
150 | # syslib.a and ctlrlib.a should come first, then the rest. |
151 | SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \ | |
78f0cc47 | 152 | ascii/asciilib.a general/generallib.a |
7ffa2088 | 153 | |
7ffa2088 GM |
154 | .s.o: |
155 | /lib/cpp -E $< | as -o $@ | |
156 | ||
dd6c8c3e GM |
157 | .c.obj: |
158 | ${CC} ${CFLAGS} -c $< | |
159 | ||
fc70b5f7 | 160 | all: FRC tn3270$X mset$X |
7ffa2088 GM |
161 | |
162 | FRC: | |
755c4d48 GM |
163 | for i in ${SUBDIR}; \ |
164 | do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done | |
7ffa2088 | 165 | |
ca67e7b4 C |
166 | tn3270$X: telnet$O ${SUBLIB} api/apilib.a |
167 | ${CC} ${CFLAGS} -o tn3270 telnet$O \ | |
c0c987e5 | 168 | $L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM) |
df7a539a GM |
169 | |
170 | #PC_tn3270$X: | |
1eec4ac7 GM |
171 | #PC_ link <@< |
172 | #PC_ telnet | |
b0ef3ef0 | 173 | #PC_ tn3270 |
1eec4ac7 | 174 | #PC_ nul |
c0c987e5 | 175 | #PC_ ${SUBLIB} api/apilib.a+ |
1eec4ac7 GM |
176 | #PC_ \lib\ublib\ubtcp |
177 | #PC_ _PC_< | |
7ffa2088 | 178 | |
fc70b5f7 | 179 | mset$X: mset$O ascii/map3270$O |
c0c987e5 | 180 | ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a |
7ffa2088 | 181 | |
ca67e7b4 C |
182 | telnet$O: $(TNMAIN) |
183 | $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN) | |
184 | ||
fc70b5f7 | 185 | mset$O: $(MSMAIN) |
7ffa2088 GM |
186 | $(CC) $(CFLAGS) -c $(MSMAIN) |
187 | ||
ca67e7b4 | 188 | install: tn3270$X mset$X |
a9bda23c GM |
189 | install -m 755 -o bin -g bin -s tn3270 $(BINDIR) |
190 | install -m 755 -o bin -g bin -s mset $(BINDIR) | |
7ffa2088 | 191 | |
a233c85a GM |
192 | action: |
193 | ${ACTION} | |
194 | ||
eb82b98e GM |
195 | everywhere: action |
196 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
197 | do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \ | |
198 | "ACTION=${ACTION}"); done | |
a233c85a | 199 | |
ca67e7b4 | 200 | clean: |
dd6c8c3e GM |
201 | for i in $(ALLO) mset tn3270 errs makefile.bak; \ |
202 | do (${RM} $$i); done | |
203 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
204 | do (cd $$i; make ${MFLAGS} clean); done | |
205 | ||
206 | sccsclean: | |
78f0cc47 GM |
207 | -sccs clean |
208 | -sccs get makefile | |
dd6c8c3e GM |
209 | for i in ${SUBDIR} ${EXTRADIR}; \ |
210 | do (cd $$i; make ${MFLAGS} sccsclean); done | |
7ffa2088 GM |
211 | |
212 | print: | |
eb82b98e GM |
213 | ${PRINT} ${ALLPRINT} |
214 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
7ffa2088 | 215 | do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done |
7ffa2088 GM |
216 | |
217 | tags: ${ALLC} ${ALLH} | |
ca67e7b4 | 218 | ctags -t ${ALLC} ${ALLH} |
7ffa2088 | 219 | |
be140351 GM |
220 | sourcelist: ${ALLSOURCE} |
221 | @for i in ${ALLSOURCE}; \ | |
78f0cc47 | 222 | do (echo ${DIRPATH}$$i); done |
be140351 | 223 | @for i in ${SUBDIR} ${EXTRADIR}; \ |
78f0cc47 | 224 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ |
eb82b98e GM |
225 | sourcelist); done |
226 | ||
7ffa2088 | 227 | lint: |
ca67e7b4 C |
228 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \ |
229 | ${TNMAIN} -lcurses | |
230 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses | |
7ffa2088 | 231 | |
1eec4ac7 | 232 | makefiles.pc: tools/mkmake |
fc70b5f7 | 233 | for i in . ${SUBDIR} ${EXTRADIR}; \ |
df7a539a | 234 | do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \ |
1eec4ac7 | 235 | ./tools/mkmake | \ |
df7a539a | 236 | sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \ |
fc70b5f7 GM |
237 | done |
238 | ||
1eec4ac7 GM |
239 | tools/mkmake: |
240 | (cd tools; make mkmake) | |
241 | ||
7ffa2088 GM |
242 | .DEFAULT: |
243 | sccs get $< | |
244 | ||
245 | depend: thisdepend | |
246 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done | |
247 | ||
248 | thisdepend: | |
fc70b5f7 GM |
249 | echo > eddep.c |
250 | grep '^#include' ${ALLC} eddep.c | grep -v '<' | \ | |
7ffa2088 | 251 | sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ |
fc70b5f7 | 252 | -e 's/\.c/$$O/' | \ |
7ffa2088 GM |
253 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ |
254 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
255 | else rec = rec " " $$2 } } \ | |
256 | END { print rec } ' > makedep | |
257 | echo '$$r makedep' >>eddep | |
258 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
259 | echo '$$r makedep' >>eddep | |
260 | echo 'w' >>eddep | |
dd6c8c3e | 261 | -rm -f makefile.bak |
7ffa2088 GM |
262 | cp makefile makefile.bak |
263 | ed - makefile < eddep | |
fc70b5f7 | 264 | rm eddep makedep eddep.c |
7ffa2088 GM |
265 | |
266 | # DO NOT DELETE THIS LINE | |
267 | ||
ca67e7b4 C |
268 | telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext |
269 | telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h |