home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume1 / fortune / part01 / Makefile < prev    next >
Makefile  |  1987-05-26  |  3KB  |  131 lines

  1. # $Header: Makefile,v 1.3 86/09/16 17:27:19 arnold Exp $
  2. #
  3. # Makefile for "fortune" program.  See READ_ME for details.
  4. #
  5. FORTUNES=    scene obscene
  6. CFILES=        fortune.c strfile.h strfile.c rnd.c unstr.c
  7. SOURCE=        $(CFILES) $(FORTUNES)
  8. TFILES=        Troff.mac Troff.sed Do_troff
  9. SFILES=        scene.sp.ok obscene.sp.ok
  10. MISC=        READ_ME fortune.6 strfile.8 Makefile Notes Rot13 Shar_split :trfix
  11. LIBDIR=        /usr/games/lib
  12. BINDIR=        /usr/games
  13. USER=        daemon            # owner of fortune system
  14. DEFS=                    # BSD systems
  15. #DEFS=        -DNO_RANDOM -DREGCMP    # System V systems
  16. CFLAGS=        -O $(DEFS)
  17. LIBS=                    # BSD systems
  18. #LIBS=        -lPW            # System V systems
  19. SFLAGS=        -r
  20. ARF=        fortune.ar
  21. TARF=        /dev/rmt8
  22. SHARF=        fort.shar
  23. SHARFLAGS=    -vmpX
  24. TDEV=
  25. TROFF=        psroff $(TDEV)
  26.  
  27. .DEFAULT:
  28.     cat $<.?? > $<
  29.     rm -f $<.??
  30.     chmod -r $<
  31.  
  32. all: fortune strfile unstr fortunes.dat
  33.  
  34. fortune: fortune.o rnd.o
  35.     $(CC) $(CFLAGS) -o fortune fortune.o rnd.o $(LIBS)
  36.  
  37. strfile: strfile.o rnd.o
  38.     $(CC) $(CFLAGS) -o strfile strfile.o rnd.o
  39.  
  40. unstr: unstr.o
  41.     $(CC) $(CFLAGS) -o unstr unstr.o
  42.  
  43. fortune.o strfile.o unstr.o: strfile.h
  44.  
  45. fortunes.dat: fortunes strfile
  46.     ./strfile $(SFLAGS) fortunes
  47.  
  48. fortunes: $(FORTUNES)
  49.     cp scene fortunes
  50.     chmod u+w fortunes
  51.     echo "%-" >> fortunes
  52.     cat obscene >> fortunes
  53.  
  54. lint:
  55.     lint -hxb $(DEFS) fortune.c rnd.c 2>&1 > fortune.lint
  56.     lint -hxb $(DEFS) strfile.c rnd.c 2>&1 > strfile.lint
  57.     lint -hxb $(DEFS) unstr.c 2>&1 > unstr.lint
  58.  
  59. tags: $(CFILES)
  60.     ctags $(CFILES)
  61.  
  62. install: all install.data
  63.     cp fortune $(BINDIR)/
  64.     strip $(BINDIR)/fortune
  65.     chown $(USER) $(BINDIR)/fortune
  66.     chmod 4711 $(BINDIR)/fortune
  67.  
  68. install.data: fortunes.dat
  69.     mv fortunes.dat $(LIBDIR)/
  70.     chown $(USER) $(LIBDIR)/fortunes.dat
  71.     chmod 600 $(LIBDIR)/fortunes.dat
  72.  
  73. ar:
  74.     rm -f $(ARF)
  75.     ar cqv $(ARF) $(MISC) $(CFILES) $(SFILES) $(TFILES) $(FORTUNES)
  76.  
  77. tar:
  78.     tar crvbf 20 $(TARF) $(ARF) $(MISC) $(CFILES) $(SFILES) $(TFILES) $(FORTUNES)
  79.  
  80. shar:
  81.     ./Rot13 obscene > obscene.r13
  82.     -rm -f $(SHARF)* scene.?? obscene.r13.??
  83.     shar $(SHARFLAGS) $(MISC) $(SFILES) $(TFILES) > $(SHARF).01
  84.     shar $(SHARFLAGS) $(CFILES) > $(SHARF).02
  85.     ./Shar_split obscene.r13 $(SHARF) 3 "$(SHARFLAGS)" "sed -f :trfix"
  86.     ./Shar_split scene $(SHARF) 5 "$(SHARFLAGS)"
  87.  
  88. shar.clean:
  89.     -rm -f $(SHARF)* scene.?? obscene.r13 obscene.r13.?? .obscene.com
  90.  
  91. spell:    scene.sp obscene.sp
  92.  
  93. Spell.hlist: scene.sp.ok obscene.sp.ok
  94.     cat scene.sp.ok obscene.sp.ok | spellin /usr/dict/hlista > Spell.hlist
  95.  
  96. scene.sp: Spell.hlist scene
  97.     spell -d Spell.hlist scene > scene.sp
  98.  
  99. obscene.sp: Spell.hlist obscene
  100.     spell -d Spell.hlist obscene > obscene.sp
  101.  
  102. done_spell:
  103.     sort -u -o scene.sp.ok scene.sp.ok scene.sp
  104.     sort -u -o obscene.sp.ok obscene.sp.ok obscene.sp
  105.  
  106. troff: troff.scene troff.obscene
  107.  
  108. troff.scene:
  109.     ./Do_troff scene $(TROFF)
  110.  
  111. troff.obscene:
  112.     ./Do_troff obscene $(TROFF)
  113.  
  114. clean: sort.clean shar.clean
  115.     rm -f fortune fortunes fortunes.dat fortunes.tar strfile unstr ? core *.o Spell.hlist *.sp
  116.  
  117. sort: sort.scene sort.obscene
  118.  
  119. sort.scene: strfile unstr
  120.     strfile -oi scene
  121.     mv scene Oscene
  122.     unstr -o scene
  123.  
  124. sort.obscene: strfile unstr
  125.     strfile -oi obscene
  126.     mv obscene Oobscene
  127.     unstr -o obscene
  128.  
  129. sort.clean:
  130.     rm -f Oscene Oobscene scene.dat obscene.dat
  131.