home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / tn3270 / ctlr / makefile < prev    next >
Encoding:
Makefile  |  1991-05-08  |  3.1 KB  |  157 lines

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