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.2 (Berkeley) 03/28/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 51CFLAGS = ${DEBUG_FLAGS} 52 53PRINT = lpr -p 54 55KBD = 3270pc.kbd 56KBD = unix.kbd 57 58ALLC = apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c \ 59 disp_asc.c ebc_disp.c 60 61ALLH = apilib.h api_exch.h asc_ebc.h astosc.h disp_asc.h dctype.h ebc_disp.h 62 63ALLPRINT = ${ALLH} ${ALLC} 64 65ALLSOURCE = ${ALLPRINT} makefile makefile.mak 66 67ALLO = apilib$O api_bsd$O api_exch$O astosc$O asc_ebc$O dctype$O \ 68 disp_asc$O ebc_disp$O 69 70.c.obj: 71 ${CC} ${CFLAGS} -c $< 72 73apilib.a: ${ALLO} 74 ${RM} $@ 75 for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done 76 ${RANLIB} $@ 77 78.DEFAULT: 79 sccs get $< 80 81clean: 82 for i in ${ALLO} errs apilib.a makefile.bak \ 83 disp_out asc_disp.out astosc.out disp_asc.out \ 84 test* test$O t1* t1$O t2* t2$O; \ 85 do (${RM} $$i); done 86 87sccsclean: 88 -sccs clean 89 -sccs get makefile 90 91action: 92 ${ACTION} 93 94test: apilib.a test$O 95 ${CC} ${CFLAGS} -o $@ test$O apilib.a 96 97t1: apilib.a t1$O 98 ${CC} ${CFLAGS} -o $@ t1$O apilib.a 99 100t2: apilib.a t2$O 101 ${CC} ${CFLAGS} -o $@ t2$O apilib.a 102 103print: 104 ${PRINT} ${ALLPRINT} 105 106 107sourcelist: ${ALLSOURCE} 108 @for i in ${ALLSOURCE}; \ 109 do (echo ${DIRPATH}$$i); done 110 111astosc.out: ../ctlr/function.h ../ctlr/hostctlr.h ../ctlr/$(KBD) 112 (cd ../tools; make mkastosc$X ) 113 ${RM} $@ 114 ../tools/mkastosc < ../ctlr/$(KBD) > $@ 115 116asc_disp.out: ebc_disp$O 117 (cd ../tools; make mkastods$X ) 118 ${RM} $@ 119 ../tools/mkastods > $@ 120 121disp_asc.out: ebc_disp$O 122 (cd ../tools; make mkdstoas$X ) 123 ${RM} $@ 124 ../tools/mkdstoas > $@ 125 126depend: 127 grep '^#include' ${ALLC} | grep -v '<' | \ 128 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ 129 -e 's/\.c/$$O/' | \ 130 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ 131 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ 132 else rec = rec " " $$2 } } \ 133 END { print rec } ' > makedep 134 echo '$$r makedep' >>eddep 135 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep 136 echo '$$r makedep' >>eddep 137 echo 'w' >>eddep 138 -rm -f makefile.bak 139 cp makefile makefile.bak 140 ed - makefile < eddep 141 rm eddep makedep 142 143# DO NOT DELETE THIS LINE 144 145apilib$O: ../ctlr/api.h apilib.h 146api_bsd$O: ../ctlr/api.h api_exch.h 147api_exch$O: ../general/general.h api_exch.h 148asc_ebc$O: asc_ebc.h 149astosc$O: ../general/general.h ../ctlr/function.h astosc.h astosc.out 150dctype$O: dctype.h 151disp_asc$O: disp_asc.h asc_disp.out disp_asc.out 152