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_tools / Makefile < prev    next >
Makefile  |  1989-09-25  |  6KB  |  198 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_tools
  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)/status.c $(PDIR)/vacate.c $(PDIR)/reschedule.c \
  57.     $(PDIR)/summary.c $(PDIR)/config_val.c $(PDIR)/prtsegmap.c \
  58.     $(PDIR)/preen.c $(PDIR)/history.c
  59. #    $(PDIR)/print_core.c  $(PDIR)/print_exec.c
  60.  
  61. SSRC=
  62.  
  63. SRC=$(CSRC) $(SSRC)
  64.  
  65. OBJ=status.o vacate.o reschedule.o summary.o config_val.o prtsegmap.o preen.o \
  66.     history.o
  67. #     print_core.o print_exec.o
  68.  
  69. LIB=../util_lib/util_lib.a ../xdr_lib/xdr_lib.a
  70. LINTLIB =   ../util_lib/llib-lutil.ln ../xdr_lib/llib-lxdr.ln
  71.  
  72. PROGRAMS=condor_status condor_vacate condor_reschedule condor_summary \
  73.             config_val prtsegmap condor_preen condor_history
  74. #             print_core print_exec
  75.  
  76. CLEANUP=$(OBJ) $(PROGRAMS) $(PDIR)/Makefile.bak
  77.  
  78. all: $(PROGRAMS)
  79.  
  80. ALWAYS:
  81.  
  82. release: $(PROGRAMS)
  83.     cd $(DSTDIR)/bin ; rm -f $(PROGRAMS)
  84.     cp $(PROGRAMS) $(DSTDIR)/bin
  85.     cd $(DSTDIR)/bin ; chmod -w $(PROGRAMS)
  86. #    cd $(DSTDIR)/bin ; chmod g+s $(PROGRAMS)
  87.     cd $(DSTDIR)/bin ; chmod g+s condor_summary
  88.     cd $(DSTDIR)/bin ; chmod g+s condor_history
  89.  
  90. lint: ALWAYS
  91.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/status.c $(LINTLIB)
  92.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/vacate.c $(LINTLIB)
  93.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/reschedule.c $(LINTLIB)
  94.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/summary.c $(LINTLIB)
  95.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/history.c $(LINTLIB)
  96.     lint -DLINT -I$(SRCDIR)/h $(IDENT) $(PDIR)/preen.c $(LINTLIB)
  97.  
  98. clean: ALWAYS
  99.     rm -f $(CLEANUP)
  100.  
  101. tags: ALWAYS
  102.     cd $(PDIR) ; ctags $(TFLAGS) $(CSRC) ; \
  103.     cat ../h/tags ../xdr_lib/tags ../util_lib/tags ../condor_lib/tags \
  104.             >> tags ; sort tags > tags.sorted ; mv tags.sorted tags
  105.  
  106. #############################################################################
  107. # Put program specific things here
  108. #############################################################################
  109.  
  110. condor_summary: summary.o  $(LIB)
  111.     cc $(CFLAGS) -o condor_summary summary.o $(LIB)
  112.  
  113. condor_history: history.o  $(LIB)
  114.     cc $(CFLAGS) -o condor_history history.o $(LIB)
  115.  
  116. condor_status: status.o  $(LIB)
  117.     cc $(CFLAGS) -o condor_status status.o $(LIB)
  118.  
  119. condor_reschedule: reschedule.o $(LIB)
  120.     cc $(CFLAGS) -o condor_reschedule reschedule.o $(LIB)
  121.  
  122. condor_preen: preen.o $(LIB)
  123.     cc $(CFLAGS) -o condor_preen preen.o $(LIB) $(LIBDBM)
  124.  
  125. condor_vacate: vacate.o $(LIB)
  126.     cc $(CFLAGS) -o condor_vacate vacate.o $(LIB)
  127.  
  128. config_val: config_val.o $(LIB)
  129.     cc $(CFLAGS) -o config_val config_val.o $(LIB)
  130.  
  131. prtsegmap: prtsegmap.o $(LIB)
  132.     cc $(CFLAGS) -o prtsegmap prtsegmap.o $(LIB)
  133.  
  134. print_exec: print_exec.o $(LIB)
  135.     cc $(CFLAGS) -o print_exec print_exec.o $(LIB)
  136.  
  137. print_core: print_core.o $(LIB)
  138.     cc $(CFLAGS) -o print_core print_core.o $(LIB)
  139.  
  140. summary.o: $(PDIR)/summary.c
  141.     cc -c $(CFLAGS) $(PDIR)/summary.c
  142.  
  143. history.o: $(PDIR)/history.c
  144.     cc -c $(CFLAGS) $(PDIR)/history.c
  145.  
  146. status.o: $(PDIR)/status.c
  147.     cc -c $(CFLAGS) $(PDIR)/status.c
  148.  
  149. reschedule.o: $(PDIR)/reschedule.c
  150.     cc -c $(CFLAGS) $(PDIR)/reschedule.c
  151.  
  152. preen.o: $(PDIR)/preen.c
  153.     cc -c $(CFLAGS) $(PDIR)/preen.c
  154.  
  155. config_val.o: $(PDIR)/config_val.c
  156.     cc -c $(CFLAGS) $(PDIR)/config_val.c
  157.  
  158. vacate.o: $(PDIR)/vacate.c
  159.     cc -c $(CFLAGS) $(PDIR)/vacate.c
  160.  
  161. prtsegmap.o: $(PDIR)/prtsegmap.c
  162.     cc -c $(CFLAGS) $(PDIR)/prtsegmap.c
  163.  
  164. print_exec.o: $(PDIR)/print_exec.c
  165.     cc -c $(CFLAGS) $(PDIR)/print_exec.c
  166.  
  167. print_core.o: $(PDIR)/print_core.c
  168.     cc -c $(CFLAGS) $(PDIR)/print_core.c
  169.  
  170. depend: ALWAYS
  171.     grep '^#include' $(CSRC) $(PDIR)/Makefile | grep -v '<' | \
  172.           sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \
  173.           sed 's/\.c/.o/' | \
  174.           sed 's;$(PDIR)/;;' | \
  175.           sed 's;: ;: $$\(SRCDIR)/h/;' | \
  176.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  177.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  178.                else rec = rec " " $$2 } } \
  179.           END { print rec } ' > makedep
  180.     echo '$$r makedep' >>eddep
  181.     echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  182.     echo '$$r makedep' >>eddep
  183.     echo 'w' >>eddep
  184.     /bin/cp $(PDIR)/Makefile $(PDIR)/Makefile.bak
  185.     ed - $(PDIR)/Makefile < eddep
  186.     rm eddep makedep
  187.  
  188. # DO NOT DELETE THIS LINE -- make depend uses it
  189.  
  190. status.o: $(SRCDIR)/h/debug.h $(SRCDIR)/h/except.h $(SRCDIR)/h/trace.h
  191. status.o: $(SRCDIR)/h/expr.h $(SRCDIR)/h/sched.h $(SRCDIR)/h/manager.h
  192.