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 / ckpt_lib / Makefile next >
Makefile  |  1989-09-08  |  9KB  |  274 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. # The following variables must be passed in to this makefile:
  26. #
  27. #    SRCDIR    =    The pathname (relative or absolute) of the source
  28. #                directory (eg. ../src, /var/home/condor/CONDOR/src)
  29. #
  30. #    DSTDIR    =    The pathname (relative or absolute) of the directory
  31. #                which will contain the installed binaries and libraries.
  32. #                There must be "bin" and "lib" subdirectories within DSTDIR.
  33. #
  34. #    COPTS    =    Default flags to cc (eg -O, -g)
  35. #
  36. #    IDENT    =    Any #defines which are not automatically supplied
  37. #                by cpp (eg. -Dsunos40 or -Dsunos32).  Note that
  38. #                cpp provides definitions for architectures (eg.
  39. #                vax, sun, mc68020, sparc)
  40. #
  41.  
  42. DIRECTORY=ckpt_lib
  43.  
  44. PDIR=$(SRCDIR)/$(DIRECTORY)
  45. CFLAGS=$(COPTS) -I$(SRCDIR)/h $(IDENT)
  46.  
  47. #
  48. #    Options to 'ctags'
  49. #
  50. TFLAGS=-dt
  51.  
  52. #
  53. #    Each file in the CSRC list should be prepended by $(SRCDIR).
  54. #
  55. CSRC=$(SRCDIR)/condor_lib/finfo.c $(SRCDIR)/condor_lib/ckpt_main.c \
  56.     $(SRCDIR)/condor_lib/syscalls.c $(SRCDIR)/condor_lib/chdir.c \
  57.     $(SRCDIR)/condor_lib/close.c $(SRCDIR)/condor_lib/dup.c \
  58.     $(SRCDIR)/condor_lib/dup2.c $(SRCDIR)/condor_lib/open.c \
  59.     $(SRCDIR)/condor_lib/ckpt.c $(SRCDIR)/condor_lib/_mkckpt.c \
  60.     $(SRCDIR)/condor_lib/CONDOR_sysnames.c \
  61.     $(SRCDIR)/util_lib/perror.c $(SRCDIR)/util_lib/condor_errlst.c
  62. SSRC=
  63.  
  64. SRC=$(CSRC) $(SSRC)
  65.  
  66. OBJ=CONDOR_syscalls.o _mkckpt.o ckpt.o ckpt_main.o \
  67.     ../condor_lib/finfo.o ../condor_lib/syscalls.o ../condor_lib/chdir.o \
  68.     ../condor_lib/close.o ../condor_lib/dup.o ../condor_lib/dup2.o \
  69.     ../condor_lib/open.o ../condor_lib/CONDOR_sysnames.o ../util_lib/except.o \
  70.     ../util_lib/dprintf.o ../util_lib/strdup.o ../util_lib/perror.o \
  71.     ../util_lib/condor_errlst.o
  72.  
  73. LIB=../util_lib/util_lib.a ../xdr_lib/xdr_lib.a
  74.  
  75. PROGRAMS=libckpt.a ckptrt0.o
  76. CLEANUP=$(OBJ) $(PROGRAMS) $(PDIR)/Makefile.bak ToUpper
  77.  
  78. all: $(PROGRAMS)
  79.  
  80. ALWAYS:
  81.  
  82. release: $(DSTDIR)/lib/libckpt.a $(DSTDIR)/lib/ckptrt0.o
  83.     cd $(DSTDIR)/lib ; chmod -w $(PROGRAMS)
  84.  
  85. $(DSTDIR)/lib/libckpt.a: libckpt.a
  86.     rm -f $(DSTDIR)/lib/libckpt.a
  87.     cp libckpt.a $(DSTDIR)/lib
  88.     cd $(DSTDIR)/lib ; ranlib libckpt.a
  89.  
  90. $(DSTDIR)/lib/ckptrt0.o: ckptrt0.o
  91.     rm -f $(DSTDIR)/lib/ckptrt0.o
  92.     cp ckptrt0.o $(DSTDIR)/lib
  93.  
  94. lint: ALWAYS
  95.     lint -Cckpt -DLINT -I$(SRCDIR)/h $(IDENT) $(CSRC)
  96.  
  97. clean: ALWAYS
  98.     rm -f $(CLEANUP)
  99.  
  100. tags: ALWAYS
  101.     cd $(PDIR) ; ctags $(TFLAGS) $(CSRC)
  102.  
  103. #############################################################################
  104. # Put program specific things here
  105. #############################################################################
  106.  
  107. libckpt.a: $(OBJ)
  108.     ar crv libckpt.a $?
  109.     ranlib libckpt.a
  110.  
  111. ckptrt0.o: /lib/crt0.o ToUpper
  112.     ToUpper /lib/crt0.o ckptrt0.o main
  113.  
  114. ToUpper: $(SRCDIR)/condor_lib/ToUpper.c
  115.     cc -o ToUpper $(SRCDIR)/condor_lib/ToUpper.c
  116.  
  117. CONDOR_syscalls.o: $(SRCDIR)/condor_lib/CONDOR_syscalls.c
  118.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/CONDOR_syscalls.c
  119.  
  120. _mkckpt.o: $(SRCDIR)/condor_lib/_mkckpt.c \
  121.     $(SRCDIR)/condor_lib/_updateckpt.mips.c \
  122.     $(SRCDIR)/condor_lib/_updateckpt.other.c
  123.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/_mkckpt.c
  124.  
  125. ckpt.o: $(SRCDIR)/condor_lib/ckpt.c
  126.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/ckpt.c
  127.  
  128. #ckpt.o: $(SRCDIR)/condor_lib/ckpt.c
  129. #    /lib/cpp $(IDENT) $(SRCDIR)/condor_lib/ckpt.sed \
  130. #                                | egrep -v '^#' > ckpt.sed.mach
  131. #    cc -S $(CFLAGS) $(SRCDIR)/condor_lib/ckpt.c
  132. #    sed -f ckpt.sed.mach ckpt.s > ckpt.s.sed
  133. #    as ckpt.s.sed -o ckpt.o
  134. #    as $(CFLAGS) ckpt.s.sed -o ckpt.o
  135. #    rm -f ckpt.s ckpt.s.sed ckpt.sed.mach
  136.  
  137. #ckpt_main.o: $(SRCDIR)/condor_lib/ckpt_main.c
  138. #    cc -S $(CFLAGS) $(SRCDIR)/condor_lib/ckpt_main.c
  139. #    echo "#define _ckptM ckptM" > tmp.s
  140. #    cat ckpt_main.s | sed -e 's/^#.*//' >> tmp.s
  141. #    /lib/cpp tmp.s | sed -e 's/^#.*//' > tmp2.s
  142. #    as -o ckpt_main.o tmp2.s
  143. #    rm -f tmp.s tmp2.s ckpt_main.s
  144.  
  145. ckpt_main.o: $(SRCDIR)/condor_lib/ckpt_main.c
  146.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/ckpt_main.c
  147.  
  148. ../util_lib/perror.o: $(SRCDIR)/util_lib/perror.c
  149.     cc -c $(CFLAGS) $(SRCDIR)/util_lib/perror.c
  150.     mv perror.o ../util_lib
  151.  
  152. ../util_lib/condor_errlist.o: $(SRCDIR)/util_lib/condor_errlist.c
  153.     cc -c $(CFLAGS) $(SRCDIR)/util_lib/condor_errlist.c
  154.     mv condor_errlist.o ../util_lib
  155.  
  156. ../condor_lib/finfo.o: $(SRCDIR)/condor_lib/finfo.c
  157.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/finfo.c
  158.     mv finfo.o ../condor_lib
  159.  
  160. ../condor_lib/syscalls.o: $(SRCDIR)/condor_lib/syscalls.c
  161.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/syscalls.c
  162.     mv syscalls.o ../condor_lib
  163.  
  164. ../condor_lib/chdir.o: $(SRCDIR)/condor_lib/chdir.c
  165.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/chdir.c
  166.     mv chdir.o ../condor_lib
  167.  
  168. ../condor_lib/close.o: $(SRCDIR)/condor_lib/close.c
  169.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/close.c
  170.     mv close.o ../condor_lib
  171.  
  172. ../condor_lib/dup.o: $(SRCDIR)/condor_lib/dup.c
  173.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/dup.c
  174.     mv dup.o ../condor_lib
  175.  
  176. ../condor_lib/dup2.o: $(SRCDIR)/condor_lib/dup2.c
  177.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/dup2.c
  178.     mv dup2.o ../condor_lib
  179.  
  180. ../condor_lib/open.o: $(SRCDIR)/condor_lib/open.c
  181.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/open.c
  182.     mv open.o ../condor_lib
  183.  
  184. ../condor_lib/CONDOR_sysnames.o: $(SRCDIR)/condor_lib/CONDOR_sysnames.c
  185.     cc -c $(CFLAGS) $(SRCDIR)/condor_lib/CONDOR_sysnames.c
  186.     mv CONDOR_sysnames.o ../condor_lib
  187.  
  188. ../util_lib/except.o: $(SRCDIR)/util_lib/except.c
  189.     cc -c $(CFLAGS) $(SRCDIR)/util_lib/except.c
  190.     mv except.o ../util_lib
  191.  
  192. ../util_lib/dprintf.o: $(SRCDIR)/util_lib/dprintf.c
  193.     cc -c $(CFLAGS) $(SRCDIR)/util_lib/dprintf.c
  194.     mv dprintf.o ../util_lib
  195.  
  196. ../util_lib/strdup.o: $(SRCDIR)/util_lib/strdup.c
  197.     cc -c $(CFLAGS) $(SRCDIR)/util_lib/strdup.c
  198.     mv strdup.o ../util_lib
  199.  
  200. TESTS=printer tcat registers
  201. LIBS=libckpt.a -lc
  202.  
  203. tests: $(TESTS)
  204.     @echo All tests made...
  205.  
  206. mkckpt: $(SRCDIR)/standalone/mkckpt.c libckpt.a
  207.     cc -o mkckpt $(CFLAGS) $(SRCDIR)/standalone/mkckpt.c $(LIBS)
  208.  
  209. registers: registers.o libckpt.a ckptrt0.o mkckpt
  210.     ld $(LDOPTS) -o registers ckptrt0.o registers.o $(LIBS)
  211.     mkckpt registers
  212.  
  213. registers.o: $(PDIR)/registers.c
  214.     cc -c $(CFLAGS) $(PDIR)/registers.c
  215.  
  216. printer: printer.o libckpt.a ckptrt0.o mkckpt
  217.     ld $(LDOPTS) -o printer ckptrt0.o printer.o $(LIBS)
  218.     mkckpt printer
  219.  
  220. printer.o: $(PDIR)/printer.c
  221.     cc -c $(CFLAGS) $(PDIR)/printer.c
  222.  
  223. tcat: tcat.o libckpt.a ckptrt0.o mkckpt
  224.     ld -o $(LDOPTS) tcat ckptrt0.o tcat.o $(LIBS)
  225.     mkckpt tcat
  226.  
  227. tcat.o: $(PDIR)/tcat.c
  228.     cc -c $(CFLAGS) $(PDIR)/tcat.c
  229.  
  230. depend: ALWAYS
  231.     grep '^#include' $(CSRC) $(PDIR)/Makefile | grep -v '<' | \
  232.           sed 's/:[^"]*"\([^"]*\)".*/: \1/' | \
  233.           sed 's/\.c/.o/' | \
  234.           sed 's;$(PDIR)/;;' | \
  235.           sed 's;$(SRCDIR);..;' | \
  236.           sed 's;: ;: $$\(SRCDIR)/h/;' | \
  237.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  238.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  239.                else rec = rec " " $$2 } } \
  240.           END { print rec } ' > makedep
  241.     echo '$$r makedep' >>eddep
  242.     echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  243.     echo '$$r makedep' >>eddep
  244.     echo 'w' >>eddep
  245.     /bin/cp $(PDIR)/Makefile $(PDIR)/Makefile.bak
  246.     ed - $(PDIR)/Makefile < eddep
  247.     rm eddep makedep
  248.  
  249. # DO NOT DELETE THIS LINE -- make depend uses it
  250.  
  251. ../condor_lib/finfo.o: $(SRCDIR)/h/ckpt_file.h
  252. ../condor_lib/ckpt_main.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/ckpt_file.h
  253. ../condor_lib/ckpt_main.o: $(SRCDIR)/h/trace.h $(SRCDIR)/h/except.h
  254. ../condor_lib/ckpt_main.o: $(SRCDIR)/h/fileno.h $(SRCDIR)/h/debug.h
  255. ../condor_lib/syscalls.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/debug.h
  256. ../condor_lib/chdir.o: $(SRCDIR)/h/ckpt_file.h $(SRCDIR)/h/condor_sys.h
  257. ../condor_lib/chdir.o: $(SRCDIR)/h/trace.h $(SRCDIR)/h/except.h
  258. ../condor_lib/close.o: $(SRCDIR)/h/condor_sys.h
  259. ../condor_lib/dup.o: $(SRCDIR)/h/condor_sys.h
  260. ../condor_lib/dup2.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/ckpt_file.h
  261. ../condor_lib/open.o: $(SRCDIR)/h/condor_sys.h
  262. ../condor_lib/ckpt.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/trace.h $(SRCDIR)/h/ckpt.h
  263. ../condor_lib/ckpt.o: $(SRCDIR)/h/machdep.h $(SRCDIR)/h/except.h
  264. ../condor_lib/ckpt.o: $(SRCDIR)/h/debug.h
  265. ../condor_lib/_mkckpt.o: $(SRCDIR)/h/condor_sys.h $(SRCDIR)/h/trace.h
  266. ../condor_lib/_mkckpt.o: $(SRCDIR)/h/ckpt.h $(SRCDIR)/h/machdep.h
  267. ../condor_lib/_mkckpt.o: $(SRCDIR)/h/except.h $(SRCDIR)/h/debug.h
  268. ../util_lib/condor_errlist.o: $(SRCDIR)/h/errno.h
  269.