Commit | Line | Data |
---|---|---|
ee01fcaa 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 | |
16b6eaa3 KB |
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. | |
ee01fcaa | 16 | # |
e3419641 | 17 | # @(#)makefile 4.1 (Berkeley) 12/4/88 |
ee01fcaa | 18 | # |
dd6c8c3e GM |
19 | # msdos versus unix defines |
20 | O = .o | |
08eb9544 | 21 | #PC_O = .obj |
dd6c8c3e GM |
22 | |
23 | X = | |
08eb9544 GM |
24 | #PC_X = .exe |
25 | ||
26 | L = | |
27 | #PC_L = -link | |
dd6c8c3e | 28 | |
98607a89 | 29 | CC = cc |
08eb9544 | 30 | #PC_CC = cl |
dd6c8c3e GM |
31 | |
32 | MV = mv | |
08eb9544 | 33 | #PC_MV = rename |
dd6c8c3e GM |
34 | |
35 | RM = rm -f | |
08eb9544 | 36 | #PC_RM= erase |
dd6c8c3e GM |
37 | |
38 | LINT_ARGS = | |
08eb9544 | 39 | #PC_LINT_ARGS = -DLINT_ARGS |
dd6c8c3e GM |
40 | |
41 | DEBUG_FLAGS = -g | |
08eb9544 | 42 | #PC_DEBUG_FLAGS = -Zi -Od |
dd6c8c3e GM |
43 | |
44 | AR = ar | |
08eb9544 GM |
45 | AR1 = cr |
46 | AR2 = | |
47 | AR3 = | |
48 | #PC_AR = lib | |
49 | #PC_AR1 = | |
50 | #PC_AR2 = + | |
51 | #PC_AR3 = ";" | |
dd6c8c3e GM |
52 | |
53 | RANLIB = ranlib | |
08eb9544 | 54 | #PC_RANLIB = echo "Done with " |
dd6c8c3e | 55 | |
98607a89 GM |
56 | PRINT = print |
57 | ||
dd6c8c3e | 58 | DEFINES = ${LINT_ARGS} |
98607a89 GM |
59 | |
60 | INCLUDES = -I. | |
61 | ||
62 | OPTIMIZE = -O | |
dd6c8c3e | 63 | OPTIMIZE = ${DEBUG_FLAGS} |
98607a89 GM |
64 | |
65 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) | |
66 | ||
67 | # Lint flags | |
68 | LINTFLAGS = -hbxaz | |
25dbbecd GM |
69 | |
70 | # Which keyboard are we emulating. | |
71 | KBD = 3180.kbd | |
72 | KBD = 3270pc.kbd | |
73 | KBD = unix.kbd | |
98607a89 GM |
74 | |
75 | # The source files... | |
c90e19e7 GM |
76 | ALLH = api.h declare.h externs.h function.h hostctlr.h oia.h \ |
77 | options.h screen.h scrnctlr.h | |
98607a89 | 78 | |
4718d085 | 79 | ALLC = api.c function.c inbound.c oia.c options.c outbound.c |
98607a89 | 80 | |
ddc8d584 | 81 | # Note: NO function.o! |
4718d085 | 82 | ALLO = api$O inbound$O oia$O options$O outbound$O |
98607a89 | 83 | |
73f6a95a | 84 | ALLHC= ${ALLH} ${ALLC} |
11d997a6 | 85 | ALLPRINT = 3180.kbd 3270pc.kbd unix.kbd ${ALLHC} |
4377cf8d GM |
86 | |
87 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak | |
88 | ||
98607a89 GM |
89 | .s.o: |
90 | /lib/cpp -E $< | as -o $@ | |
91 | ||
dd6c8c3e GM |
92 | .c.obj: |
93 | ${CC} ${CFLAGS} -c $< | |
94 | ||
62c6784b | 95 | ctlrlib.a: ${ALLO} |
dd6c8c3e | 96 | ${RM} $@ |
08eb9544 | 97 | for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done |
dd6c8c3e | 98 | ${RANLIB} $@ |
98607a89 GM |
99 | |
100 | clean: | |
dd6c8c3e | 101 | for i in $(ALLO) mset tn3270 prt3270 m4.out errs \ |
08eb9544 | 102 | makefile.bak ctlrlib.a kbd.out TMPfunc.out; \ |
dd6c8c3e GM |
103 | do (${RM} $$i); done |
104 | ||
105 | sccsclean: | |
62c6784b GM |
106 | -sccs clean |
107 | -sccs get makefile | |
98607a89 | 108 | |
73f6a95a GM |
109 | clist: ${ALLC} |
110 | @for i in ${ALLC} ; \ | |
111 | do (echo ${DIRPATH}$$i); done | |
112 | ||
113 | hclist: ${ALLHC} | |
114 | @for i in ${ALLHC} ; \ | |
115 | do (echo ${DIRPATH}$$i); done | |
116 | ||
4377cf8d GM |
117 | sourcelist: ${ALLSOURCE} |
118 | @for i in ${ALLSOURCE}; \ | |
62c6784b | 119 | do (echo ${DIRPATH}$$i); done |
4377cf8d | 120 | |
98607a89 | 121 | print: |
4377cf8d | 122 | ${PRINT} ${ALLPRINT} |
98607a89 GM |
123 | |
124 | tags: ${ALLC} ${ALLH} | |
125 | ctags -t ${ALLC} ${ALLH} | |
126 | ||
74db0140 GM |
127 | action: |
128 | ${ACTION} | |
129 | ||
98607a89 | 130 | lint: |
09bc415f | 131 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 ${ALLC} -lcurses |
98607a89 GM |
132 | |
133 | .DEFAULT: | |
134 | sccs get $< | |
135 | ||
25dbbecd | 136 | kbd.out: $(KBD) hostctlr.h |
05996d8b | 137 | (cd ../tools; make mkhits$X ) |
08eb9544 | 138 | ${RM} $@ TMPfunc.out |
ddc8d584 | 139 | $(CC) $(CFLAGS) -E function.c > TMPfunc.out |
25dbbecd | 140 | ../tools/mkhits - ../ctlr/TMPfunc.out < $(KBD) > $@ |
08eb9544 | 141 | ${RM} TMPfunc.out |
98607a89 GM |
142 | |
143 | depend: | |
144 | grep '^#include' ${ALLC} | grep -v '<' | \ | |
145 | sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
dd6c8c3e | 146 | -e 's/\.c/$$O/' | \ |
98607a89 GM |
147 | awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ |
148 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
149 | else rec = rec " " $$2 } } \ | |
150 | END { print rec } ' > makedep | |
151 | echo '$$r makedep' >>eddep | |
152 | echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep | |
153 | echo '$$r makedep' >>eddep | |
154 | echo 'w' >>eddep | |
dd6c8c3e | 155 | -rm -f makefile.bak |
98607a89 GM |
156 | cp makefile makefile.bak |
157 | ed - makefile < eddep | |
158 | rm eddep makedep | |
159 | ||
160 | # DO NOT DELETE THIS LINE | |
161 | ||
4718d085 GM |
162 | api$O: api.h ../general/general.h ../api/disp_asc.h screen.h oia.h |
163 | api$O: ../general/globals.h | |
164 | function$O: function.h | |
dd6c8c3e | 165 | inbound$O: ../general/general.h function.h hostctlr.h oia.h scrnctlr.h screen.h |
4718d085 | 166 | inbound$O: options.h ../api/dctype.h ../api/ebc_disp.h ../general/globals.h |
c90e19e7 | 167 | inbound$O: externs.h declare.h kbd.out |
dd6c8c3e | 168 | oia$O: ../general/general.h oia.h ../general/globals.h |
c90e19e7 | 169 | options$O: options.h ../general/globals.h declare.h |
4718d085 | 170 | outbound$O: ../general/general.h hostctlr.h oia.h screen.h ../api/ebc_disp.h |
c90e19e7 | 171 | outbound$O: ../general/globals.h externs.h declare.h |