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 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. 16# 17# @(#)makefile 4.3 (Berkeley) 06/21/90 18# 19DEBUG_FLAGS = -g 20 21CFLAGS = -I obj ${DEBUG_FLAGS} 22 23PRINT = lpr -p 24 25KBD = 3270pc.kbd 26KBD = unix.kbd 27 28ALLC = apilib.c api_bsd.c api_exch.c asc_ebc.c astosc.c dctype.c \ 29 disp_asc.c ebc_disp.c 30 31ALLH = apilib.h api_exch.h asc_ebc.h astosc.h disp_asc.h dctype.h ebc_disp.h 32 33 34ALLHC= ${ALLH} ${ALLC} 35ALLPRINT = ${ALLHC} 36 37ALLSOURCE = ${ALLPRINT} makefile makefile.mak 38 39ALLO = apilib.o api_bsd.o api_exch.o astosc.o asc_ebc.o dctype.o \ 40 disp_asc.o ebc_disp.o 41 42#.c.obj: 43# ${CC} ${CFLAGS} -c $< 44 45apilib.a: ${ALLO} 46 -rm $@ 47 ${AR} ${ARFLAGS} $@ ${ALLO} 48 ${RANLIB} $@ 49 50.DEFAULT: 51 sccs get $< 52 53clean: 54 -rm ${ALLO} errs apilib.a makefile.bak \ 55 disp_out asc_disp.out astosc.out disp_asc.out \ 56 astosc.OUT disp_asc.OUT \ 57 test* test.o t1* t1.o t2* t2.o 58 59sccsclean: 60 -sccs clean 61 -sccs get makefile 62 63action: 64 ${ACTION} 65 66test: apilib.a test.o 67 ${CC} ${CFLAGS} -o $@ test.o apilib.a 68 69t1: apilib.a t1.o 70 ${CC} ${CFLAGS} -o $@ t1.o apilib.a 71 72t2: apilib.a t2.o 73 ${CC} ${CFLAGS} -o $@ t2.o apilib.a 74 75print: 76 ${PRINT} ${ALLPRINT} 77 78clist: ${ALLC} 79 @for i in ${ALLC} ; \ 80 do (echo ${DIRPATH}$$i); done 81 82hclist: ${ALLHC} 83 @for i in ${ALLHC} ; \ 84 do (echo ${DIRPATH}$$i); done 85 86sourcelist: ${ALLSOURCE} 87 @for i in ${ALLSOURCE}; \ 88 do (echo ${DIRPATH}$$i); done 89 90astosc.OUT: ../ctlr/function.h ../ctlr/hostctlr.h ../ctlr/$(KBD) 91 (cd ${.CURDIR}/../tools; make mkastosc ) 92 -rm $@ astosc.out 93 ../tools/mkastosc ${.CURDIR}/../ctlr/hostctlr.h \ 94 ${.CURDIR}/../ctlr/function.h < \ 95 ${.CURDIR}/../ctlr/$(KBD) > $@ 96 ln $@ astosc.out 97 98asc_disp.out: ebc_disp.o 99 (cd ${.CURDIR}/../tools; make mkastods ) 100 -rm $@ 101 ../tools/mkastods > $@ 102 103disp_asc.OUT: ebc_disp.o 104 (cd ${.CURDIR}/../tools; make mkdstoas ) 105 -rm $@ disp_asc.out 106 ../tools/mkdstoas > $@ 107 ln $@ disp_asc.out 108 109depend: 110 grep '^#include' ${ALLC} | grep -v '<' | \ 111 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ 112 -e 's/\.c/$.o/' | \ 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 121 -rm -f makefile.bak 122 cp makefile makefile.bak 123 ed - makefile < eddep 124 -rm eddep makedep 125 126# DO NOT DELETE THIS LINE 127 128apilib.o: ../ctlr/api.h apilib.h 129api_bsd.o: ../ctlr/api.h api_exch.h 130api_exch.o: ../general/general.h api_exch.h 131asc_ebc.o: asc_ebc.h 132astosc.o: ../general/general.h ../ctlr/function.h astosc.h astosc.OUT 133dctype.o: dctype.h 134disp_asc.o: disp_asc.h asc_disp.out disp_asc.OUT 135