Release 4.1
[unix-history] / usr / src / usr.bin / tn3270 / makefile
CommitLineData
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#
d43d1075 17# @(#)makefile 4.1 (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#
55# Here are some which are used throughout the system:
56#
7ffa2088
GM
57# unix - Compiles in unix specific stuff.
58#
59# msdos - Compiles in msdos specific stuff.
60#
61
fc70b5f7
GM
62# msdos versus unix defines
63O = .o
df7a539a 64#PC_O = .obj
fc70b5f7
GM
65
66X =
df7a539a
GM
67#PC_X = .exe
68
69L =
70#PC_L = -link
fc70b5f7 71
7ffa2088 72CC = cc
df7a539a 73#PC_CC = cl
dd6c8c3e
GM
74
75MV = mv
df7a539a 76#PC_MV = rename
dd6c8c3e
GM
77
78RM = rm -f
df7a539a 79#PC_RM= erase
dd6c8c3e
GM
80
81LINT_ARGS =
df7a539a 82#PC_LINT_ARGS = -DLINT_ARGS
dd6c8c3e
GM
83
84DEBUG_FLAGS = -g
df7a539a 85#PC_DEBUG_FLAGS = -Zi -Od
dd6c8c3e
GM
86
87AR = ar
df7a539a
GM
88AR1 = cr
89AR2 =
90AR3 =
91#PC_AR = lib
92#PC_AR1 =
93#PC_AR2 = +
94#PC_AR3 = ";"
dd6c8c3e
GM
95
96RANLIB = ranlib
df7a539a 97#PC_RANLIB = echo "Done with "
dd6c8c3e
GM
98
99
7ffa2088 100PRINT = print
bd4c6952 101ACTION = @sccs tell
7ffa2088 102
dd6c8c3e 103DEFINES = ${LINT_ARGS}
7ffa2088 104
04b5f59e 105INCLUDES = -I. -I..
7ffa2088
GM
106
107OPTIMIZE = -O
dd6c8c3e 108OPTIMIZE = ${DEBUG_FLAGS}
7ffa2088
GM
109
110CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
111
112# Lint flags
113LINTFLAGS = -hbxaz
114# How to install the bloody thing...
115
116DESTDIR=
117
118BINDIR = $(DESTDIR)/usr/ucb
56796659
GM
119MAN1DIR = $(DESTDIR)/usr/man/cat1
120MAN5DIR = $(DESTDIR)/usr/man/cat5
7ffa2088
GM
121
122# Names for the terminal libraries...
123LIBCURSES = -lcurses
124LIBTERM = -ltermlib
125
df7a539a
GM
126#PC_LIBCURSES =
127#PC_LIBTERM =
128
7ffa2088 129# The source files...
56796659 130ALLH = telextrn.h
7ffa2088 131
3d05654e 132MSMAIN = ascii/mset.c
7ffa2088 133
bd4c6952 134ALLC =
eb82b98e 135
bd4c6952 136ALLO = mset$O
eb82b98e 137
bd4c6952
GM
138ALLHC= ${ALLH} ${ALLC}
139ALLPRINT = ${ALLHC}
eb82b98e 140
56796659
GM
141ALLSOURCE = ${ALLPRINT} makefile makefile.mak makefile_4.2 README \
142 mset.1 tn3270.1 map3270.5
eb82b98e 143
df7a539a
GM
144SYS = sys_curses
145#PC_SYS = sys_dos
dd6c8c3e 146
7ffa2088 147# The places where the various components live...
a63f9327 148
bd4c6952 149SUBDIR = api ascii ctlr general ${SYS} telnet
d86829c0 150
eb82b98e
GM
151# The following are directories we don't do regular make's in, but
152# we do make everywhere, print, and sourcelist in.
a63f9327 153
78f0cc47 154EXTRADIR = arpa sys_dos tools utilities
eb82b98e 155
d86829c0 156# The libraries we use. The order here is important.
c0c987e5
GM
157# syslib.a and ctlrlib.a should come first, then the rest.
158SUBLIB = ${SYS}/syslib.a ctlr/ctlrlib.a \
78f0cc47 159 ascii/asciilib.a general/generallib.a
7ffa2088 160
7ffa2088
GM
161.s.o:
162 /lib/cpp -E $< | as -o $@
163
dd6c8c3e
GM
164.c.obj:
165 ${CC} ${CFLAGS} -c $<
166
fc70b5f7 167all: FRC tn3270$X mset$X
7ffa2088
GM
168
169FRC:
755c4d48
GM
170 for i in ${SUBDIR}; \
171 do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done
7ffa2088 172
94b7d211
GM
173tn3270$X: telnet/telprog.o ${SUBLIB} api/apilib.a
174 ${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \
c0c987e5 175 $L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM)
df7a539a
GM
176
177#PC_tn3270$X:
1eec4ac7
GM
178#PC_ link <@<
179#PC_ telnet
b0ef3ef0 180#PC_ tn3270
1eec4ac7 181#PC_ nul
c0c987e5 182#PC_ ${SUBLIB} api/apilib.a+
1eec4ac7
GM
183#PC_ \lib\ublib\ubtcp
184#PC_ _PC_<
7ffa2088 185
fc70b5f7 186mset$X: mset$O ascii/map3270$O
c0c987e5 187 ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a
7ffa2088 188
fc70b5f7 189mset$O: $(MSMAIN)
7ffa2088
GM
190 $(CC) $(CFLAGS) -c $(MSMAIN)
191
56796659 192install: tn3270$X mset$X tn3270.0 mset.0 map3270.0
a9bda23c
GM
193 install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
194 install -m 755 -o bin -g bin -s mset $(BINDIR)
56796659
GM
195 install -c -o bin -g bin -m 444 tn3270.0 mset.0 $(MAN1DIR)
196 install -c -o bin -g bin -m 444 map3270.0 $(MAN5DIR)
7ffa2088 197
a233c85a
GM
198action:
199 ${ACTION}
200
bd4c6952
GM
201clist: ${ALLHC}
202 @for i in ${SUBDIR}; \
203 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
204 clist); done
205
206hclist: ${ALLHC}
207 @for i in ${SUBDIR}; \
208 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
209 hclist); done
210
eb82b98e
GM
211everywhere: action
212 for i in ${SUBDIR} ${EXTRADIR}; \
213 do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
214 "ACTION=${ACTION}"); done
a233c85a 215
7ffa2088 216clean:
dd6c8c3e
GM
217 for i in $(ALLO) mset tn3270 errs makefile.bak; \
218 do (${RM} $$i); done
219 for i in ${SUBDIR} ${EXTRADIR}; \
220 do (cd $$i; make ${MFLAGS} clean); done
221
222sccsclean:
78f0cc47
GM
223 -sccs clean
224 -sccs get makefile
dd6c8c3e
GM
225 for i in ${SUBDIR} ${EXTRADIR}; \
226 do (cd $$i; make ${MFLAGS} sccsclean); done
7ffa2088
GM
227
228print:
eb82b98e
GM
229 ${PRINT} ${ALLPRINT}
230 for i in ${SUBDIR} ${EXTRADIR}; \
7ffa2088 231 do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done
7ffa2088
GM
232
233tags: ${ALLC} ${ALLH}
bd4c6952 234 ctags -t `make ${MFLAGS} hclist`
7ffa2088 235
be140351
GM
236sourcelist: ${ALLSOURCE}
237 @for i in ${ALLSOURCE}; \
78f0cc47 238 do (echo ${DIRPATH}$$i); done
be140351 239 @for i in ${SUBDIR} ${EXTRADIR}; \
78f0cc47 240 do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
eb82b98e
GM
241 sourcelist); done
242
7ffa2088 243lint:
56796659 244 lint ${LINTFLAGS} -Itelnet ${INCLUDES} ${DEFINES} -DTN3270 \
bd4c6952
GM
245 `make clist` -lcurses
246
247lintmset:
248 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \
249 ascii/map3270.c -lcurses
7ffa2088 250
1eec4ac7 251makefiles.pc: tools/mkmake
fc70b5f7 252 for i in . ${SUBDIR} ${EXTRADIR}; \
df7a539a 253 do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \
1eec4ac7 254 ./tools/mkmake | \
df7a539a 255 sed -e "sx/x\\\\xg" -e "s/[ ]*_PC_//" > $$i/makefile.mak); \
fc70b5f7
GM
256 done
257
1eec4ac7
GM
258tools/mkmake:
259 (cd tools; make mkmake)
260
7ffa2088
GM
261.DEFAULT:
262 sccs get $<
263
264depend: thisdepend
265 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
266
267thisdepend:
fc70b5f7
GM
268 echo > eddep.c
269 grep '^#include' ${ALLC} eddep.c | grep -v '<' | \
7ffa2088 270 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
fc70b5f7 271 -e 's/\.c/$$O/' | \
7ffa2088
GM
272 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
273 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
274 else rec = rec " " $$2 } } \
275 END { print rec } ' > makedep
276 echo '$$r makedep' >>eddep
277 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
278 echo '$$r makedep' >>eddep
279 echo 'w' >>eddep
dd6c8c3e 280 -rm -f makefile.bak
7ffa2088
GM
281 cp makefile makefile.bak
282 ed - makefile < eddep
fc70b5f7 283 rm eddep makedep eddep.c
7ffa2088
GM
284
285# DO NOT DELETE THIS LINE
286