home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / HippoDraw / hippo / make.common < prev    next >
Encoding:
Text File  |  1992-04-28  |  10.8 KB  |  333 lines

  1. #  Makefile to construct the hippo library
  2. #
  3. #  Paul Rensing, Jan 28, 1992
  4. #    created from Makefile
  5. #
  6. # $Id: make.common,v 3.15 1992/04/28 23:28:41 rensing Rel $
  7. #
  8. # Copyright (C)  1991  The Board of Trustees of The Leland Stanford
  9. # Junior University.  All Rights Reserved.
  10.  
  11. NAME=hippo
  12.  
  13. # location of primary source code
  14. SRC_DIR = /nfs/ebnextk/LocalSources/hippo
  15.  
  16. # location to install libs and include files
  17. LIB_INSTALLDIR = /usr/local/lib
  18. INC_INSTALLDIR = /usr/local/lib.shared/hippo
  19. BIN_INSTALLDIR = /usr/local/bin
  20.  
  21. # files to install
  22. INSTALL_INCS = hippo.h hippostruct.h
  23. INSTALL_LIBS = $(LIB_LIST) $(DEBUGLIB_LIST)
  24. INSTALL_BINS = nt2text text2nt
  25.  
  26. # directory in which libraries are built
  27. LIB_DIR = .
  28. BIN_DIR = .
  29.  
  30. # FORTRAN bindings
  31. # if you don't have FORTRAN, comment this out
  32. FBINDINGS = $(LIBRARY)(hippof.o)
  33.  
  34. # machine dependent junk : 
  35. #  FLAVOR is set from Makefile by the script architecture.
  36. #  if it does not work for you, modify architecture or hard wire
  37. #  the change.
  38. include make.${FLAVOR}
  39.  
  40. # list of files needed
  41. TARFILES = hippowrapsps.psw hippontuple.c hippodisplay.c hippoplot.c \
  42.            hippoprint.c hippoio.c hippoutil.c ntuple-parse.c \
  43.            hippoxdr.c fhippo.c hippof.f \
  44.            hippo.h hippostruct.h hippoutil.h hippoxdr.h hshrtnm.h \
  45.            hippoplotNeXT.c hippoplotNeXT.h \
  46.            hippoplotUP.c hippoplotUP.h \
  47.            hippoplotXIV.cc hippoplotXIV.h \
  48.            hippoplotX11.c hippoplotX11.h \
  49.            hippoplotPS.c hippoplotPS.h \
  50.            Makefile make.common make.next make.sun4 make.aix6000 \
  51.            make.ultrix make.sgi architecture\
  52.            nt2text.c text2nt.c hb2hippo.f getarg.c \
  53.            h_test.c example.hiptxt example.hippo h_test.out \
  54.            x11test.c README_X11 \
  55.            make.vms hippo.opt \
  56.            README HippoRef.ps HippoUser.ps CHANGES
  57.  
  58. LIBRARY = $(LIB_DIR)/lib$(NAME).a
  59.  
  60. NTLIBMEMS = $(LIBRARY)(hippontuple.o) \
  61.           $(LIBRARY)(hippoio.o) \
  62.           $(LIBRARY)(hippoutil.o) \
  63.           $(LIBRARY)(ntuple-parse.o) \
  64.           $(LIBRARY)(hippoxdr.o) \
  65.           $(LIBRARY)(fhippo.o) \
  66.           $(FBINDINGS) 
  67.  
  68. LIBMEMS = $(NTLIBMEMS) \
  69.           $(LIBRARY)(hippodisplay.o) \
  70.           $(LIBRARY)(hippoplot.o) \
  71.           $(LIBRARY)(hippoplotPS.o) \
  72.           $(LIBRARY)(hippoprint.o) \
  73.           $(MACH_DEP_MEMS)
  74.  
  75.  
  76. # Targets
  77. libs : $(LIB_LIST)
  78.  
  79. debuglibs : $(DEBUGLIB_LIST)
  80.  
  81. lib : links $(LIBRARY)
  82.  
  83. profile :
  84.     $(MAKECOM) -f make.common "FLAVOR=$(FLAVOR)" lib \
  85.         "NAME=$(NAME).profile" "CFLAGS = $(CFLAGS_PROF)"
  86.  
  87. util : nt2text text2nt
  88.  
  89. # Standard libraries with one main plot driver
  90.  
  91. hippoNext :
  92.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  93.        "NAME=$@" "PLOTCFLAGS = -D_NEXT_PLOT_" \
  94.        "MACH_DEP_MEMS=$(LIB_DIR)/lib$@.a(hippoplotNeXT.o) $(LIB_DIR)/lib$@.a(hippowrapsps.o)" \
  95.        "DRVR_INCS = hippoplotNeXT.h hippowrapsps.h"
  96. hippoX11 :
  97.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  98.        "NAME=$@" "PLOTCFLAGS = -D_X11_PLOT_" \
  99.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotX11.o)" \
  100.        "DRVR_INCS = hippoplotX11.h"
  101. hippoXIV :
  102.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  103.        "NAME=$@" "PLOTCFLAGS = -D_XIV_PLOT_" \
  104.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotXIV.o)" \
  105.        "DRVR_INCS = hippoplotXIV.h"
  106. hippoUP :
  107.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  108.        "NAME=$@" "PLOTCFLAGS = -D_UNIXPLOT_PLOT_" \
  109.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotUP.o)" \
  110.        "DRVR_INCS = hippoplotUP.h"
  111. hippo :
  112.     $(MAKE) -f make.common "FLAVOR=`./architecture`" lib
  113.  
  114.  
  115. # debug libraries with one main plot driver
  116.  
  117. hippoNext.debug :
  118.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  119.        "NAME=$@" "PLOTCFLAGS = -D_NEXT_PLOT_" \
  120.        "MACH_DEP_MEMS=$(LIB_DIR)/lib$@.a(hippoplotNeXT.o) $(LIB_DIR)/lib$@.a(hippowrapsps.o)" \
  121.        "DRVR_INCS = hippoplotNeXT.h hippowrapsps.h" \
  122.            "CFLAGS = $(CFLAGS_DEB)"
  123.  
  124. hippoX11.debug :
  125.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  126.        "NAME=$@" "PLOTCFLAGS = -D_X11_PLOT_" \
  127.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotX11.o)" \
  128.        "DRVR_INCS = hippoplotX11.h" \
  129.            "CFLAGS = $(CFLAGS_DEB)"
  130.  
  131. hippoXIV.debug :
  132.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  133.        "NAME=$@" "PLOTCFLAGS = -D_XIV_PLOT_" \
  134.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotXIV.o)" \
  135.        "DRVR_INCS = hippoplotXIV.h" \
  136.            "CFLAGS = $(CFLAGS_DEB)"
  137.  
  138. hippoUP.debug :
  139.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  140.        "NAME=$@" "PLOTCFLAGS = -D_UNIXPLOT_PLOT_" \
  141.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotUP.o)" \
  142.        "DRVR_INCS = hippoplotUP.h" \
  143.            "CFLAGS = $(CFLAGS_DEB)"
  144. hippo.debug :
  145.     $(MAKE) -f make.common "FLAVOR=`./architecture`" lib \
  146.        "NAME=$@" "CFLAGS = $(CFLAGS_DEB)"
  147.  
  148.  
  149. # profile libraries with one main plot driver
  150.  
  151. hippoNext.profile :
  152.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  153.        "NAME=$@" "PLOTCFLAGS = -D_NEXT_PLOT_" \
  154.        "MACH_DEP_MEMS=$(LIB_DIR)/lib$@.a(hippoplotNeXT.o) $(LIB_DIR)/lib$@.a(hippowrapsps.o)" \
  155.        "DRVR_INCS = hippoplotNeXT.h hippowrapsps.h" \
  156.            "CFLAGS = $(CFLAGS_PROF)"
  157. hippoX11.profile :
  158.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  159.        "NAME=$@" "PLOTCFLAGS = -D_X11_PLOT_" \
  160.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotX11.o)" \
  161.        "DRVR_INCS = hippoplotX11.h" \
  162.            "CFLAGS = $(CFLAGS_PROF)"
  163. hippoXIV.profile :
  164.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  165.        "NAME=$@" "PLOTCFLAGS = -D_XIV_PLOT_" \
  166.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotXIV.o)" \
  167.        "DRVR_INCS = hippoplotXIV.h" \
  168.            "CFLAGS = $(CFLAGS_PROF)"
  169. hippoUP.profile :
  170.     $(MAKE) -f make.common "FLAVOR=$(FLAVOR)" lib \
  171.        "NAME=$@" "PLOTCFLAGS = -D_UNIXPLOT_PLOT_" \
  172.        "MACH_DEP_MEMS = $(LIB_DIR)/lib$@.a(hippoplotUP.o)" \
  173.        "DRVR_INCS = hippoplotUP.h" \
  174.            "CFLAGS = $(CFLAGS_PROF)"
  175. hippo.profile :
  176.     $(MAKE) -f make.common "FLAVOR=`./architecture`" lib \
  177.        "NAME=$@" "CFLAGS = $(CFLAGS_PROF)"
  178.  
  179.  
  180. #some of the tar options are not portable, but they are needed.
  181. tar : links
  182.     mkdir hippo
  183.     cd hippo; ln -s ../make.common make.common; \
  184.        ln -s ../make.next make.next; \
  185.        make -f make.common "FLAVOR=next" "SRC_DIR=.." links
  186.     $(RM) $(RMFLAGS) hippo/libhippo*.a
  187.     tar ohvcf hippo.tar hippo
  188.     compress hippo.tar
  189.     $(RM) $(RMFLAGS) -r hippo
  190.  
  191. test : util h_test
  192.     $(BIN_DIR)/h_test 
  193.     diff h_test.out h_test.out2
  194.     $(BIN_DIR)/text2nt example.hiptxt example.hippo2
  195.     $(BIN_DIR)/nt2text example.hippo2 example.hiptxt2
  196.     diff example.hiptxt example.hiptxt2 > /dev/null
  197.     cmp example.hippo example.hippo2
  198.     $(RM) $(RMFLAGS) h_test.out2 example.hippo2 example.hiptxt2
  199.  
  200.  
  201. # When copying or moving files to installation directory, copy to
  202. #  temp file then overwrite original. This solves some pathological 
  203. #  cases where you are moving a link onto its parent file.
  204. install:
  205.     $(MAKE) all
  206.     -@echo   
  207.     -@for LIB in $(INSTALL_LIBS); \
  208.     do \
  209.        LIB=lib$${LIB}.a; \
  210.        if test -f ${LIB_DIR}/$${LIB}; then \
  211.          echo "Moving ${LIB_DIR}/$${LIB} to $(LIB_INSTALLDIR)/"; \
  212.          $(CP) -p ${LIB_DIR}/$${LIB} $(LIB_INSTALLDIR)/$${LIB}.tmp; \
  213.          $(MV) -f $(LIB_INSTALLDIR)/$${LIB}.tmp $(LIB_INSTALLDIR)/$${LIB};\
  214.          $(RANLIB) $(LIB_INSTALLDIR)/$${LIB};\
  215.          if test -f ${LIB_INSTALLDIR}/$${LIB}; then \
  216.            $(RM) $(RMFLAGS) ${LIB_DIR}/$${LIB}; \
  217.          fi; \
  218.        fi; \
  219.     done
  220.     -@for INC in $(INSTALL_INCS); \
  221.     do \
  222.        echo Copying $${INC} to $(INC_INSTALLDIR); \
  223.        $(CP) $${INC} $(INC_INSTALLDIR)/$${INC}.tmp; \
  224.        $(MV) -f $(INC_INSTALLDIR)/$${INC}.tmp $(INC_INSTALLDIR)/$${INC}; \
  225.     done
  226.     -@for BIN in $(INSTALL_BINS); \
  227.     do \
  228.        if test -f ${BIN_DIR}/$${BIN}; then \
  229.          echo "Moving ${BIN_DIR}/$${BIN} to $(BIN_INSTALLDIR)/"; \
  230.          $(CP) -p ${BIN_DIR}/$${BIN} $(BIN_INSTALLDIR)/$${BIN}.tmp; \
  231.          $(MV) -f $(BIN_INSTALLDIR)/$${BIN}.tmp $(BIN_INSTALLDIR)/$${BIN};\
  232.          if test -f ${BIN_INSTALLDIR}/$${BIN}; then \
  233.            $(RM) $(RMFLAGS) ${BIN_DIR}/$${BIN}; \
  234.          fi; \
  235.        fi; \
  236.     done
  237.  
  238.  
  239. # Create links to files in production directory
  240. # the silly echo's are to shut ultrix up
  241. links :
  242.     -@for FILE in $(TARFILES); \
  243.     do \
  244.        if test ! -f $${FILE} -a ! -d $${FILE} -a \
  245.                      -f $(SRC_DIR)/$${FILE}; then \
  246.           echo Linking to $(SRC_DIR)/$${FILE}; \
  247.           rm -f $${FILE}; \
  248.           ln -s $(SRC_DIR)/$${FILE} $${FILE}; \
  249.        fi; \
  250.     done; \
  251.     echo junk > /dev/null
  252.     -@for LIB in $(INSTALL_LIBS); \
  253.     do \
  254.        LIB=lib$${LIB}.a; \
  255.        if test ! -f $(LIB_DIR)/$${LIB} -a \
  256.                              -f $(LIB_INSTALLDIR)/$${LIB}; then \
  257.          echo Linking to $(LIB_INSTALLDIR)/$${LIB}; \
  258.          rm -f $(LIB_DIR)/$${LIB}; \
  259.          ln -s $(LIB_INSTALLDIR)/$${LIB} $(LIB_DIR)/$${LIB}; \
  260.        fi; \
  261.     done; \
  262.     echo junk > /dev/null
  263.  
  264. # Checkin checked out files
  265. checkin :
  266.     -@for FILE in $(SRC_FILES) Makefile; \
  267.     do \
  268.        if test -f $${FILE} -a ! -h $${FILE}; then \
  269.           echo Checkin to $(SRC_DIR)/$${FILE}; \
  270.           checkin $${FILE}; \
  271.        fi; \
  272.     done
  273.  
  274.  
  275. $(LIBRARY) : $(LIBMEMS)
  276.     $(RANLIB) $@
  277.  
  278. nt2text : nt2text.c $(UTIL_LIB)
  279.     $(CC) $(CFLAGS) $@.c -o $(BIN_DIR)/$@ $(LDFLAGS)
  280.  
  281. text2nt : text2nt.c $(UTIL_LIB)
  282.     $(CC) $(CFLAGS) $@.c -o $(BIN_DIR)/$@ $(LDFLAGS)
  283.  
  284. h_test : h_test.c $(UTIL_LIB)
  285.     $(CC) $(CFLAGS) $@.c -o $(BIN_DIR)/$@ $(LDFLAGS)
  286.  
  287. x11test : x11test.c $(UTIL_LIB)
  288.     $(CC) $(CFLAGS) $@.c -o $(BIN_DIR)/$@ $(LDFLAGS)
  289.  
  290. # Note: getarg.c should be in your FORTRAN run time support
  291. hb2hippo :: hb2hippo.f $(UTIL_LIB)
  292.     $(FC) $(FFLAGS) $@.f -o $(BIN_DIR)/$@ $(LDFLAGS) $(HB2HADD)
  293.  
  294.  
  295. $(LIBRARY)(hippontuple.o)  : hippontuple.c  hippo.h hippostruct.h hippoutil.h
  296. $(LIBRARY)(hippodisplay.o) : hippodisplay.c hippo.h hippostruct.h hippoutil.h
  297. $(LIBRARY)(hippoplot.o)    : hippoplot.c    hippo.h hippostruct.h hippoutil.h
  298. $(LIBRARY)(hippoprint.o)   : hippoprint.c   hippo.h hippostruct.h hippoutil.h
  299. $(LIBRARY)(hippoio.o)      : hippoio.c      hippo.h hippostruct.h hippoutil.h
  300. $(LIBRARY)(hippoutil.o)    : hippoutil.c    hippo.h hippostruct.h hippoutil.h
  301. $(LIBRARY)(ntuple-parse.o) : ntuple-parse.c hippo.h hippostruct.h hippoutil.h
  302. $(LIBRARY)(hippoxdr.o)     : hippoxdr.c     hippo.h hippostruct.h hippoutil.h
  303. $(LIBRARY)(fhippo.o)       : fhippo.c       hippo.h hippostruct.h hippoutil.h
  304.  
  305. $(LIBRARY)(hippof.o) : hippof.f
  306.  
  307. $(LIBRARY)(hippoio.o) $(LIBRARY)(hippoxdr.o) : hippoxdr.h
  308.  
  309. # plot drivers: will only be used if included in $(MACH_DEP_MEMS)
  310. $(LIBRARY)(hippoplot.o)    : $(DRVR_INCS) hippoplotPS.h
  311.     $(CC) -c $(CFLAGS) $(PLOTCFLAGS) $<
  312.     $(AR) $(ARFLAGS) $@ $*.o
  313.     $(RM) -f $*.o
  314.  
  315.  
  316. $(LIBRARY)(hippoplotNeXT.o) : hippoplotNeXT.c hippoplotNeXT.h hippowrapsps.h
  317. $(LIBRARY)(hippoplotNeXT.o) : hippo.h hippostruct.h hippoutil.h
  318.  
  319. $(LIBRARY)(hippoplotUP.o) : hippoplotUP.c hippoplotUP.h
  320. $(LIBRARY)(hippoplotUP.o) : hippo.h hippostruct.h hippoutil.h
  321.  
  322. $(LIBRARY)(hippoplotXIV.o) : hippoplotXIV.cc hippoplotXIV.h
  323. $(LIBRARY)(hippoplotXIV.o) : hippo.h hippostruct.h hippoutil.h
  324.  
  325. $(LIBRARY)(hippoplotX11.o) : hippoplotX11.c hippoplotX11.h
  326. $(LIBRARY)(hippoplotX11.o) : hippo.h hippostruct.h hippoutil.h
  327.  
  328. $(LIBRARY)(hippoplotPS.o) : hippoplotPS.c hippoplotPS.h
  329. $(LIBRARY)(hippoplotPS.o) : hippo.h hippostruct.h hippoutil.h
  330.  
  331. $(LIBRARY)(hippowrapsps.o) : hippowrapsps.c
  332. hippowrapsps.c hippowrapsps.h : hippowrapsps.psw
  333.