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