home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / pathalias9 / part01 / make.honey < prev    next >
Encoding:
Text File  |  1987-10-08  |  2.8 KB  |  116 lines

  1. #!/bin/make -f
  2. # pathalias -- by steve bellovin, as told to peter honeyman
  3.  
  4. ### configuration section
  5. ###
  6. # if you can't or don't intend to use dbm files,
  7. # don't bother with DBM or makedb
  8. DBM = -ldbm
  9. # or if you roll your own ...
  10. # DBM = dbm.o
  11. ###
  12. # where is getopt (if not in the c library)?
  13. # GETOPT = -lgetopt
  14. ### end of configuration section 
  15.  
  16. CC = cc -g
  17. CFLAGS =  -DSTATIC=extern -DDEBUG
  18. LDFLAGS =
  19. YFLAGS = -d
  20.  
  21. OBJ = addlink.o addnode.o local.o main.o mapit.o mapaux.o mem.o parse.o printit.o
  22. OFILES = addlink.O addnode.O local.O main.O mapit.O mapaux.O mem.O parse.O printit.O
  23. HDRS = def.h config.h
  24. CSRC = addlink.c addnode.c local.c main.c mapit.c mapaux.c mem.c printit.c
  25. LSRC = $(CSRC) parse.c
  26. SRC = $(CSRC) parse.y makedb.c arpatxt.c
  27.  
  28. pathalias: $(OBJ)
  29.     $(CC) $(OBJ) $(LDFLAGS) -o pathalias
  30.  
  31. all: pathalias makedb arpatxt
  32.  
  33. $(OBJ):    $(HDRS)
  34.  
  35. parse.c: parse.y $(HDRS)
  36.     $(YACC) $(YFLAGS) parse.y
  37.     sed '/^# line/d' y.tab.c > parse.c
  38.  
  39. makedb: makedb.o
  40.     $(CC) makedb.o $(LDFLAGS) $(DBM) -o makedb
  41.  
  42. makedb.o: config.h
  43.  
  44. arpatxt: arpatxt.o
  45.     $(CC) arpatxt.o $(LDFLAGS) -o arpatxt
  46.  
  47. clean:
  48.     rm -f *.o y.tab.? parse.c
  49.  
  50. tags: $(SRC) $(HDRS)
  51.     ctags -w $(SRC) $(HDRS)
  52.  
  53. bundle: README CHANGES pathalias.1 Makefile ${HDRS} ${SRC} arpa-privates make.honey
  54.     @bundle README CHANGES pathalias.1 Makefile ${HDRS} ${SRC} arpa-privates make.honey
  55.  
  56. bundle1: README CHANGES pathalias.1 Makefile ${HDRS}
  57.     @bundle README CHANGES pathalias.1 Makefile ${HDRS}
  58.  
  59. bundle2: addlink.c addnode.c local.c main.c
  60.     @bundle addlink.c addnode.c local.c main.c
  61.  
  62. bundle3: mapit.c mapaux.c
  63.     @bundle mapit.c mapaux.c
  64.  
  65. bundle4: mem.c printit.c parse.y
  66.     @bundle mem.c printit.c parse.y makedb.c
  67.  
  68. bundle5: makedb.c arpatxt.c arpa-privates make.honey
  69.     @bundle  makedb.c arpatxt.c arpa-privates make.honey
  70.  
  71. make.honey: makefile
  72.     @cp makefile make.honey
  73.  
  74. lint:    $(LSRC)
  75.     lint -hbau $(CFLAGS) $(LSRC)
  76.     lint makedb.c
  77.  
  78.  
  79. # the remainder is site specific.
  80.  
  81. PATHFILES = paths/* pp/* pm/*
  82.  
  83. paths/internet: hosts.txt arpa-privates local.hosts
  84.     arpatxt -fi -g citi -g umix -p arpa-privates local.hosts hosts.txt > paths/internet
  85.  
  86. AVOID =
  87.  
  88. # map output (input, really) to lower case; verbose; terminal domains
  89. ARGS = -viD
  90.  
  91. PARGS=$(ARGS) $(AVOID) $(PATHFILES)
  92. dwon:    paths/local paths/internet
  93.     pathalias -l dwon $(PARGS) 2>ERRORS | sort -o dwon
  94.  
  95. # desperation debugging -- examine the costs.
  96. costs:
  97.     pathalias -icvvD ${PARGS} 2>error.costs | awk '{printf("%s\t%s\t%s\n", $$2, $$1, $$3)}' | sort -o pa.costs 
  98.  
  99. # make one BIG file.  a BIG bad idea.
  100. cat:
  101.     for i in $(PATHFILES); do cat $$i; echo 'private {}'; done > CAT
  102.  
  103. # make a pathparse database.  -g is undocumented.
  104. edges:
  105.     pathalias -g edges $(PARGS) 2>ERRORS > edges.hosts
  106. #    makedb edges pa
  107.  
  108. umich:
  109.     pathalias -l umich $(PARGS) 2>umich.ERRORS | sort > umich
  110.  
  111. citi:    paths/local paths/internet
  112.     pathalias -l citi $(PARGS) 2>citi.ERRORS | sort > citi
  113.  
  114. umix:
  115.     pathalias -l umix $(PARGS) 2>umix.ERRORS | sort > umix
  116.