home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / DELETE / PART02.Z / PART02 / Makefile < prev    next >
Encoding:
Makefile  |  1998-07-24  |  5.4 KB  |  192 lines

  1. #     Copyright 1988 Massachusetts Institute of Technology.
  2. #
  3. #     For copying and distribution information, see the file
  4. #     "mit-copyright.h".
  5. #
  6. #     $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/Makefile,v $
  7. #     $Author: jik $
  8. #     $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/Makefile,v 1.28 91/02/22 07:35:51 jik Exp $
  9. #
  10.  
  11. DESTDIR=
  12. TARGETS=     delete undelete expunge purge lsdel
  13. INSTALLDIR=     /usr/bin
  14. MANDIR=        /usr/man
  15. MANSECT=    1
  16. CC=         cc
  17. DEPEND=        /usr/bin/X11/makedepend
  18. COMPILE_ET=     compile_et
  19. LINT=         lint
  20. DEFINES=    
  21.  
  22.  
  23. # These variables apply only if you want this program to recognize
  24. # Andrew File System mount points.  If you don't want to support AFS,
  25. # then they should all be commented out or set to nothing.
  26. # AFSINC is the include directory for AFS header files.  
  27. # AFSLIB is the library directory that contains the AFS libraries.
  28. # AFSINC=        
  29. # AFSLIB=        
  30. # AFSINCS=    -I$(AFSINC)
  31. # AFSLDFLAGS=    -L$(AFSLIB) -L$(AFSLIB)/afs
  32. # AFSLIBS=    -lsys -lrx -llwp $(AFSLIB)/afs/util.a
  33. # AFSDEFINES=    -DAFS_MOUNTPOINTS
  34.  
  35.  
  36. # If you install the com_err library and include files in directories
  37. # that your compiler and linker know how to find, you don't have to
  38. # set these variables.  Otherwise, you do.
  39. # ETINCS is a -I flag pointing to the directory in which the et header
  40. # files are stored. 
  41. # ETLDFLAGS is a -L flag pointing to the directory where the et
  42. # library is stored.
  43. # ETINCS=        
  44. # ETLDFLAGS=    
  45.  
  46.  
  47. # You probably won't have to edit anything below this line.
  48.  
  49. ETLIBS=        -lcom_err
  50. INCLUDES=    $(ETINCS) $(AFSINCS)
  51. LDFLAGS=    $(ETLDFLAGS) $(AFSLDFLAGS) 
  52. LIBS=         $(ETLIBS) $(AFSLIBS)
  53. CDEBUGFLAGS=    -O
  54. CFLAGS=     $(INCLUDES) $(DEFINES) $(AFSDEFINES) $(CDEBUGFLAGS)
  55. LINTFLAGS=    -u $(INCLUDES) $(DEFINES) $(AFSDEFINES) $(CDEBUGFLAGS)
  56. LINTLIBS=    
  57.  
  58. SRCS=         delete.c undelete.c directories.c pattern.c util.c\
  59.         expunge.c lsdel.c col.c shell_regexp.c\
  60.         errors.c stack.c
  61. INCS=         col.h delete.h directories.h expunge.h lsdel.h\
  62.         mit-copyright.h pattern.h undelete.h util.h\
  63.         shell_regexp.h errors.h stack.h
  64. ETS=        delete_errs.h delete_errs.c
  65. ETSRCS=        delete_errs.et
  66.  
  67. MANS=         man1/delete.1 man1/expunge.1 man1/lsdel.1 man1/purge.1\
  68.         man1/undelete.1
  69.  
  70. ARCHIVE=    README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
  71.         $(ETSRCS)
  72. ARCHIVEDIRS=     man1
  73.  
  74. DELETEOBJS=     delete.o util.o delete_errs.o errors.o
  75. UNDELETEOBJS=     undelete.o directories.o util.o pattern.o\
  76.         shell_regexp.o delete_errs.o errors.o stack.o
  77. EXPUNGEOBJS=     expunge.o directories.o pattern.o util.o col.o\
  78.         shell_regexp.o delete_errs.o errors.o stack.o
  79. LSDELOBJS=     lsdel.o util.o directories.o pattern.o col.o\
  80.         shell_regexp.o delete_errs.o errors.o stack.o
  81.  
  82. DELETESRC=     delete.c util.c delete_errs.c errors.c
  83. UNDELETESRC=     undelete.c directories.c util.c pattern.c\
  84.         shell_regexp.c delete_errs.c errors.c stack.c
  85. EXPUNGESRC=     expunge.c directories.c pattern.c util.c col.c\
  86.         shell_regexp.c delete_errs.c errors.c stack.c
  87. LSDELSRC=     lsdel.c util.c directories.c pattern.c col.c\
  88.         shell_regexp.c delete_errs.c errors.c stack.c
  89.  
  90. .SUFFIXES: .c .h .et
  91.  
  92. .et.h: $*.et
  93.     ${COMPILE_ET} $*.et
  94. .et.c: $*.et
  95.     ${COMPILE_ET} $*.et
  96.  
  97. all: $(TARGETS)
  98.  
  99. lint_all: lint_delete lint_undelete lint_expunge lint_lsdel
  100.  
  101. install:: bin_install man_install
  102.  
  103. # Errors are ignored on bin_install and man_install because make on
  104. # some platforms, in combination with the shell, does really stupid
  105. # things and detects an error where there is none.
  106.  
  107. man_install:
  108.     -for i in $(TARGETS) ; do\
  109.       install -c man1/$$i.1\
  110.         $(DESTDIR)$(MANDIR)/man$(MANSECT)/$$i.$(MANSECT);\
  111.     done
  112.  
  113. bin_install: $(TARGETS)
  114.     -for i in $(TARGETS) ; do\
  115.           if [ -f $(DESTDIR)$(INSTALLDIR)/$$i ]; then\
  116.             mv $(DESTDIR)$(INSTALLDIR)/$$i $(DESTDIR)$(INSTALLDIR)/.#$$i ; \
  117.           fi; \
  118.       install -c -s $$i $(DESTDIR)$(INSTALLDIR) ; \
  119.         done
  120.  
  121. delete: $(DELETEOBJS)
  122.     $(CC) $(LDFLAGS) $(CFLAGS) -o delete $(DELETEOBJS) $(LIBS)
  123.  
  124. saber_delete:
  125.     #setopt program_name delete
  126.     #load $(LDFLAGS) $(CFLAGS) $(DELETESRC) $(LIBS)
  127.  
  128. lint_delete: $(DELETESRC)
  129.     $(LINT) $(LINTFLAGS) $(DELETESRC) $(LINTLIBS)
  130.  
  131. undelete: $(UNDELETEOBJS)
  132.     $(CC) $(LDFLAGS) $(CFLAGS) -o undelete $(UNDELETEOBJS) $(LIBS)
  133.  
  134. saber_undelete:
  135.     #setopt program_name undelete
  136.     #load $(LDFLAGS) $(CFLAGS) $(UNDELETESRC) $(LIBS)
  137.  
  138. lint_undelete: $(UNDELETESRC)
  139.     $(LINT) $(LINTFLAGS) $(UNDELETESRC) $(LINTLIBS)
  140.  
  141. expunge: $(EXPUNGEOBJS)
  142.     $(CC) $(LDFLAGS) $(CFLAGS) -o expunge $(EXPUNGEOBJS) $(LIBS)
  143.  
  144. saber_expunge:
  145.     #setopt program_name expunge
  146.     #load $(LDFLAGS) $(CFLAGS) $(EXPUNGESRC) $(LIBS)
  147.  
  148. lint_expunge: $(EXPUNGESRC)
  149.     $(LINT) $(LINTFLAGS) $(EXPUNGESRC) $(LINTLIBS)
  150.  
  151. purge: expunge
  152.     ln -s expunge purge
  153.  
  154. lsdel: $(LSDELOBJS)
  155.     $(CC) $(LDFLAGS) $(CFLAGS) -o lsdel $(LSDELOBJS) $(LIBS)
  156.  
  157. lint_lsdel: $(LSDELSRC)
  158.     $(LINT) $(LINTFLAGS) $(LSDELSRC) $(LINTLIBS)
  159.  
  160. saber_lsdel:
  161.     #setopt program_name lsdel
  162.     #load $(LDFLAGS) $(CFLAGS) $(LSDELSRC) $(LIBS)
  163.  
  164. tar: $(ARCHIVE)
  165.     tar cvf - $(ARCHIVE) | compress > delete.tar.Z
  166.  
  167. shar: $(ARCHIVE)
  168.     makekit -oMANIFEST $(ARCHIVEDIRS) $(ARCHIVE)
  169.  
  170. patch: $(ARCHIVE)
  171.     makepatch $(ARCHIVE)
  172.     mv patch delete.patch`cat PATCHLEVEL`
  173.     shar delete.patch`cat PATCHLEVEL` > delete.patch`cat PATCHLEVEL`.shar
  174.  
  175. clean::
  176.     -rm -f *~ *.bak *.o delete undelete lsdel expunge purge\
  177.         delete_errs.h delete_errs.c
  178.  
  179. depend: $(SRCS) $(INCS) $(ETS)
  180.     $(DEPEND) -v $(CFLAGS) -s'# DO NOT DELETE' $(SRCS)
  181.  
  182. $(DELETEOBJS): delete_errs.h
  183. $(EXPUNGEOBJS): delete_errs.h
  184. $(UNDELETEOBJS): delete_errs.h
  185. $(LSDELOBJS): delete_errs.h
  186.  
  187. # DO NOT DELETE THIS LINE -- makedepend depends on it
  188.