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 | |
56796659 GM |
6 | # provided that the above copyright notice and this paragraph are |
7 | # duplicated in all such forms and that any documentation, | |
8 | # advertising materials, and other materials related to such | |
9 | # distribution and use acknowledge that the software was developed | |
10 | # by the University of California, Berkeley. The name of the | |
11 | # University may not be used to endorse or promote products derived | |
12 | # from this software without specific prior written permission. | |
13 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
f6e43951 | 16 | # |
c6e1b91b | 17 | # @(#)makefile 4.7 (Berkeley) %G% |
f6e43951 | 18 | # |
bd4c6952 | 19 | |
7ffa2088 | 20 | # Makefile for tn3270 and friends... |
7ffa2088 | 21 | # |
bd4c6952 | 22 | # This is the makefile for tn3270. Note that we use the 4.3+ telnet |
7ffa2088 GM |
23 | # (compiled with special options; see below) to provide the telnet |
24 | # support we need. | |
25 | # | |
26 | # The following are the defines that may be passed (via the cc | |
27 | # -D option) to the compiler. | |
28 | # | |
7ffa2088 | 29 | # TN3270 - This is to be linked with tn3270. Necessary |
bd4c6952 GM |
30 | # for creating tn3270. Only for compiling |
31 | # telnet. | |
7ffa2088 | 32 | # |
7ffa2088 GM |
33 | # NOT43 - Allows the program to compile and run on |
34 | # a 4.2BSD system. | |
35 | # | |
36 | # PUTCHAR - Within tn3270, on a NOT43 system, | |
37 | # allows the use of the 4.3 curses | |
38 | # (greater speed updating the screen). | |
39 | # You need the 4.3 curses for this to work. | |
40 | # | |
41 | # FD_SETSIZE - On whichever system, if this isn't defined, | |
42 | # we patch over the FD_SET, etc., macros with | |
43 | # some homebrewed ones. | |
44 | # | |
45 | # SO_OOBINLINE - This is a socket option which we would like | |
46 | # to set to allow TCP urgent data to come | |
47 | # to us "inline". This is NECESSARY for | |
48 | # CORRECT operation, and desireable for | |
49 | # simpler operation. | |
50 | # | |
51 | # LNOFLSH - Detects the presence of the LNOFLSH bit | |
52 | # in the tty structure. | |
53 | # | |
54 | # | |
dd82590f GM |
55 | # |
56 | # TERMCAP - Define this if your system is termcap based, | |
57 | # otherwise a terminfo based system is assumed. | |
58 | # | |
59 | # SRCRT - Includes code to allow you to specify | |
60 | # source routes. | |
61 | # Format is: | |
62 | # [!]@hop1@hop2...[@|:]dst | |
63 | # Leading ! means strict source route. | |
64 | # | |
65 | # NOSTRNCASECMP - Define this if you do not have strncasecmp() in | |
66 | # your C libarary. | |
67 | # | |
68 | # USE_TERMIO - Define this if you have System V termio | |
69 | # structures. What is here is how things | |
70 | # are on Cray computers. | |
71 | # | |
72 | # KLUDGELINEMODE - Define this to get the kludged up version | |
73 | # of linemode that was in 4.3BSD. This is a | |
74 | # good thing to have around for talking to | |
75 | # older systems. | |
76 | # | |
77 | # | |
7ffa2088 GM |
78 | # Here are some which are used throughout the system: |
79 | # | |
7ffa2088 GM |
80 | # unix - Compiles in unix specific stuff. |
81 | # | |
82 | # msdos - Compiles in msdos specific stuff. | |
83 | # | |
84 | ||
fc70b5f7 GM |
85 | # msdos versus unix defines |
86 | O = .o | |
df7a539a | 87 | #PC_O = .obj |
fc70b5f7 GM |
88 | |
89 | X = | |
df7a539a GM |
90 | #PC_X = .exe |
91 | ||
92 | L = | |
93 | #PC_L = -link | |
fc70b5f7 | 94 | |
7ffa2088 | 95 | CC = cc |
df7a539a | 96 | #PC_CC = cl |
dd6c8c3e GM |
97 | |
98 | MV = mv | |
df7a539a | 99 | #PC_MV = rename |
dd6c8c3e GM |
100 | |
101 | RM = rm -f | |
df7a539a | 102 | #PC_RM= erase |
dd6c8c3e GM |
103 | |
104 | LINT_ARGS = | |
df7a539a | 105 | #PC_LINT_ARGS = -DLINT_ARGS |
dd6c8c3e GM |
106 | |
107 | DEBUG_FLAGS = -g | |
df7a539a | 108 | #PC_DEBUG_FLAGS = -Zi -Od |
dd6c8c3e GM |
109 | |
110 | AR = ar | |
df7a539a GM |
111 | AR1 = cr |
112 | AR2 = | |
113 | AR3 = | |
114 | #PC_AR = lib | |
115 | #PC_AR1 = | |
116 | #PC_AR2 = + | |
117 | #PC_AR3 = ";" | |
dd6c8c3e GM |
118 | |
119 | RANLIB = ranlib | |
df7a539a | 120 | #PC_RANLIB = echo "Done with " |
dd6c8c3e GM |
121 | |
122 | ||
7ffa2088 | 123 | PRINT = print |
bd4c6952 | 124 | ACTION = @sccs tell |
7ffa2088 | 125 | |
cee2dba8 | 126 | DEFINES= ${LINT_ARGS} -DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO |
7ffa2088 | 127 | |
04b5f59e | 128 | INCLUDES = -I. -I.. |
7ffa2088 GM |
129 | |
130 | OPTIMIZE = -O | |
dd6c8c3e | 131 | OPTIMIZE = ${DEBUG_FLAGS} |
7ffa2088 GM |
132 | |
133 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) | |
134 | ||
135 | # Lint flags | |
136 | LINTFLAGS = -hbxaz | |
137 | # How to install the bloody thing... | |
138 | ||
139 | DESTDIR= | |
140 | ||
4bd15d34 | 141 | BINDIR = $(DESTDIR)/usr/bin |
56796659 GM |
142 | MAN1DIR = $(DESTDIR)/usr/man/cat1 |
143 | MAN5DIR = $(DESTDIR)/usr/man/cat5 | |
7ffa2088 GM |
144 | |
145 | # Names for the terminal libraries... | |
146 | LIBCURSES = -lcurses | |
147 | LIBTERM = -ltermlib | |
148 | ||
df7a539a GM |
149 | #PC_LIBCURSES = |
150 | #PC_LIBTERM = | |
151 | ||
7ffa2088 | 152 | # The source files... |
56796659 | 153 | ALLH = telextrn.h |
7ffa2088 | 154 | |
c6e1b91b | 155 | MSMAIN = ${.CURDIR}/ascii/mset.c |
7ffa2088 | 156 | |
bd4c6952 | 157 | ALLC = |
eb82b98e | 158 | |
bd4c6952 | 159 | ALLO = mset$O |
eb82b98e | 160 | |
bd4c6952 GM |
161 | ALLHC= ${ALLH} ${ALLC} |
162 | ALLPRINT = ${ALLHC} | |
eb82b98e | 163 | |
56796659 GM |
164 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README \ |
165 | mset.1 tn3270.1 map3270.5 | |
eb82b98e | 166 | |
df7a539a GM |
167 | SYS = sys_curses |
168 | #PC_SYS = sys_dos | |
dd6c8c3e | 169 | |
7ffa2088 | 170 | # The places where the various components live... |
a63f9327 | 171 | |
c6e1b91b PB |
172 | SUBDIR = ${.CURDIR}/api ${.CURDIR}/ascii ${.CURDIR}/ctlr \ |
173 | ${.CURDIR}/general ${.CURDIR}/${SYS} ${.CURDIR}/telnet | |
d86829c0 | 174 | |
eb82b98e GM |
175 | # The following are directories we don't do regular make's in, but |
176 | # we do make everywhere, print, and sourcelist in. | |
a63f9327 | 177 | |
c6e1b91b | 178 | EXTRADIR = ${.CURDIR}/tools |
eb82b98e | 179 | |
d86829c0 | 180 | # The libraries we use. The order here is important. |
c0c987e5 GM |
181 | # syslib.a and ctlrlib.a should come first, then the rest. |
182 | SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \ | |
78f0cc47 | 183 | ascii/asciilib.a general/generallib.a |
7ffa2088 | 184 | |
7ffa2088 GM |
185 | .s.o: |
186 | /lib/cpp -E $< | as -o $@ | |
187 | ||
c6e1b91b PB |
188 | #.c.obj: |
189 | # ${CC} ${CFLAGS} -c $< | |
dd6c8c3e | 190 | |
fc70b5f7 | 191 | all: FRC tn3270$X mset$X |
7ffa2088 GM |
192 | |
193 | FRC: | |
755c4d48 GM |
194 | for i in ${SUBDIR}; \ |
195 | do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done | |
7ffa2088 | 196 | |
94b7d211 GM |
197 | tn3270$X: telnet/telprog.o ${SUBLIB} api/apilib.a |
198 | ${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \ | |
e8335e24 GM |
199 | $L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM) \ |
200 | -lcompat | |
df7a539a GM |
201 | |
202 | #PC_tn3270$X: | |
1eec4ac7 GM |
203 | #PC_ link <@< |
204 | #PC_ telnet | |
b0ef3ef0 | 205 | #PC_ tn3270 |
1eec4ac7 | 206 | #PC_ nul |
c0c987e5 | 207 | #PC_ ${SUBLIB} api/apilib.a+ |
1eec4ac7 GM |
208 | #PC_ \lib\ublib\ubtcp |
209 | #PC_ _PC_< | |
7ffa2088 | 210 | |
fc70b5f7 | 211 | mset$X: mset$O ascii/map3270$O |
c0c987e5 | 212 | ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a |
7ffa2088 | 213 | |
fc70b5f7 | 214 | mset$O: $(MSMAIN) |
7ffa2088 GM |
215 | $(CC) $(CFLAGS) -c $(MSMAIN) |
216 | ||
56796659 | 217 | install: tn3270$X mset$X tn3270.0 mset.0 map3270.0 |
a9bda23c GM |
218 | install -m 755 -o bin -g bin -s tn3270 $(BINDIR) |
219 | install -m 755 -o bin -g bin -s mset $(BINDIR) | |
56796659 GM |
220 | install -c -o bin -g bin -m 444 tn3270.0 mset.0 $(MAN1DIR) |
221 | install -c -o bin -g bin -m 444 map3270.0 $(MAN5DIR) | |
7ffa2088 | 222 | |
a233c85a GM |
223 | action: |
224 | ${ACTION} | |
225 | ||
bd4c6952 GM |
226 | clist: ${ALLHC} |
227 | @for i in ${SUBDIR}; \ | |
228 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ | |
229 | clist); done | |
230 | ||
231 | hclist: ${ALLHC} | |
232 | @for i in ${SUBDIR}; \ | |
233 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ | |
234 | hclist); done | |
235 | ||
eb82b98e GM |
236 | everywhere: action |
237 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
238 | do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \ | |
239 | "ACTION=${ACTION}"); done | |
a233c85a | 240 | |
e12533de | 241 | cleandir clean: |
dd6c8c3e GM |
242 | for i in $(ALLO) mset tn3270 errs makefile.bak; \ |
243 | do (${RM} $$i); done | |
244 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
245 | do (cd $$i; make ${MFLAGS} clean); done | |
246 | ||
247 | sccsclean: | |
78f0cc47 GM |
248 | -sccs clean |
249 | -sccs get makefile | |
dd6c8c3e GM |
250 | for i in ${SUBDIR} ${EXTRADIR}; \ |
251 | do (cd $$i; make ${MFLAGS} sccsclean); done | |
7ffa2088 GM |
252 | |
253 | print: | |
eb82b98e GM |
254 | ${PRINT} ${ALLPRINT} |
255 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
7ffa2088 | 256 | do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done |
7ffa2088 GM |
257 | |
258 | tags: ${ALLC} ${ALLH} | |
bd4c6952 | 259 | ctags -t `make ${MFLAGS} hclist` |
7ffa2088 | 260 | |
be140351 GM |
261 | sourcelist: ${ALLSOURCE} |
262 | @for i in ${ALLSOURCE}; \ | |
78f0cc47 | 263 | do (echo ${DIRPATH}$$i); done |
be140351 | 264 | @for i in ${SUBDIR} ${EXTRADIR}; \ |
78f0cc47 | 265 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ |
eb82b98e GM |
266 | sourcelist); done |
267 | ||
7ffa2088 | 268 | lint: |
56796659 | 269 | lint ${LINTFLAGS} -Itelnet ${INCLUDES} ${DEFINES} -DTN3270 \ |
bd4c6952 GM |
270 | `make clist` -lcurses |
271 | ||
272 | lintmset: | |
273 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \ | |
274 | ascii/map3270.c -lcurses | |
7ffa2088 | 275 | |
1eec4ac7 | 276 | makefiles.pc: tools/mkmake |
fc70b5f7 | 277 | for i in . ${SUBDIR} ${EXTRADIR}; \ |
df7a539a | 278 | do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \ |
1eec4ac7 | 279 | ./tools/mkmake | \ |
df7a539a | 280 | sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \ |
fc70b5f7 GM |
281 | done |
282 | ||
1eec4ac7 GM |
283 | tools/mkmake: |
284 | (cd tools; make mkmake) | |
285 | ||
7ffa2088 GM |
286 | .DEFAULT: |
287 | sccs get $< | |
288 | ||
289 | depend: thisdepend | |
290 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done | |
291 | ||
292 | thisdepend: | |
fc70b5f7 GM |
293 | echo > eddep.c |
294 | grep '^#include' ${ALLC} eddep.c | grep -v '<' | \ | |
7ffa2088 | 295 | sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ |
fc70b5f7 | 296 | -e 's/\.c/$$O/' | \ |
7ffa2088 GM |
297 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ |
298 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
299 | else rec = rec " " $$2 } } \ | |
300 | END { print rec } ' > makedep | |
301 | echo '$$r makedep' >>eddep | |
302 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
303 | echo '$$r makedep' >>eddep | |
304 | echo 'w' >>eddep | |
dd6c8c3e | 305 | -rm -f makefile.bak |
7ffa2088 GM |
306 | cp makefile makefile.bak |
307 | ed - makefile < eddep | |
fc70b5f7 | 308 | rm eddep makedep eddep.c |
7ffa2088 GM |
309 | |
310 | # DO NOT DELETE THIS LINE | |
311 |