home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume4 / clock / Makefile < prev    next >
Encoding:
Makefile  |  1989-02-03  |  2.2 KB  |  86 lines

  1. # Makefile for:  clock - digital clock display
  2.  
  3. DEFINES        = -DBSD
  4. CFLAGS        = -O $(DEFINES)
  5. LIBS        = -lcurses -ltermcap
  6. ROFF        = nroff
  7. RFLAGS        = -man
  8. LDFLAGS        = -s
  9. DESTBIN        = ${HOME}
  10. DESTMAN        = ${HOME}
  11. DESTCAT        = ${HOME}
  12. DESTOWN        = root
  13. DESTGRP        = staff
  14. SHELL        = /bin/sh
  15. MAKEFILE    = Makefile
  16. PROGRAM        = clock
  17. MANPAGES    = clock.man
  18. CATPAGES    = clock.cat
  19. SRCS        = clock.c digits.c
  20. OBJS        = clock.o digits.o
  21.  
  22. .man.cat:
  23.         $(ROFF) $(RFLAGS) $< > $@
  24.  
  25. .SUFFIXES:    .man .cat
  26.  
  27. # Compile and load the program and format its manual pages.
  28. all:        $(PROGRAM) $(CATPAGES)
  29.  
  30. $(PROGRAM):    $(OBJS)
  31.         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
  32.  
  33. # Run lint on source files, put results on standard output.
  34. lint:
  35.         lint -u $(DEFINES) $(SRCS)
  36.  
  37. # Create a tags file for use by a source code editor.
  38. tags:        $(SRCS)
  39.         ctags $(SRCS)
  40.  
  41. # Edit the makefile and regenerate the dependency information.
  42. depend:
  43.         mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DESTBIN=$(DESTBIN)
  44.  
  45. # Print an index of functions on standard output.
  46. index:
  47.         ctags -wx $(SRCS)
  48.  
  49. # Print source code files on standard output.
  50. print:
  51.         lpr -p $(SRCS) $(MANPAGES)
  52.  
  53. # Compile and load the program, format manual pages, and move them
  54. # to their destination directories.
  55. install:    $(PROGRAM) $(CATPAGES)
  56.         cp $(PROGRAM) $(DESTBIN)
  57.         chmod 755 $(DESTBIN)/$(PROGRAM)
  58.         chown $(DESTOWN) $(DESTBIN)/$(PROGRAM)
  59.         chgrp $(DESTGRP) $(DESTBIN)/$(PROGRAM)
  60.         -for manpage in $(MANPAGES); do \
  61.             basepage=`basename $$manpage .man`; \
  62.             cp $$basepage.man $(DESTMAN)/$$basepage.l; \
  63.             chmod 644 $(DESTMAN)/$$basepage.l; \
  64.             chown $(DESTOWN) $(DESTMAN)/$$basepage.l; \
  65.             chgrp $(DESTGRP) $(DESTMAN)/$$basepage.l; \
  66.             cp $$basepage.cat $(DESTCAT)/$$basepage.l; \
  67.             chmod 644 $(DESTCAT)/$$basepage.l; \
  68.             chown $(DESTOWN) $(DESTCAT)/$$basepage.l; \
  69.             chgrp $(DESTGRP) $(DESTCAT)/$$basepage.l; \
  70.         done
  71.  
  72. # Remove the program and its formatted manual pages from their
  73. # destination directories.
  74. uninstall:
  75.         rm -f $(DESTBIN)/$(PROGRAM)
  76.         -for manpage in $(MANPAGES); do \
  77.             basepage=`basename $$manpage .man`; \
  78.             rm -f $(DESTMAN)/$$basepage.l; \
  79.             rm -f $(DESTCAT)/$$basepage.l; \
  80.         done
  81.  
  82. # Remove all target and intermediate files.
  83. clean:
  84.         -rm -f $(PROGRAM) $(CATPAGES) $(OBJS)
  85.         -rm -f core a.out made *.o
  86.