home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / condor40.zip / CONDOR / src / condor_shadow / Makefile next >
Makefile  |  1989-06-01  |  5KB  |  144 lines

  1. # Copyright 1986, 1987, 1988, 1989 University of Wisconsin
  2. # Permission to use, copy, modify, and distribute this software and its
  3. # documentation for any purpose and without fee is hereby granted,
  4. # provided that the above copyright notice appear in all copies and that
  5. # both that copyright notice and this permission notice appear in
  6. # supporting documentation, and that the name of the University of
  7. # Wisconsin not be used in advertising or publicity pertaining to
  8. # distribution of the software without specific, written prior
  9. # permission.  The University of Wisconsin makes no representations about
  10. # the suitability of this software for any purpose.  It is provided "as
  11. # is" without express or implied warranty.
  12. # THE UNIVERSITY OF WISCONSIN DISCLAIMS ALL WARRANTIES WITH REGARD TO
  13. # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  14. # FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF WISCONSIN  BE LIABLE FOR
  15. # ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  16. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  17. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  18. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19. # Authors:  Allan Bricker and Michael J. Litzkow,
  20. #              University of Wisconsin, Computer Sciences Dept.
  21.  
  22.  
  23.  
  24.  
  25. #
  26. # The following variables must be passed in to this makefile:
  27. #
  28. #    SRCDIR    =    The pathname (relative or absolute) of the source
  29. #                directory (eg. ../src, /var/home/condor/CONDOR/src)
  30. #
  31. #    DSTDIR    =    The pathname (relative or absolute) of the directory
  32. #                which will contain the installed binaries and libraries.
  33. #                There must be "bin" and "lib" subdirectories within DSTDIR.
  34. #
  35. #    COPTS    =    Default flags to cc (eg -O, -g)
  36. #
  37. #    IDENT    =    Any #defines which are not automatically supplied
  38. #                by cpp (eg. -Dsunos40 or -Dsunos32).  Note that
  39. #                cpp provides definitions for architectures (eg.
  40. #                vax, sun, mc68020, sparc)
  41. #
  42.  
  43. DIRECTORY=condor_shadow
  44.  
  45. PDIR=$(SRCDIR)/$(DIRECTORY)
  46. CFLAGS=$(COPTS) -I$(SRCDIR)/h $(IDENT)
  47.  
  48. #
  49. #    Options to 'ctags'
  50. #
  51. TFLAGS=-dt
  52.  
  53. #
  54. #    Each file in the CSRC list should be prepended by $(PDIR).
  55. #
  56. CSRC=$(PDIR)/shadow.c $(PDIR)/ops.c $(PDIR)/perm_err.c \
  57.         $(SRCDIR)/condor_lib/CONDOR_sysnames.c
  58. SSRC=
  59.  
  60. SRC=$(CSRC) $(SSRC)
  61.  
  62. OBJ=shadow.o ops.o perm_err.o ../condor_lib/CONDOR_sysnames.o
  63. LIB=../util_lib/util_lib.a ../xdr_lib/xdr_lib.a
  64. LINTLIB =   ../util_lib/llib-lutil.ln ../xdr_lib/llib-lxdr.ln
  65.  
  66. PROGRAMS=condor_shadow
  67. CLEANUP=$(OBJ) $(PROGRAMS) $(PDIR)/Makefile.bak
  68.  
  69. all: $(PROGRAMS)
  70.  
  71. ALWAYS:
  72.  
  73. release: $(PROGRAMS)
  74.     cd $(DSTDIR)/bin ; rm -f $(PROGRAMS)
  75.     cp $(PROGRAMS) $(DSTDIR)/bin
  76.     cd $(DSTDIR)/bin ; chmod -w $(PROGRAMS)
  77.     cd $(DSTDIR)/bin ; chmod g+s $(PROGRAMS)
  78.  
  79. lint: ALWAYS
  80.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(CSRC) $(LINTLIB)
  81.  
  82. clean: ALWAYS
  83.     rm -f $(CLEANUP)
  84.  
  85. tags: ALWAYS
  86.     cd $(PDIR) ; ctags $(TFLAGS) $(CSRC) ; \
  87.     cat ../h/tags ../xdr_lib/tags ../util_lib/tags ../condor_lib/tags \
  88.             >> tags ; sort tags > tags.sorted ; mv tags.sorted tags
  89.  
  90. #############################################################################
  91. # Put program specific things here
  92. #############################################################################
  93.  
  94. condor_shadow: $(OBJ) $(LIB)
  95.     cc $(CFLAGS) -o condor_shadow $(OBJ) $(LIB) -lm $(LIBDBM)
  96.  
  97. shadow.o: $(PDIR)/shadow.c
  98.     cc -c $(CFLAGS) $(PDIR)/shadow.c
  99.  
  100. ops.o: $(PDIR)/ops.c
  101.     cc -c $(CFLAGS) $(PDIR)/ops.c
  102.  
  103. perm_err.o: $(PDIR)/perm_err.c
  104.     cc -c $(CFLAGS) $(PDIR)/perm_err.c
  105.  
  106. ../condor_lib/CONDOR_sysnames.o: $(SRCDIR)/condor_lib/CONDOR_sysnames.c
  107.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/CONDOR_sysnames.c
  108.  
  109. depend: ALWAYS
  110.     grep '^#include' $(CSRC) | grep -v '<' | grep -v '../util' | \
  111.     grep '^#include' $(CSRC) $(PDIR)/Makefile | grep -v '<' | \
  112.           sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \
  113.           sed 's/\.c/.o/' | \
  114.           sed 's;$(PDIR)/;;' | \
  115.           sed 's;: ;: $$\(SRCDIR)/h/;' | \
  116.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  117.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  118.                else rec = rec " " $$2 } } \
  119.           END { print rec } ' > makedep
  120.     echo '$$r makedep' >>eddep
  121.     echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  122.     echo '$$r makedep' >>eddep
  123.     echo 'w' >>eddep
  124.     /bin/cp $(PDIR)/Makefile $(PDIR)/Makefile.bak
  125.     ed - $(PDIR)/Makefile < eddep
  126.     rm eddep makedep
  127.  
  128. # DO NOT DELETE THIS LINE -- make depend uses it
  129.  
  130. shadow.o: $(SRCDIR)/h/sched.h $(SRCDIR)/h/ckpt.h $(SRCDIR)/h/debug.h
  131. shadow.o: $(SRCDIR)/h/except.h $(SRCDIR)/h/trace.h $(SRCDIR)/h/fileno.h
  132. shadow.o: $(SRCDIR)/h/files.h $(SRCDIR)/h/proc.h $(SRCDIR)/h/expr.h
  133. shadow.o: $(SRCDIR)/h/exit.h
  134. ops.o: $(SRCDIR)/h/errno.h $(SRCDIR)/h/condor_types.h $(SRCDIR)/h/ckpt_file.h
  135. ops.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/condor_rsc.h $(SRCDIR)/h/trace.h
  136. ops.o: $(SRCDIR)/h/except.h $(SRCDIR)/h/debug.h $(SRCDIR)/h/fileno.h
  137. ops.o: $(SRCDIR)/h/proc.h
  138.