Index: /trunk/dvodist/EXAMPLE
===================================================================
--- /trunk/dvodist/EXAMPLE	(revision 39556)
+++ /trunk/dvodist/EXAMPLE	(revision 39557)
@@ -18,7 +18,6 @@
   NOTE: run in dvodist subdir
 
-* copy a Makefile from one of the older distribtions
-
-* modify the makefile to point at the new directories
+* create a Makefile:
+  ../scripts/copy.makefile 3pi-pv0-20120509 3pi.pv0.20120509
 
 * add the makefile entry to the dvodist/Makefile.in, eg:
Index: /trunk/dvodist/Makefile.in
===================================================================
--- /trunk/dvodist/Makefile.in	(revision 39556)
+++ /trunk/dvodist/Makefile.in	(revision 39557)
@@ -87,12 +87,22 @@
 IPPDATA = $(IPPDATA-RAW) $(IPPDATA-MKD)
 
-include $(SRC-DVODIST)/3pi.20120509/Makefile
-include $(SRC-DVODIST)/3pi.20120525/Makefile
-include $(SRC-DVODIST)/3pi.20120606/Makefile
-include $(SRC-DVODIST)/3pi.20130227/Makefile
-include $(SRC-DVODIST)/3pi.20140621/Makefile
-include $(SRC-DVODIST)/3pi.20140713/Makefile
-include $(SRC-DVODIST)/LAP.3pi.PV1/Makefile
-include $(SRC-DVODIST)/lap.pv2.20141215/Makefile
+# include $(SRC-DVODIST)/3pi.20120509/Makefile
+# include $(SRC-DVODIST)/3pi.20120525/Makefile
+# include $(SRC-DVODIST)/3pi.20120606/Makefile
+# include $(SRC-DVODIST)/3pi.20130227/Makefile
+# include $(SRC-DVODIST)/3pi.20140621/Makefile
+# include $(SRC-DVODIST)/3pi.20140713/Makefile
+# include $(SRC-DVODIST)/LAP.3pi.PV1/Makefile
+# include $(SRC-DVODIST)/lap.pv2.20141215/Makefile
+
+include $(SRC-DVODIST)/3pi.pv0.20120509/Makefile
+include $(SRC-DVODIST)/3pi.pv0.20120525/Makefile
+include $(SRC-DVODIST)/3pi.pv0.20120606/Makefile
+include $(SRC-DVODIST)/3pi.pv0.20130227/Makefile
+include $(SRC-DVODIST)/3pi.pv0.20140621/Makefile
+include $(SRC-DVODIST)/3pi.pv0.20140713/Makefile
+include $(SRC-DVODIST)/3pi.pv1.20130708/Makefile
+include $(SRC-DVODIST)/3pi.pv2.20141215/Makefile
+include $(SRC-DVODIST)/3pi.pv3.20160422/Makefile
 include $(SRC-DVODIST)/3pi.20120525.tables/Makefile
 include $(SRC-DVODIST)/3pi.20130227.tables/Makefile
@@ -100,12 +110,13 @@
 
 DVODIST_DIRS = \
-$(DIST-3pi-20120509) \
-$(DIST-3pi-20120525) \
-$(DIST-3pi-20120606) \
-$(DIST-3pi-20130227) \
-$(DIST-3pi-20140621) \
-$(DIST-3pi-20140713) \
-$(DIST-LAP-3pi-PV1) \
-$(DIST-lap-pv2-20141215) \
+$(DIST-3pi-pv0-20120509) \
+$(DIST-3pi-pv0-20120525) \
+$(DIST-3pi-pv0-20120606) \
+$(DIST-3pi-pv0-20130227) \
+$(DIST-3pi-pv0-20140621) \
+$(DIST-3pi-pv0-20140713) \
+$(DIST-3pi-pv1-20130708) \
+$(DIST-3pi-pv2-20141215) \
+$(DIST-3pi-pv3-20160422) \
 $(DIST-3pi-20120525-tables) \
 $(DIST-3pi-20130227-tables) \
@@ -138,8 +149,14 @@
 
 # mkd files are used to generate php files
-$(TGT-DVODIST)/%.php: $(SRC-DVODIST)/%.mkd
+$(TGT-DVODIST)/%.mkd: $(SRC-DVODIST)/%.mkd
+	@if [ ! -d $(@D) ]; then mkdir -p $(@D) || exit; fi
+	rm -f $(TGT-DVODIST)/$*.mkd || exit
+	cp -f $(SRC-DVODIST)/$*.mkd $(TGT-DVODIST)/$*.mkd || exit
+
+# mkd files are used to generate php files
+$(TGT-DVODIST)/%.php: $(TGT-DVODIST)/%.mkd
 	@if [ ! -d $(@D) ]; then mkdir -p $(@D) || exit; fi
 	rm -f $(TGT-DVODIST)/$*.php || exit
-	$(GENERATE) $(SRC-DVODIST)/$*.mkd $(TGT-DVODIST)/$*.php || exit
+	$(GENERATE) $(TGT-DVODIST)/$*.mkd $(TGT-DVODIST)/$*.php || exit
 
 # non-generated php code is copied directly
@@ -158,8 +175,14 @@
 
 # mkd files are used to generate php files
-$(TGT-IPPDATA)/%.php: $(SRC-IPPDATA)/%.mkd
+$(TGT-IPPDATA)/%.mkd: $(SRC-IPPDATA)/%.mkd
 	@if [ ! -d $(@D) ]; then mkdir -p $(@D) || exit; fi
 	rm -f $(TGT-IPPDATA)/$*.php || exit
-	$(GENERATE) $(SRC-IPPDATA)/$*.mkd $(TGT-IPPDATA)/$*.php || exit
+	cp -f $(SRC-IPPDATA)/$*.mkd $(TGT-IPPDATA)/$*.mkd || exit
+
+# mkd files are used to generate php files
+$(TGT-IPPDATA)/%.php: $(TGT-IPPDATA)/%.mkd
+	@if [ ! -d $(@D) ]; then mkdir -p $(@D) || exit; fi
+	rm -f $(TGT-IPPDATA)/$*.php || exit
+	$(GENERATE) $(TGT-IPPDATA)/$*.mkd $(TGT-IPPDATA)/$*.php || exit
 
 # non-generated php code is copied directly
@@ -181,4 +204,5 @@
 	rm -f `find . -name "#*"`
 
+.PRECIOUS: $(TGT-DVODIST)/%.mkd
 .PRECIOUS: $(SRC)/%.mkd
 .PRECIOUS: $(SRC)/%.php
Index: /trunk/dvodist/dvodist/Makefile.in
===================================================================
--- /trunk/dvodist/dvodist/Makefile.in	(revision 39557)
+++ /trunk/dvodist/dvodist/Makefile.in	(revision 39557)
@@ -0,0 +1,26 @@
+DIST-MAKENAME = \
+$(TGT-DVODIST)/DIRNAME/n0000/index.php \
+$(TGT-DVODIST)/DIRNAME/n0730/index.php \
+$(TGT-DVODIST)/DIRNAME/n1500/index.php \
+$(TGT-DVODIST)/DIRNAME/n2230/index.php \
+$(TGT-DVODIST)/DIRNAME/n3000/index.php \
+$(TGT-DVODIST)/DIRNAME/n3730/index.php \
+$(TGT-DVODIST)/DIRNAME/n4500/index.php \
+$(TGT-DVODIST)/DIRNAME/n5230/index.php \
+$(TGT-DVODIST)/DIRNAME/n6000/index.php \
+$(TGT-DVODIST)/DIRNAME/n6730/index.php \
+$(TGT-DVODIST)/DIRNAME/n7500/index.php \
+$(TGT-DVODIST)/DIRNAME/n8230/index.php \
+$(TGT-DVODIST)/DIRNAME/s0000/index.php \
+$(TGT-DVODIST)/DIRNAME/s0730/index.php \
+$(TGT-DVODIST)/DIRNAME/s1500/index.php \
+$(TGT-DVODIST)/DIRNAME/s2230/index.php \
+$(TGT-DVODIST)/DIRNAME/s3000/index.php \
+$(TGT-DVODIST)/DIRNAME/s3730/index.php \
+$(TGT-DVODIST)/DIRNAME/s4500/index.php \
+$(TGT-DVODIST)/DIRNAME/s5230/index.php \
+$(TGT-DVODIST)/DIRNAME/s6000/index.php \
+$(TGT-DVODIST)/DIRNAME/s6730/index.php \
+$(TGT-DVODIST)/DIRNAME/s7500/index.php \
+$(TGT-DVODIST)/DIRNAME/s8230/index.php \
+$(TGT-DVODIST)/DIRNAME/index.php
Index: /trunk/dvodist/scripts/copy.makefile
===================================================================
--- /trunk/dvodist/scripts/copy.makefile	(revision 39557)
+++ /trunk/dvodist/scripts/copy.makefile	(revision 39557)
@@ -0,0 +1,9 @@
+#!/bin/csh -f
+
+if ($#argv != 2) then
+  echo "USAGE: copy.makefile (makename) (dirname)"
+  echo "   eg: copy.makefile (3pi-pv0-20120509) (3pi.pv0.20120509)"
+  exit 2
+endif
+
+cat Makefile.in | sed s/MAKENAME/$1/ | sed s/DIRNAME/$2/ > $2/Makefile
Index: /trunk/dvodist/scripts/fix.pv3
===================================================================
--- /trunk/dvodist/scripts/fix.pv3	(revision 39557)
+++ /trunk/dvodist/scripts/fix.pv3	(revision 39557)
@@ -0,0 +1,17 @@
+#/bin/csh -fh
+
+if ($#argv != 1) then
+ echo "USAGE: fix.pv3 (file)"
+ exit 2
+endif
+
+sed s/pv3.3pi/3pi.pv3/ $1 > tmp
+if ($status) exit 1
+
+mv -f $1 `mktemp`
+if ($status) exit 1
+
+mv tmp $1
+if ($status) exit 1
+
+exit 0
Index: /trunk/dvodist/scripts/fix.pv3.v2
===================================================================
--- /trunk/dvodist/scripts/fix.pv3.v2	(revision 39557)
+++ /trunk/dvodist/scripts/fix.pv3.v2	(revision 39557)
@@ -0,0 +1,17 @@
+#/bin/csh -fh
+
+if ($#argv != 1) then
+ echo "USAGE: fix.pv3 (file)"
+ exit 2
+endif
+
+sed s/PV3/PV0/ $1 > tmp
+if ($status) exit 1
+
+mv -f $1 `mktemp`
+if ($status) exit 1
+
+mv tmp $1
+if ($status) exit 1
+
+exit 0
Index: /trunk/dvodist/scripts/mkdist.3pi.pv0.20120509.sh
===================================================================
--- /trunk/dvodist/scripts/mkdist.3pi.pv0.20120509.sh	(revision 39556)
+++ /trunk/dvodist/scripts/mkdist.3pi.pv0.20120509.sh	(revision 39557)
@@ -16,5 +16,5 @@
 
 # top-level files
-if (1) then
+if (0) then
   mkdir -p $cattgt
   foreach file (HostTable.dat Images.dat Photcodes.dat SkyTable.fits flatcorr.fits)
@@ -29,5 +29,6 @@
 
 # link all files from all hostdirs into all DEC dirs
-foreach hostdir (`grep -v \# $cattgt/HostTable.dat | awk '{print $3}'`)
+foreach hostdir (`grep -v \# $cattgt/HostTable.dat | grep ipp0\[345\] | awk '{print $3}'`)
+# foreach hostdir (`grep -v \# $cattgt/HostTable.dat | awk '{print $3}'`)
   echo $hostdir
   foreach dir ($nlist $slist)
Index: /trunk/dvodist/scripts/run.mkindex
===================================================================
--- /trunk/dvodist/scripts/run.mkindex	(revision 39557)
+++ /trunk/dvodist/scripts/run.mkindex	(revision 39557)
@@ -0,0 +1,1 @@
+../scripts/mkindex.dvo.pl /export/ippc32.0/www/dvodist/www-root/3pi.pv0.20120606 DVO Release PV3 3pi 20120606 dvodist > & log.3pi.pv0.20120606.mkindex &
Index: /trunk/dvodist/www-util/dvodist.page.mkd
===================================================================
--- /trunk/dvodist/www-util/dvodist.page.mkd	(revision 39556)
+++ /trunk/dvodist/www-util/dvodist.page.mkd	(revision 39557)
@@ -14,5 +14,6 @@
   $rootdir = "@ROOTWWW@";
  } else {
-  $rootdir = "@ROOTWWW@@ROOTDIR@";
+// $rootdir = "@ROOTWWW@@ROOTDIR@";
+  $rootdir = "@ROOTWWW@";
  }
 
