summaryrefslogtreecommitdiffstats
path: root/usr.bin/tn3270/distribution/makefile_4.2
blob: b8e5eb8e999b46debaecd080f423a456eb262567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#	@(#)makefile	3.5 (Berkeley) 5/15/88

# This makefile will make tn3270 on Vax 4.2 systems.  Notice, however,
# that on an ultrix system you will need to use the Makefile_ultrix in
# telnet/ rather than the Makefile already in that directory.

# Makefile for tn3270 and friends...
#
#	This is the makefile for tn3270.  Note that we use the 4.3+ telnet
# (compiled with special options; see below) to provide the telnet
# support we need.
#
#	The following are the defines that may be passed (via the cc
# -D option) to the compiler.
#
#	TN3270		- 	This is to be linked with tn3270.  Necessary
#				for creating tn3270.  Only for compiling
#				telnet.
#
#	NOT43		-	Allows the program to compile and run on
#				a 4.2BSD system.
#
#	PUTCHAR		-	Within tn3270, on a NOT43 system,
#				allows the use of the 4.3 curses
#				(greater speed updating the screen).
#				You need the 4.3 curses for this to work.
#
#	FD_SETSIZE	-	On whichever system, if this isn't defined,
#				we patch over the FD_SET, etc., macros with
#				some homebrewed ones.
#
#	SO_OOBINLINE	-	This is a socket option which we would like
#				to set to allow TCP urgent data to come
#				to us "inline".  This is NECESSARY for
#				CORRECT operation, and desireable for
#				simpler operation.
#
#	LNOFLSH		-	Detects the presence of the LNOFLSH bit
#				in the tty structure.
#
#
#	Here are some which are used throughout the system:
#
#	unix		-	Compiles in unix specific stuff.
#
#	msdos		-	Compiles in msdos specific stuff.
#

# msdos versus unix defines
O	= .o
#PC_O	= .obj

X	=
#PC_X	= .exe

L	=
#PC_L	= -link

CC	= cc
#PC_CC	= cl

MV	= mv
#PC_MV	= rename

RM	= rm -f
#PC_RM= erase

LINT_ARGS =
#PC_LINT_ARGS = -DLINT_ARGS

DEBUG_FLAGS = -g
#PC_DEBUG_FLAGS = -Zi -Od

AR	= ar
AR1	= cr
AR2	=
AR3	=
#PC_AR	= lib
#PC_AR1	=
#PC_AR2	= +
#PC_AR3	= ";"

RANLIB	= ranlib
#PC_RANLIB = echo "Done with "


PRINT	= print
ACTION = @sccs tell

DEFINES = -DNOT43 ${LINT_ARGS}

INCLUDES = -I. -I..

OPTIMIZE = -O
OPTIMIZE = ${DEBUG_FLAGS}

CFLAGS	= $(OPTIMIZE) $(INCLUDES) $(DEFINES)

# Lint flags
LINTFLAGS	= -hbxaz
# How to install the bloody thing...

DESTDIR=

BINDIR		= $(DESTDIR)/usr/ucb

# Names for the terminal libraries...
LIBCURSES	= -lcurses
LIBTERM		= -ltermlib

#PC_LIBCURSES	=
#PC_LIBTERM	=

# The source files...
ALLH =	telnet.ext

MSMAIN = ascii/mset.c

ALLC =

ALLO	= mset$O

ALLHC=	${ALLH} ${ALLC}
ALLPRINT =	${ALLHC}

ALLSOURCE =	${ALLPRINT} makefile makefile.mak makefile_4.2 README

SYS	= sys_curses
#PC_SYS	= sys_dos

# The places where the various components live...

SUBDIR =	api ascii ctlr general ${SYS} telnet

# The following are directories we don't do regular make's in, but
# we do make everywhere, print, and sourcelist in.

EXTRADIR =	arpa sys_dos tools utilities

# The libraries we use.  The order here is important.
# syslib.a and ctlrlib.a should come first, then the rest.
SUBLIB =	${SYS}/syslib.a ctlr/ctlrlib.a \
		ascii/asciilib.a general/generallib.a

.s.o:
	/lib/cpp -E $< | as -o $@

.c.obj:
	${CC} ${CFLAGS} -c $<

all:	FRC tn3270$X mset$X

FRC:
	for i in ${SUBDIR}; \
		do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done

tn3270$X:	telnet/telprog.o ${SUBLIB} api/apilib.a
	${CC} ${CFLAGS} -o tn3270 telnet/telprog.o \
		$L ${SUBLIB} api/apilib.a $(LIBCURSES) $(LIBTERM)

#PC_tn3270$X:
#PC_	link <@<
#PC_	telnet
#PC_	tn3270
#PC_	nul
#PC_	${SUBLIB} api/apilib.a+
#PC_	\lib\ublib\ubtcp
#PC_	_PC_<

mset$X:	mset$O ascii/map3270$O
	${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O $L api/apilib.a

mset$O:	$(MSMAIN)
	$(CC) $(CFLAGS) -c $(MSMAIN)

install:	tn3270$X mset$X
	install -m 755 -o bin -g bin -s tn3270 $(BINDIR)
	install -m 755 -o bin -g bin -s mset $(BINDIR)

action:
	${ACTION}

clist:	${ALLHC}
	@for i in ${SUBDIR}; \
		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
							    clist); done

hclist:	${ALLHC}
	@for i in ${SUBDIR}; \
		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
							    hclist); done

everywhere:	action
	for i in ${SUBDIR} ${EXTRADIR}; \
		do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \
						"ACTION=${ACTION}"); done

clean:
	for i in $(ALLO) mset tn3270 errs makefile.bak; \
			do (${RM} $$i); done
	for i in ${SUBDIR} ${EXTRADIR}; \
			do (cd $$i; make ${MFLAGS} clean); done

sccsclean:
	-sccs clean
	-sccs get makefile
	for i in ${SUBDIR} ${EXTRADIR}; \
			do (cd $$i; make ${MFLAGS} sccsclean); done

print:
	${PRINT} ${ALLPRINT}
	for i in ${SUBDIR} ${EXTRADIR}; \
			do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done

tags:	${ALLC} ${ALLH}
	ctags -t `make ${MFLAGS} hclist`

sourcelist:	${ALLSOURCE}
	@for i in ${ALLSOURCE}; \
		do (echo ${DIRPATH}$$i); done
	@for i in ${SUBDIR} ${EXTRADIR}; \
		do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \
							    sourcelist); done

lint:
	lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \
				`make clist` -lcurses

lintmset:
	lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} \
				ascii/map3270.c -lcurses

makefiles.pc:	tools/mkmake
	for i in . ${SUBDIR} ${EXTRADIR}; \
	do (sed -e "s/lib\.a/.lib/g" -e "s/^#PC_//" < $$i/makefile | \
		./tools/mkmake | \
		sed -e "sx/x\\\\xg" -e "s/[ 	]*_PC_//" > $$i/makefile.mak); \
	    done

tools/mkmake:
	(cd tools; make mkmake)

.DEFAULT:
	sccs get $<

depend:	thisdepend
	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done

thisdepend:
	echo > eddep.c
	grep '^#include' ${ALLC} eddep.c | grep -v '<' | \
	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
	    -e 's/\.c/$$O/' | \
	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
		       else rec = rec " " $$2 } } \
	      END { print rec } ' > makedep
	echo '$$r makedep' >>eddep
	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	-rm -f makefile.bak
	cp makefile makefile.bak
	ed - makefile < eddep
	rm eddep makedep eddep.c

# DO NOT DELETE THIS LINE

OpenPOWER on IntegriCloud