Makefile.base 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .SUFFIXES: .c .o .s .E
  2. #
  3. # Need to include from the current directory because "qt.h"
  4. # will include <qtmd.h>.
  5. #
  6. CFLAGS = -I. -g
  7. #
  8. # Fix this to be something meaningful for your system.
  9. #
  10. DEST = /dev/null
  11. DOC = users.tout
  12. EXTHDRS = /usr/include/stdio.h
  13. HDRS = qt.h \
  14. qtmd.h \
  15. stp.h
  16. LDFLAGS = $(CFLAGS)
  17. EXTLIBS =
  18. LIBS = libstp.a libqt.a
  19. LINKER = $(CC)
  20. MAKEFILE = Makefile
  21. M = Makefile configuration
  22. OBJS = qtmdb.o \
  23. meas.o
  24. QTOBJS = qt.o qtmds.o qtmdc.o
  25. STPOBJS = stp.o
  26. PR = -Pps
  27. PRINT = pr
  28. PROGRAM = run
  29. SRCS = meas.c \
  30. qt.c \
  31. qtmdc.c \
  32. qtmds.s \
  33. qtmdb.s
  34. TMP_INIT = tmp.init
  35. TMP_SWAP = tmp.swap
  36. .DEFAULT:
  37. co -q $@
  38. .c.E: force
  39. $(CC) $(CFLAGS) -E $*.c > $*.E
  40. all: libqt.a libstp.a $(PROGRAM) $(M)
  41. libqt.a: $(QTOBJS) $(M)
  42. ar crv libqt.a $(QTOBJS)
  43. ranlib libqt.a
  44. libstp.a: $(STPOBJS) $(M)
  45. ar crv libstp.a $(STPOBJS)
  46. ranlib libstp.a
  47. $(PROGRAM): $(OBJS) $(LIBS) $(M)
  48. @echo "Loading $(PROGRAM) ... "
  49. # ld -o $(PROGRAM) /lib/crt0.o $(OBJS) -lc
  50. $(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) $(EXTLIBS) -o $(PROGRAM)
  51. @echo "done"
  52. clean:
  53. rm -f $(OBJS) $(PROGRAM) $(TMP_INIT) $(TMP_SWAP) $(DOC)
  54. rm -f libqt.a libstp.a
  55. rm -f $(QTOBJS) $(STPOBJS)
  56. depend:; @mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
  57. doc: users.ms raw
  58. time/assim < raw | grep "^init" | sed 's/^init //' > $(TMP_INIT)
  59. time/assim < raw | grep "^swap" | sed 's/^swap //' > $(TMP_SWAP)
  60. soelim users.ms | tbl $(PR) | troff -t $(PR) -ms > $(DOC)
  61. index:; @ctags -wx $(HDRS) $(SRCS)
  62. print:; @$(PRINT) $(HDRS) $(SRCS)
  63. program: $(PROGRAM)
  64. tags: $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
  65. update: $(DEST)/$(PROGRAM)
  66. $(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
  67. @make -f $(MAKEFILE) DEST=$(DEST) install
  68. QT_H = qt.h $(QTMD_H)
  69. QTMD_H = qtmd.h
  70. ###
  71. qtmdb.o: $(M) qtmdb.s b.h
  72. meas.o: $(M) meas.c /usr/include/stdio.h $(QT_H) b.h stp.h
  73. qt.o: $(M) qt.c $(QT_H)
  74. stp.o: $(M) stp.c stp.h $(QT_H)
  75. qtmds.o: $(M) qtmds.s
  76. qtmdc.o: $(M) qtmdc.c $(QT_H)