[cig-commits] r14717 - mc/1D/hc/trunk

walter at geodynamics.org walter at geodynamics.org
Wed Apr 15 11:48:46 PDT 2009


Author: walter
Date: 2009-04-15 11:48:46 -0700 (Wed, 15 Apr 2009)
New Revision: 14717

Modified:
   mc/1D/hc/trunk/Makefile
   mc/1D/hc/trunk/README.TXT
Log:
Add HC_HOME and make ARCH work better

Modified: mc/1D/hc/trunk/Makefile
===================================================================
--- mc/1D/hc/trunk/Makefile	2009-04-15 18:34:02 UTC (rev 14716)
+++ mc/1D/hc/trunk/Makefile	2009-04-15 18:48:46 UTC (rev 14717)
@@ -17,12 +17,17 @@
 #
 #
 #
+ifdef ARCH
+suffix="/$(ARCH)"
+endif
+ifdef HC_HOME
+prefix="$(HC_HOME)/"
+endif
 # object file directory
-ODIR = objects/$(ARCH)/
+ODIR = "$(prefix)objects$(suffix)"
 #
-#
 # binary directory
-BDIR = bin/$(ARCH)/
+BDIR = "$(prefix)bin$(suffix)"
 
 # include files
 OINCS = hc.h hc_filenames.h sh.h hc_constants.h
@@ -222,21 +227,15 @@
 	grep -v "int main(" > hc_auto_proto.h
 
 dirs:
-	if [ ! -s objects/ ]; then\
-		mkdir objects;\
+	if [ ! -s $(ODIR) ]; then\
+		mkdir -p "$(ODIR)";\
 	fi;
-	if [ ! -s objects/$(ARCH)/ ]; then\
-		mkdir objects/$(ARCH);\
+	if [ ! -s $(BDIR) ]; then\
+		mkdir -p "$(BDIR)";\
 	fi;
-	if [ ! -s bin/ ];then\
-		mkdir bin;\
-	fi;\
-	if [ ! -s bin/$(ARCH) ];then\
-		mkdir bin/$(ARCH);\
-	fi
 
 clean:
-	rm $(ODIR)/*.o  $(ODIR)/*.a
+	rm -f $(ODIR)/*.o  $(ODIR)/*.a
 
 #
 # library

Modified: mc/1D/hc/trunk/README.TXT
===================================================================
--- mc/1D/hc/trunk/README.TXT	2009-04-15 18:34:02 UTC (rev 14716)
+++ mc/1D/hc/trunk/README.TXT	2009-04-15 18:48:46 UTC (rev 14717)
@@ -31,18 +31,21 @@
 
    /usr
 
-3) ARCH: If you like, you can put the binaries in different
-   directories depending on your architecture.  This may be useful is
-   your directories are NFS mounted on different machines.  One way is
-   to use the output of uname
+3) HC_HOME: By default, the object files and binaries will be
+   installed in the "objects/" and "bin/" directories in the current
+   directory.  If HC_HOME is set (e.g. /usr/local/), then they will
+   be installed in $HC_HOME/objects and $HC_HOME/bin.
 
+4) ARCH: If you like, you can put the object files and binaries in
+   different directories depending on your architecture.  This may be
+   useful if your directories are NFS mounted on different machines.
+   One way is to use the output of uname
+
      setenv ARCH `uname -m | gawk '{print(tolower($1))}'`      # sh/tcsh
      export ARCH=`uname -m | gawk '{print(tolower($1))}'`      # bash
 
    On a 32 bit Intel machine, this will put the binaries in bin/i686.
 
-   If ARCH is not set, then the binaries will go in bin/.
-
 Also, the Makefile uses the commonly defined compiler variables CC,
 F90, CFLAGS, LD, and LDFLAGS.  So to make static executables, set
 LDFLAGS="-static"
@@ -192,7 +195,6 @@
 (in Pas) values, reads until end of file. Values determine each layer
 viscosity upward until the next entry. Use the graphical tool
 pvisc.py to edit such files.
-
 2) Depth dependent density scaling file 
 
 r_i d_i



More information about the CIG-COMMITS mailing list