Add in PC stuff.
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / makefile
CommitLineData
dd6c8c3e
GM
1# msdos versus unix defines
2O = .o
3PC_O = .obj
4
5X =
6PC_X = .exe
7
98607a89 8CC = cc
dd6c8c3e
GM
9PC_CC = cl
10
11MV = mv
12PC_MV = rename
13
14RM = rm -f
15PC_RM= erase
16
17LINT_ARGS =
18PC_LINT_ARGS = -DLINT_ARGS
19
20DEBUG_FLAGS = -g
21PC_DEBUG_FLAGS = -Zi -Od
22
23AR = ar
24C =
25PC_AR = lib
26PC_C = +
27
28RANLIB = ranlib
29PC_RANLIB = echo "Done with "
30
98607a89
GM
31PRINT = print
32
dd6c8c3e 33DEFINES = ${LINT_ARGS}
98607a89
GM
34
35INCLUDES = -I.
36
37OPTIMIZE = -O
dd6c8c3e 38OPTIMIZE = ${DEBUG_FLAGS}
98607a89
GM
39
40CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES)
41
42# Lint flags
43LINTFLAGS = -hbxaz
25dbbecd
GM
44
45# Which keyboard are we emulating.
46KBD = 3180.kbd
47KBD = 3270pc.kbd
48KBD = unix.kbd
98607a89
GM
49
50# The source files...
62c6784b 51ALLH = function.h hostctlr.h inbound.ext oia.h \
4377cf8d 52 options.ext options.h outbound.ext screen.h scrnctlr.h
98607a89 53
62c6784b 54ALLC = inbound.c oia.c options.c outbound.c
98607a89 55
dd6c8c3e 56ALLO = inbound$O oia$O options$O outbound$O
98607a89 57
4377cf8d
GM
58ALLPRINT = 3180.kbd 3270pc.kbd unix.kbd ${ALLH} ${ALLC}
59
60ALLSOURCE = ${ALLPRINT} makefile makefile.mak
61
98607a89
GM
62.s.o:
63 /lib/cpp -E $< | as -o $@
64
dd6c8c3e
GM
65.c.obj:
66 ${CC} ${CFLAGS} -c $<
67
62c6784b 68ctlrlib.a: ${ALLO}
dd6c8c3e
GM
69 ${RM} $@
70 for i in ${ALLO}; do (${AR} cr $@ $C $$i); done
71 ${RANLIB} $@
98607a89
GM
72
73clean:
dd6c8c3e
GM
74 for i in $(ALLO) mset tn3270 prt3270 m4.out errs \
75 makefile.bak ctlrlib.a kbd.out TMPfunc.out TMPfunc.c; \
76 do (${RM} $$i); done
77
78sccsclean:
62c6784b
GM
79 -sccs clean
80 -sccs get makefile
98607a89 81
4377cf8d
GM
82sourcelist: ${ALLSOURCE}
83 @for i in ${ALLSOURCE}; \
62c6784b 84 do (echo ${DIRPATH}$$i); done
4377cf8d 85
98607a89 86print:
4377cf8d 87 ${PRINT} ${ALLPRINT}
98607a89
GM
88
89tags: ${ALLC} ${ALLH}
90 ctags -t ${ALLC} ${ALLH}
91
74db0140
GM
92action:
93 ${ACTION}
94
98607a89 95lint:
09bc415f 96 lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} -DTN3270 ${ALLC} -lcurses
98607a89
GM
97
98.DEFAULT:
99 sccs get $<
100
25dbbecd 101kbd.out: $(KBD) hostctlr.h
dd6c8c3e
GM
102 (cd ../tools; make mkhits )
103 ${RM} $@ TMPfunc.out TMPfunc.c
d269ca43 104 /bin/echo \#include \"function.h\" > TMPfunc.c
25dbbecd
GM
105 $(CC) $(CFLAGS) -E TMPfunc.c > TMPfunc.out
106 ../tools/mkhits - ../ctlr/TMPfunc.out < $(KBD) > $@
dd6c8c3e 107 ${RM} TMPfunc.out TMPfunc.c
98607a89
GM
108
109depend:
110 grep '^#include' ${ALLC} | grep -v '<' | \
111 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
dd6c8c3e 112 -e 's/\.c/$$O/' | \
98607a89
GM
113 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
114 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
115 else rec = rec " " $$2 } } \
116 END { print rec } ' > makedep
117 echo '$$r makedep' >>eddep
118 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
119 echo '$$r makedep' >>eddep
120 echo 'w' >>eddep
dd6c8c3e 121 -rm -f makefile.bak
98607a89
GM
122 cp makefile makefile.bak
123 ed - makefile < eddep
124 rm eddep makedep
125
126# DO NOT DELETE THIS LINE
127
dd6c8c3e
GM
128inbound$O: ../general/general.h function.h hostctlr.h oia.h scrnctlr.h screen.h
129inbound$O: options.h ../apilib/dctype.h ../apilib/ebc_disp.h
130inbound$O: ../general/globals.h inbound.ext outbound.ext ../telnet.ext kbd.out
131oia$O: ../general/general.h oia.h ../general/globals.h
132options$O: options.h ../general/globals.h options.ext
133outbound$O: ../general/general.h hostctlr.h oia.h screen.h ../apilib/ebc_disp.h
134outbound$O: ../general/globals.h options.ext ../telnet.ext inbound.ext
135outbound$O: outbound.ext ../general/bsubs.ext