You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
1.8 KiB

  1. # $Id: Makefile,v 1.2 1994/10/03 23:30:34 fabio Exp fabio $
  2. #
  3. # mtr - multiway-branching tree package
  4. #---------------------------
  5. .SUFFIXES: .o .c .u
  6. CC = cc
  7. RANLIB = ranlib
  8. PURE =
  9. # Define EXE as .exe for MS-DOS and derivatives.
  10. EXE =
  11. #EXE = .exe
  12. MFLAG =
  13. ICFLAGS = -g
  14. CFLAGS = $(ICFLAGS) $(MFLAG) $(XCFLAGS)
  15. MTRDEBUG = -DMTR_STATS -DMTR_VERBOSE -DMTR_DEBUG
  16. LINTFLAGS = -u -n -DMTR_STATS -DMTR_VERBOSE -DMTR_DEBUG
  17. # this is to create the lint library
  18. LINTSWITCH = -o
  19. LDFLAGS =
  20. WHERE = ..
  21. INCLUDE = $(WHERE)/include
  22. P = mtr
  23. PSRC = mtrBasic.c mtrGroup.c
  24. PHDR = mtr.h
  25. POBJ = $(PSRC:.c=.o)
  26. PUBJ = $(PSRC:.c=.u)
  27. SRC = test$(P).c
  28. HDR =
  29. OBJ = $(SRC:.c=.o)
  30. UBJ = $(SRC:.c=.u)
  31. TARGET = test$(P)$(EXE)
  32. TARGETu = test$(P)-u
  33. LIBS = ./libmtr.a $(WHERE)/util/libutil.a
  34. BLIBS = -kL. -klmtr -kL$(WHERE)/util -klutil
  35. MNEMLIB =
  36. LINTLIBS = llib-l$(P).ln
  37. #---------------------------
  38. lib$(P).a: $(POBJ)
  39. ar rv $@ $?
  40. $(RANLIB) $@
  41. .c.o: $(PSRC) $(PHDR)
  42. $(CC) -c $< -I$(INCLUDE) $(CFLAGS) $(MTRDEBUG)
  43. optimize_dec: lib$(P).b
  44. lib$(P).b: $(PUBJ)
  45. ar rv $@ $?
  46. $(RANLIB) $@
  47. .c.u: $(PSRC) $(PHDR)
  48. cc -j $< -I$(INCLUDE) $(XCFLAGS)
  49. # if the header files change, recompile
  50. $(POBJ): $(PHDR)
  51. $(PUBJ): $(PHDR)
  52. $(OBJ): $(PHDR)
  53. $(UBJ): $(PHDR)
  54. lint: llib-l$(P).ln
  55. llib-l$(P).ln: $(PSRC) $(PHDR)
  56. lint $(LINTFLAGS) $(LINTSWITCH)$(P) -I$(INCLUDE) $(PSRC)
  57. tags: $(PSRC) $(PHDR)
  58. ctags $(PSRC) $(PHDR)
  59. all: lib$(P).a lib$(P).b llib-l$(P).ln tags
  60. $(TARGET): $(POBJ) $(OBJ) $(LIBS) $(MNEMLIB)
  61. $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm
  62. $(TARGETu): $(SRC) $(PSRC) $(PHDR) $(UBJ) $(PUBJ) $(LIBS:.a=.b)
  63. cc -O3 $(XCFLAGS) $(LDFLAGS) -o $@ $(UBJ) $(BLIBS) -lm
  64. clean:
  65. rm -f *.o *.u mon.out gmon.out *.pixie *.Addrs *.Counts mnem.* \
  66. .pure core *.warnings
  67. distclean: clean
  68. rm -f $(TARGET) $(TARGETu) lib*.a lib$(P).b llib-l$(P).ln \
  69. *.bak *~ tags *.qv *.qx