xref: /original-bsd/usr.bin/tn3270/ascii/makefile (revision b424313c)
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
6# provided that this notice is preserved and that due credit is given
7# to the University of California at Berkeley. The name of the University
8# may not be used to endorse or promote products derived from this
9# software without specific prior written permission. This software
10# is provided ``as is'' without express or implied warranty.
11#
12#	@(#)makefile	3.4 (Berkeley) 05/15/88
13#
14# msdos versus unix defines
15O	= .o
16#PC_O	= .obj
17
18X	=
19#PC_X	= .exe
20
21L	=
22#PC_L	= -link
23
24CC	= cc
25#PC_CC	= cl
26
27MV	= mv
28#PC_MV	= rename
29
30RM	= rm -f
31#PC_RM= erase
32
33LINT_ARGS =
34#PC_LINT_ARGS = -DLINT_ARGS
35
36DEBUG_FLAGS = -g
37#PC_DEBUG_FLAGS = -Zi -Od
38
39AR	= ar
40AR1	= cr
41AR2	=
42AR3	=
43#PC_AR	= lib
44#PC_AR1	=
45#PC_AR2	= +
46#PC_AR3	= ";"
47
48RANLIB	= ranlib
49#PC_RANLIB = echo "Done with "
50
51PRINT	= print
52
53DEFINES = ${LINT_ARGS}
54
55INCLUDES = -I.
56
57OPTIMIZE = -O
58OPTIMIZE = ${DEBUG_FLAGS}
59
60CFLAGS	= $(OPTIMIZE) $(INCLUDES) $(DEFINES)
61
62# Lint flags
63LINTFLAGS	= -hbxaz
64
65KBD	= 3270pc.kbd
66KBD	= unix.kbd
67
68
69# The source files...
70ALLH = map3270.ext state.h termin.ext
71
72ALLC = map3270.c mset.c termin.c
73
74# We don't include mset$O here...
75ALLO	= map3270$O termin$O
76
77
78ALLHC=	${ALLH} ${ALLC}
79ALLPRINT =	default.map ${ALLHC}
80
81ALLSOURCE =	${ALLPRINT} makefile makefile.mak
82
83.s.o:
84	/lib/cpp -E $< | as -o $@
85
86.c.obj:
87	${CC} ${CFLAGS} -c $<
88
89asciilib.a:	$(ALLO)
90	${RM} $@
91	for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done
92	${RANLIB} $@
93
94clean:
95	for i in $(ALLO) errs makefile.bak asciilib.a; \
96		do (${RM} $$i); done
97
98sccsclean:
99	-sccs clean
100	-sccs get makefile
101
102clist:	${ALLC}
103	@for i in ${ALLC} ; \
104		do (echo ${DIRPATH}$$i); done
105
106hclist:	${ALLHC}
107	@for i in ${ALLHC} ; \
108		do (echo ${DIRPATH}$$i); done
109
110sourcelist:	${ALLSOURCE}
111	@for i in ${ALLSOURCE}; \
112		do (echo ${DIRPATH}$$i); done
113
114print:
115	${PRINT} ${ALLPRINT}
116
117tags:	${ALLC} ${ALLH}
118	ctags -t ${ALLC} ${ALLH}
119
120action:
121	${ACTION}
122
123lint:
124	lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${ALLC}
125
126.DEFAULT:
127	sccs get $<
128
129depend:
130	grep '^#include' ${ALLC} | grep -v '<' | \
131	sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
132	    -e 's/\.c/$$O/' | \
133	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
134		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
135		       else rec = rec " " $$2 } } \
136	      END { print rec } ' > makedep
137	echo '$$r makedep' >>eddep
138	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
139	echo '$$r makedep' >>eddep
140	echo 'w' >>eddep
141	-rm -f makefile.bak
142	cp makefile makefile.bak
143	ed - makefile < eddep
144	rm eddep makedep
145
146# DO NOT DELETE THIS LINE
147
148map3270$O: state.h ../general/globals.h map3270.ext default.map
149mset$O: ../ctlr/function.h state.h ../api/astosc.h ../general/globals.h
150mset$O: map3270.ext
151termin$O: ../general/general.h ../ctlr/function.h ../ctlr/inbound.ext
152termin$O: ../ctlr/outbound.ext ../telnet.ext termin.ext ../api/astosc.h state.h
153termin$O: ../general/globals.h
154