| 1 | # msdos versus unix defines |
| 2 | O = .o |
| 3 | #PC_O = .obj |
| 4 | |
| 5 | X = |
| 6 | #PC_X = .exe |
| 7 | |
| 8 | L = |
| 9 | #PC_L = -link |
| 10 | |
| 11 | CC = cc |
| 12 | #PC_CC = cl |
| 13 | |
| 14 | MV = mv |
| 15 | #PC_MV = rename |
| 16 | |
| 17 | RM = rm -f |
| 18 | #PC_RM= erase |
| 19 | |
| 20 | LINT_ARGS = |
| 21 | #PC_LINT_ARGS = -DLINT_ARGS |
| 22 | |
| 23 | DEBUG_FLAGS = -g |
| 24 | #PC_DEBUG_FLAGS = -Zi -Od |
| 25 | |
| 26 | AR = ar |
| 27 | AR1 = cr |
| 28 | AR2 = |
| 29 | AR3 = |
| 30 | #PC_AR = lib |
| 31 | #PC_AR1 = |
| 32 | #PC_AR2 = + |
| 33 | #PC_AR3 = ";" |
| 34 | |
| 35 | RANLIB = ranlib |
| 36 | #PC_RANLIB = echo "Done with " |
| 37 | |
| 38 | PRINT = print |
| 39 | |
| 40 | DEFINES = ${LINT_ARGS} |
| 41 | |
| 42 | INCLUDES = -I. |
| 43 | |
| 44 | OPTIMIZE = -O |
| 45 | OPTIMIZE = ${DEBUG_FLAGS} |
| 46 | |
| 47 | CFLAGS = $(OPTIMIZE) $(INCLUDES) $(DEFINES) |
| 48 | |
| 49 | # Lint flags |
| 50 | LINTFLAGS = -hbxaz |
| 51 | # How to install the bloody thing... |
| 52 | |
| 53 | DESTDIR= |
| 54 | |
| 55 | BINDIR = $(DESTDIR)/usr/ucb |
| 56 | ETCDIR = $(DESTDIR)/etc |
| 57 | MANDIR = $(DESTDIR)/usr/man/man |
| 58 | |
| 59 | # Names for the terminal libraries... |
| 60 | LIBCURSES = -lcurses |
| 61 | LIBTERM = -ltermlib |
| 62 | |
| 63 | # The source files... |
| 64 | ALLH = bsubs.ext general.h globals.h |
| 65 | |
| 66 | ALLC = globals.c |
| 67 | |
| 68 | # |
| 69 | # In a vax environment, we use vaxbsubs.s, which gives us a fair amount |
| 70 | # of increased performance. We have provided genbsubs.c, which perform |
| 71 | # (more or less) the same function. |
| 72 | SUBS = vaxbsubs.s |
| 73 | SUBS = genbsubs.c |
| 74 | |
| 75 | SUBSO = vaxbsubs$O |
| 76 | SUBSO = genbsubs$O |
| 77 | |
| 78 | ALLS = vaxbsubs.s |
| 79 | |
| 80 | ALLPRINT = ${ALLH} ${ALLC} vaxbsubs.s genbsubs.c |
| 81 | |
| 82 | ALLSOURCE = ${ALLPRINT} makefile makefile.mak |
| 83 | |
| 84 | ALLS = |
| 85 | |
| 86 | ALLO = globals$O ${SUBSO} |
| 87 | |
| 88 | .s.o: |
| 89 | /lib/cpp -E $< | as -o $@ |
| 90 | |
| 91 | .c.obj: |
| 92 | ${CC} ${CFLAGS} -c $< |
| 93 | |
| 94 | generallib.a: ${ALLO} |
| 95 | ${RM} $@ |
| 96 | for i in ${ALLO}; do (${AR} ${AR1} $@ ${AR2} $$i${AR3}); done |
| 97 | ${RANLIB} $@ |
| 98 | |
| 99 | clean: |
| 100 | for i in $(ALLO) errs makefile.bak generallib.a; \ |
| 101 | do (${RM} $$i); done |
| 102 | |
| 103 | sccsclean: |
| 104 | -sccs clean |
| 105 | -sccs get makefile |
| 106 | |
| 107 | sourcelist: ${ALLSOURCE} |
| 108 | @for i in ${ALLSOURCE}; \ |
| 109 | do (echo ${DIRPATH}$$i); done |
| 110 | |
| 111 | print: |
| 112 | ${PRINT} ${ALLPRINT} |
| 113 | |
| 114 | tags: ${ALLC} ${ALLH} |
| 115 | ctags -t ${ALLC} ${ALLH} |
| 116 | |
| 117 | action: |
| 118 | ${ACTION} |
| 119 | |
| 120 | lint: |
| 121 | lint ${LINTFLAGS} ${INCLUDES} ${DEFINES} ${ALLC} |
| 122 | |
| 123 | .DEFAULT: |
| 124 | sccs get $< |
| 125 | |
| 126 | depend: |
| 127 | grep '^#include' ${ALLC} ${ALLH} | 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 | |
| 145 | globals$O: ../ctlr/hostctlr.h ../ctlr/oia.h ../ctlr/options.h ../ctlr/screen.h |
| 146 | globals$O: globals.h ../general/general.h |