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 | ||
45 | CC = cc | |
46 | PRINT = print | |
eb82b98e | 47 | ACTION = sccs tell |
7ffa2088 | 48 | |
755c4d48 | 49 | DEFINES = |
7ffa2088 | 50 | |
04b5f59e | 51 | INCLUDES = -I. -I.. |
7ffa2088 GM |
52 | |
53 | OPTIMIZE = -O | |
54 | OPTIMIZE = -g | |
55 | ||
56 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) | |
57 | ||
58 | # Lint flags | |
59 | LINTFLAGS = -hbxaz | |
60 | # How to install the bloody thing... | |
61 | ||
62 | DESTDIR= | |
63 | ||
64 | BINDIR = $(DESTDIR)/usr/ucb | |
65 | ETCDIR = $(DESTDIR)/etc | |
66 | MANDIR = $(DESTDIR)/usr/man/man | |
67 | ||
68 | # Names for the terminal libraries... | |
69 | LIBCURSES = -lcurses | |
70 | LIBTERM = -ltermlib | |
71 | ||
72 | # The source files... | |
eb82b98e | 73 | ALLH = telnet.ext |
7ffa2088 GM |
74 | |
75 | TNMAIN = ../telnet.c | |
76 | TNMAIN = telnet.c | |
3d05654e | 77 | MSMAIN = ascii/mset.c |
7ffa2088 | 78 | |
eb82b98e GM |
79 | ALLC = ${TNMAIN} |
80 | ||
81 | ALLO = telnet.o mset.o | |
82 | ||
83 | ALLPRINT = ${ALLH} ${ALLC} | |
84 | ||
85 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak README | |
86 | ||
7ffa2088 | 87 | # The places where the various components live... |
a63f9327 | 88 | |
755c4d48 | 89 | SUBDIR = api apilib ascii ctlr general sys |
d86829c0 | 90 | |
eb82b98e GM |
91 | # The following are directories we don't do regular make's in, but |
92 | # we do make everywhere, print, and sourcelist in. | |
a63f9327 | 93 | |
78f0cc47 | 94 | EXTRADIR = arpa sys_dos tools utilities |
eb82b98e | 95 | |
d86829c0 | 96 | # The libraries we use. The order here is important. |
78f0cc47 | 97 | # ctlrlib.a and syslib.a should come first, then apilib.a |
d86829c0 | 98 | # then the rest. |
78f0cc47 GM |
99 | SUBLIB = ctlr/ctlrlib.a sys/syslib.a \ |
100 | api/apilib.a \ | |
101 | ascii/asciilib.a general/generallib.a | |
7ffa2088 | 102 | |
7ffa2088 GM |
103 | .s.o: |
104 | /lib/cpp -E $< | as -o $@ | |
105 | ||
755c4d48 | 106 | all: FRC tn3270 mset |
7ffa2088 GM |
107 | |
108 | FRC: | |
755c4d48 GM |
109 | for i in ${SUBDIR}; \ |
110 | do (cd $$i; make ${MFLAGS} "CFLAGS=${CFLAGS}"); done | |
7ffa2088 | 111 | |
d86829c0 GM |
112 | tn3270: telnet.o ${SUBLIB} |
113 | ${CC} ${CFLAGS} -o tn3270 telnet.o \ | |
114 | ${SUBLIB} apilib/apilib.a $(LIBCURSES) $(LIBTERM) | |
7ffa2088 | 115 | |
78f0cc47 GM |
116 | mset: mset.o ascii/map3270.o |
117 | ${CC} ${CFLAGS} -o mset mset.o ascii/map3270.o apilib/apilib.a | |
7ffa2088 GM |
118 | |
119 | telnet.o: $(TNMAIN) | |
120 | $(CC) $(CFLAGS) -DTN3270 -c $(TNMAIN) | |
121 | ||
122 | mset.o: $(MSMAIN) | |
123 | $(CC) $(CFLAGS) -c $(MSMAIN) | |
124 | ||
125 | install: | |
126 | install -s tn3270 $(BINDIR) | |
127 | install -s mset $(BINDIR) | |
128 | if [ ! -f ${ETCDIR}/map3270 ]; then \ | |
129 | install -c -m 444 map3270.dat ${ETCDIR}/map3270; \ | |
130 | fi | |
131 | # install -c -m 444 man/tn3270.1 $(MANDIR)1/tn3270.1 | |
132 | # install -c -m 444 man/mset.1 $(MANDIR)1/mset.1 | |
133 | # install -c -m 444 man/map3270.5 $(MANDIR)5/map3270.5 | |
134 | ||
a233c85a GM |
135 | action: |
136 | ${ACTION} | |
137 | ||
eb82b98e GM |
138 | everywhere: action |
139 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
140 | do (echo "[$$i]"; cd $$i; make ${MFLAGS} action \ | |
141 | "ACTION=${ACTION}"); done | |
a233c85a | 142 | |
7ffa2088 | 143 | clean: |
d86829c0 | 144 | rm -f $(ALLO) mset tn3270 errs makefile.bak |
78f0cc47 GM |
145 | -sccs clean |
146 | -sccs get makefile | |
eb82b98e | 147 | for i in ${SUBDIR} ${EXTRADIR}; do (cd $$i; make ${MFLAGS} clean); done |
7ffa2088 GM |
148 | |
149 | print: | |
eb82b98e GM |
150 | ${PRINT} ${ALLPRINT} |
151 | for i in ${SUBDIR} ${EXTRADIR}; \ | |
7ffa2088 | 152 | do (cd $$i; make ${MFLAGS} "PRINT=${PRINT}" print); done |
7ffa2088 GM |
153 | |
154 | tags: ${ALLC} ${ALLH} | |
155 | ctags -t ${ALLC} ${ALLH} | |
156 | ||
be140351 GM |
157 | sourcelist: ${ALLSOURCE} |
158 | @for i in ${ALLSOURCE}; \ | |
78f0cc47 | 159 | do (echo ${DIRPATH}$$i); done |
be140351 | 160 | @for i in ${SUBDIR} ${EXTRADIR}; \ |
78f0cc47 | 161 | do (cd $$i; make ${MFLAGS} "DIRPATH=${DIRPATH}$$i/" \ |
eb82b98e GM |
162 | sourcelist); done |
163 | ||
7ffa2088 GM |
164 | lint: |
165 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 \ | |
166 | ${TNMAIN} -lcurses | |
167 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${MSMAIN} map3270.c -lcurses | |
168 | ||
169 | .DEFAULT: | |
170 | sccs get $< | |
171 | ||
172 | depend: thisdepend | |
173 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done | |
174 | ||
175 | thisdepend: | |
176 | grep '^#include' ${ALLC} | grep -v '<' | \ | |
177 | sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
178 | -e 's/\.c/.o/' | \ | |
179 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ | |
180 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
181 | else rec = rec " " $$2 } } \ | |
182 | END { print rec } ' > makedep | |
183 | echo '$$r makedep' >>eddep | |
184 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
185 | echo '$$r makedep' >>eddep | |
186 | echo 'w' >>eddep | |
187 | cp makefile makefile.bak | |
188 | ed - makefile < eddep | |
189 | rm eddep makedep | |
190 | ||
191 | # DO NOT DELETE THIS LINE | |
192 | ||
3d05654e GM |
193 | telnet.o: ctlr/screen.h general/globals.h telnet.ext ctlr/options.ext |
194 | telnet.o: ctlr/outbound.ext ascii/termin.ext general/general.h | |
59cbe7f2 | 195 | ascii/mset.o: state.h ../general/globals.h map3270.ext |