Commit | Line | Data |
---|---|---|
7ffa2088 GM |
1 | # Makefile for tn3270 and friends... |
2 | # @(#)makefile 3.1 10/29/86 | |
3 | # | |
4 | # This is the makefile for tn3270. Note that we use ../telnet.c | |
5 | # (compiled with special options; see below) to provide the telnet | |
6 | # support we need. | |
7 | # | |
8 | # The following are the defines that may be passed (via the cc | |
9 | # -D option) to the compiler. | |
10 | # | |
11 | # The first group relate only to ../telnet.c: | |
12 | # | |
13 | # TN3270 - This is to be linked with tn3270. Necessary | |
14 | # for creating tn3270. | |
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 | # | |
38 | # Here are some which are used throughout the system: | |
39 | # | |
7ffa2088 GM |
40 | # unix - Compiles in unix specific stuff. |
41 | # | |
42 | # msdos - Compiles in msdos specific stuff. | |
43 | # | |
44 | ||
fc70b5f7 GM |
45 | # msdos versus unix defines |
46 | O = .o | |
47 | PC_O = .obj | |
48 | ||
49 | X = | |
50 | PC_X = .exe | |
51 | ||
7ffa2088 | 52 | CC = cc |
dd6c8c3e GM |
53 | PC_CC = cl |
54 | ||
55 | MV = mv | |
56 | PC_MV = rename | |
57 | ||
58 | RM = rm -f | |
59 | PC_RM= erase | |
60 | ||
61 | LINT_ARGS = | |
62 | PC_LINT_ARGS = -DLINT_ARGS | |
63 | ||
64 | DEBUG_FLAGS = -g | |
65 | PC_DEBUG_FLAGS = -Zi -Od | |
66 | ||
67 | AR = ar | |
68 | C = | |
69 | PC_AR = lib | |
70 | PC_C = + | |
71 | ||
72 | RANLIB = ranlib | |
73 | PC_RANLIB = echo "Done with " | |
74 | ||
75 | ||
7ffa2088 | 76 | PRINT = print |
eb82b98e | 77 | ACTION = sccs tell |
7ffa2088 | 78 | |
dd6c8c3e | 79 | DEFINES = ${LINT_ARGS} |
7ffa2088 | 80 | |
04b5f59e | 81 | INCLUDES = -I. -I.. |
7ffa2088 GM |
82 | |
83 | OPTIMIZE = -O | |
dd6c8c3e | 84 | OPTIMIZE = ${DEBUG_FLAGS} |
7ffa2088 GM |
85 | |
86 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) | |
87 | ||
88 | # Lint flags | |
89 | LINTFLAGS = -hbxaz | |
90 | # How to install the bloody thing... | |
91 | ||
92 | DESTDIR= | |
93 | ||
94 | BINDIR = $(DESTDIR)/usr/ucb | |
95 | ETCDIR = $(DESTDIR)/etc | |
96 | MANDIR = $(DESTDIR)/usr/man/man | |
97 | ||
98 | # Names for the terminal libraries... | |
99 | LIBCURSES = -lcurses | |
100 | LIBTERM = -ltermlib | |
101 | ||
102 | # The source files... | |
eb82b98e | 103 | ALLH = telnet.ext |
7ffa2088 GM |
104 | |
105 | TNMAIN = ../telnet.c | |
106 | TNMAIN = telnet.c | |
3d05654e | 107 | MSMAIN = ascii/mset.c |
7ffa2088 | 108 | |
eb82b98e GM |
109 | ALLC = ${TNMAIN} |
110 | ||
fc70b5f7 | 111 | ALLO = telnet$O mset$O |
eb82b98e GM |
112 | |
113 | ALLPRINT = ${ALLH} ${ALLC} | |
114 | ||
115 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak README | |
116 | ||
dd6c8c3e GM |
117 | SYS = sys |
118 | PC_SYS = sys_dos | |
119 | ||
7ffa2088 | 120 | # The places where the various components live... |
a63f9327 | 121 | |
dd6c8c3e | 122 | SUBDIR = api apilib ascii ctlr general ${SYS} |
d86829c0 | 123 | |
eb82b98e GM |
124 | # The following are directories we don't do regular make's in, but |
125 | # we do make everywhere, print, and sourcelist in. | |
a63f9327 | 126 | |
78f0cc47 | 127 | EXTRADIR = arpa sys_dos tools utilities |
eb82b98e | 128 | |
d86829c0 | 129 | # The libraries we use. The order here is important. |
78f0cc47 | 130 | # ctlrlib.a and syslib.a should come first, then apilib.a |
d86829c0 | 131 | # then the rest. |
dd6c8c3e | 132 | SUBLIB = ctlr/ctlrlib.a ${SYS}/syslib.a \ |
78f0cc47 GM |
133 | api/apilib.a \ |
134 | ascii/asciilib.a general/generallib.a | |
7ffa2088 | 135 | |
7ffa2088 GM |
136 | .s.o: |
137 | /lib/cpp -E $< | as -o $@ | |
138 | ||
dd6c8c3e GM |
139 | .c.obj: |
140 | ${CC} ${CFLAGS} -c $< | |
141 | ||
fc70b5f7 | 142 | all: FRC tn3270$X mset$X |
7ffa2088 GM |
143 | |
144 | FRC: | |
755c4d48 GM |
145 | for i in ${SUBDIR}; \ |
146 | do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done | |
7ffa2088 | 147 | |
fc70b5f7 GM |
148 | tn3270$X: telnet$O ${SUBLIB} |
149 | ${CC} ${CFLAGS} -o tn3270 telnet$O \ | |
d86829c0 | 150 | ${SUBLIB} apilib/apilib.a $(LIBCURSES) $(LIBTERM) |
7ffa2088 | 151 | |
fc70b5f7 GM |
152 | mset$X: mset$O ascii/map3270$O |
153 | ${CC} ${CFLAGS} -o mset mset$O ascii/map3270$O apilib/apilib.a | |
7ffa2088 | 154 | |
fc70b5f7 | 155 | telnet$O: $(TNMAIN) |
7ffa2088 GM |
156 | $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN) |
157 | ||
fc70b5f7 | 158 | mset$O: $(MSMAIN) |
7ffa2088 GM |
159 | $(CC) $(CFLAGS) -c $(MSMAIN) |
160 | ||
161 | install: | |
162 | install -s tn3270 $(BINDIR) | |
163 | install -s mset $(BINDIR) | |
164 | if [ ! -f ${ETCDIR}/map3270 ]; then \ | |
165 | install -c -m 444 map3270.dat ${ETCDIR}/map3270; \ | |
166 | fi | |
167 | # install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1 | |
168 | # install -c -m 444 man/mset.1 $(MANDIR)1/mset.1 | |
169 | # install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5 | |
170 | ||
a233c85a GM |
171 | action: |
172 | ${ACTION} | |
173 | ||
eb82b98e GM |
174 | everywhere: action |
175 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
176 | do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \ | |
177 | "ACTION=${ACTION}"); done | |
a233c85a | 178 | |
7ffa2088 | 179 | clean: |
dd6c8c3e GM |
180 | for i in $(ALLO) mset tn3270 errs makefile.bak; \ |
181 | do (${RM} $$i); done | |
182 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
183 | do (cd $$i; make ${MFLAGS} clean); done | |
184 | ||
185 | sccsclean: | |
78f0cc47 GM |
186 | -sccs clean |
187 | -sccs get makefile | |
dd6c8c3e GM |
188 | for i in ${SUBDIR} ${EXTRADIR}; \ |
189 | do (cd $$i; make ${MFLAGS} sccsclean); done | |
7ffa2088 GM |
190 | |
191 | print: | |
eb82b98e GM |
192 | ${PRINT} ${ALLPRINT} |
193 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
7ffa2088 | 194 | do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done |
7ffa2088 GM |
195 | |
196 | tags: ${ALLC} ${ALLH} | |
197 | ctags -t ${ALLC} ${ALLH} | |
198 | ||
be140351 GM |
199 | sourcelist: ${ALLSOURCE} |
200 | @for i in ${ALLSOURCE}; \ | |
78f0cc47 | 201 | do (echo ${DIRPATH}$$i); done |
be140351 | 202 | @for i in ${SUBDIR} ${EXTRADIR}; \ |
78f0cc47 | 203 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ |
eb82b98e GM |
204 | sourcelist); done |
205 | ||
7ffa2088 GM |
206 | lint: |
207 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \ | |
208 | ${TNMAIN} -lcurses | |
209 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses | |
210 | ||
dfcb0f75 | 211 | makefiles.pc: |
fc70b5f7 GM |
212 | for i in . ${SUBDIR} ${EXTRADIR}; \ |
213 | do (sed -e "s/lib\.a/.lib/g" -e "s/^PC_//" < $$i/makefile | \ | |
214 | mkmake | sed -e "sx/x\\\\x" > $$i/makefile.mak); \ | |
215 | done | |
216 | ||
7ffa2088 GM |
217 | .DEFAULT: |
218 | sccs get $< | |
219 | ||
220 | depend: thisdepend | |
221 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done | |
222 | ||
223 | thisdepend: | |
fc70b5f7 GM |
224 | echo > eddep.c |
225 | grep '^#include' ${ALLC} eddep.c | grep -v '<' | \ | |
7ffa2088 | 226 | sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ |
fc70b5f7 | 227 | -e 's/\.c/$$O/' | \ |
7ffa2088 GM |
228 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ |
229 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
230 | else rec = rec " " $$2 } } \ | |
231 | END { print rec } ' > makedep | |
232 | echo '$$r makedep' >>eddep | |
233 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
234 | echo '$$r makedep' >>eddep | |
235 | echo 'w' >>eddep | |
dd6c8c3e | 236 | -rm -f makefile.bak |
7ffa2088 GM |
237 | cp makefile makefile.bak |
238 | ed - makefile < eddep | |
fc70b5f7 | 239 | rm eddep makedep eddep.c |
7ffa2088 GM |
240 | |
241 | # DO NOT DELETE THIS LINE | |
242 | ||
fc70b5f7 GM |
243 | telnet$O: ascii/termin.ext ctlr/screen.h ctlr/oia.h ctlr/options.ext |
244 | telnet$O: ctlr/outbound.ext general/globals.h telnet.ext general/general.h |