Commit in LCDetectors on MAIN
Makefile+122-131.8 -> 1.9
detectors/make_all_heprep.sh-131.1 removed
         /make_all_lcdd.sh-131.1 removed
         /make_detector_zip.sh-601.5 removed
         /make_lcdd.sh-241.1 removed
         /make_taglist.sh-211.2 removed
         /make_zips.sh-41.1 removed
         /update_detector.sh-381.2 removed
         /update_detectors.sh-51.1 removed
+122-191
8 removed + 1 modified, total 9 files
JM: Move all logic from detector shell scripts into Makefile.  Remove shell scripts.

LCDetectors
Makefile 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- Makefile	16 Sep 2006 22:42:48 -0000	1.8
+++ Makefile	16 Sep 2006 23:53:45 -0000	1.9
@@ -3,70 +3,179 @@
 # build shell scripts.
 #
 
+# SLAC NFS location of GeomConverter.
 ifndef GEOMCONVERTER
-	GEOMCONVERTER=$(PRJ_DIST)/GeomConverter/pro/bin/GeomConverter
+	GEOMCONVERTER=/nfs/slac/g/lcd/mc/prj/sw/dist/GeomConverter/pro/bin/GeomConverter
 endif
 
-rebuild: update_all taglist lcdd_all heprep_all zip_all update_all
+# SLAC NFS location of LCSim website.
+ifndef PRJ_WWW
+	PRJ_WWW=/nfs/slac/g/lcd/mc/prj/www/lcsim/
+endif
+
+# List of all detectors.
+DETECTORS=$(shell cat detectors/taglist.txt)
+
+.DEFAULT: help
+
+help:
+	@echo "----LCDetectors Makefile Targets----" ; \
+	echo ; \
+	echo "ALL DETECTORS"; \
+	echo ; \
+	echo "build_all      - rebuild all detectors"; \
+	echo "update_all     - update detectors to WWW"; \
+	echo "lcdd_all       - make LCDD files for all detectors"; \
+	echo "heprep_all     - make HepRep files for all detectors"; \
+	echo "zip_all        - make zip files for all detectors"; \
+	echo ; \
+	echo "SINGLE DETECTOR"; \
+	echo ; \
+	echo "Define a detector using" ;\
+	echo "  export DETECTOR=detname"; \
+	echo "or" ; \
+	echo "  make DETECTOR=detname" ;\
+	echo ; \
+	echo "build          - rebuild single detector"; \
+	echo "update         - update single detector to WWW"; \
+	echo "lcdd           - make LCDD file for single detector"; \
+	echo "heprep         - make HepRep file for single detector"; \
+	echo "cvs_commit     - commit changes to single detector"; \
+	echo "mkdir          - make directory for new detector"; \
+	echo "template       - copy template files to new detector dir"; \
+	echo "properties     - create detector.properties file for single detector"; \
+	echo "zip            - create zip file for single detector"; \
+	echo "new            - create a new detector"; \
+	echo ; \
+	echo "MISCELLANEOUS"; \
+	echo "taglist        - create detectors/taglist.txt"; \
+	echo "taglist_commit - commit detectors/taglist.txt to CVS"; \
+	echo "cvs_update     - update from LCDetectors CVS";
+	echo ; \
+	echo "Questions or bugs to <[log in to unmask]>";
+
+# Rebuild all detectors.  CAREFUL WITH THIS TARGET.
+build_all: lcdd_all heprep_all zip_all update_all
 
+# Remake the taglist at ./detector/taglist.txt
 taglist:
-	@cd detectors && ./make_taglist.sh
+	@ echo "Creating detector taglist ..." ; \
+	> taglist.txt; \
+	for d in `find detectors -type d -mindepth 1 -maxdepth 1`; do \
+	dd=$$(basename $$d); \
+        if [ -e $$d/compact.xml ]; then \
+            echo $$dd >> taglist.txt ; \
+        fi \
+	done ; \
+	sort taglist.txt > taglist.txt.tmp ; \
+	mv taglist.txt.tmp ./detectors/taglist.txt; \
+	cp taglist.txt /nfs/slac/g/lcd/mc/prj/www/lcsim/detectors; \
+	cat ./detectors/taglist.txt;
 
+# Commit the taglist to the CVS.
 taglist_commit:
 	@cd detectors && cvs commit -m "Update taglist." taglist.txt
 
+# Update from the LCDetectors CVS, getting possibly new detector directories.
 cvs_update:
 	@cd detectors && cvs update -d
 
+# Update each detector the LCDetectors CVS.
 update_all:
-	@cd detectors && ./update_detectors.sh
+	@for detector in $(DETECTORS); do \
+	$(MAKE) update DETECTOR=$$detector; done
 
+# Create the LCDD file for each detector.
 lcdd_all:
-	@cd detectors && ./make_all_lcdd.sh
+	@for detector in $(DETECTORS); do \
+	$(MAKE) lcdd DETECTOR=$$detector; done
 
+# Create the HepRep file for each detector.
 heprep_all:
-	@cd detectors && ./make_all_heprep.sh
+	@for detector in $(DETECTORS); do \
+	$(MAKE) heprep DETECTOR=$$detector; done
 
+# Create the zip file for each detector.
 zip_all:
-	@cd detectors && ./make_zips.sh
+	@for detector in $(DETECTORS); do \
+	$(MAKE) zip DETECTOR=$$detector; done
 
+# Following are targets that are only defined if the
+# DETECTOR variable is defined.  This means the user
+# is currently working on this detector.  These targets
+# are also used by the above targets that operate on all
+# detectors.
 ifdef DETECTOR
 
 # Check for a compact description before doing anything.
 detcheck=$(shell if [ ! -e detectors/$(DETECTOR)/compact.xml ]; then echo "no"; else echo "yes"; fi)
 
+# If the check for the compact description fails, then throw a fatal error.
 ifeq ($(detcheck),no)
 $(error FATAL ERROR: Check for compact description at ./detectors/$(DETECTOR)/compact.xml failed!)
 endif
 
 .PHONY: build update zip lcdd cvs_commit mkdir template properties new
 
+.DEFAULT: build
+
+# Build a single detector.
 build: lcdd zip
 
+# Update detector to the website if necessary.
 update:
-	@cd detectors && ./update_detector.sh $(DETECTOR)
-
-zip:
-	@cd detectors && ./make_detector_zip.sh $(DETECTOR)
+	@if [[ detectors/$(DETECTOR).zip -nt $(PRJ_WWW)/detectors/$(DETECTOR).zip ]]; then \
+		chk_local=$$(md5sum detectors/$(DETECTOR).zip | awk '{print $$1}') ; \
+		chk_www=$$(md5sum $(PRJ_WWW)/detectors/$(DETECTOR).zip | awk '{print $$1}') ; \
+		if [[ $$chk_local != $$chk_www ]]; then \
+			echo "Detector $(DETECTOR) needs update ..."; \
+			echo "Copying detectors/$(DETECTOR).zip to $(PRJ_WWW)/detectors ..."; \
+			cp detectors/$(DETECTOR).zip $(PRJ_WWW)/detectors; \
+		else \
+			echo "$(PRJ_WWW)/detectors/$(DETECTOR).zip is already up-to-date."; \
+		fi \
+	else \
+		echo "Detector $(DETECTOR) is already up-to-date."; \
+	fi
 
+# Create the LCDD file for a single detector.
 lcdd:
-	@cd detectors && ./make_lcdd.sh $(DETECTOR)
+	@echo "Creating LCDD file for $(DETECTOR)..." ; \
+	$(GEOMCONVERTER) -o lcdd ./detectors/$(DETECTOR)/compact.xml ./detectors/$(DETECTOR)/$(DETECTOR).lcdd;
 
+# Create the HepRep file for a single detector.
 heprep:
-	@cd detectors && ./make_heprep.sh $(DETECTOR)
+	@echo "Creating HepRep file for $(DETECTOR)..." ; \
+	$(GEOMCONVERTER) -o heprep ./detectors/$(DETECTOR)/compact.xml ./detectors/$(DETECTOR)/detector.heprep;
 
+# Commit changes to LCDetectors cvs for a single detector.
 cvs_commit:
 	@if [ -d detectors/$(DETECTOR) ]; then cd detectors/$(DETECTOR) && cvs commit -m "Updates to $(DETECTOR) detector."; fi
 
+# Create a new detector directory.
 mkdir:
 	@if [ ! -d detectors/$(DETECTOR) ]; then cd detectors && mkdir $(DETECTOR); fi
 
+# Copy the template files to a detector directory.
 template:
 	@cp -R detectors/template/* detectors/$(DETECTOR)
 
+# Recreate the detector.properties file for a single detector.
 properties:
 	@echo "name: $(DETECTOR)" > detectors/$(DETECTOR)/detector.properties
 
+# Create the zip file for a single detector.
+zip:
+	@echo "Creating zip file for $(DETECTOR) ..."; \
+	if [ -e detectors/$(DETECTOR).zip ]; then rm detectors/$(DETECTOR).zip; fi; \
+	cd detectors/$(DETECTOR); \
+	for f in $$(find . -print | grep -v CVS); do zip -o $(DETECTOR) $$f &> /dev/null; done; \
+	chmod 775 $(DETECTOR).zip; \
+	zipinfo $(DETECTOR).zip; \
+	cd ../..; \
+	mv detectors/$(DETECTOR)/$(DETECTOR).zip detectors;
+
+# Create a new detector.
 new: mkdir template properties
 
 endif

LCDetectors/detectors
make_all_heprep.sh removed after 1.1
diff -N make_all_heprep.sh
--- make_all_heprep.sh	6 Sep 2006 18:20:51 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-for d in $(cat taglist.txt); do
-    if [ -d $d ]; then
-        if [ -e $d/compact.xml ]; then
-            echo $d
-            ./make_heprep.sh $d
-        fi
-    fi
-done
-
-
-

LCDetectors/detectors
make_all_lcdd.sh removed after 1.1
diff -N make_all_lcdd.sh
--- make_all_lcdd.sh	29 Aug 2006 20:15:20 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-for d in $(cat taglist.txt); do
-    if [ -d $d ]; then
-        if [ -e $d/compact.xml ]; then
-            echo $d
-            ./make_lcdd.sh $d
-        fi
-    fi
-done
-
-
-

LCDetectors/detectors
make_detector_zip.sh removed after 1.5
diff -N make_detector_zip.sh
--- make_detector_zip.sh	5 Sep 2006 18:59:51 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-#!/bin/sh
-
-#
-# Simple script to bundle a detector dir
-# as a zip file containing detector.properties
-# and compact.xml detector description.
-#
-
-if [ -z "$1" ]; then
-    echo "ERROR: Missing name of detector to build."
-    exit 1
-fi
-
-if [ ! -d "$1" ]; then
-    echo "ERROR: $1 is not a directory."
-    exit 1
-fi
-
-d=$1
-
-z=$d.zip
-
-echo "Processing $d ..."
-
-if [ -e "$z" ]; then
-    update=$(find $d -newer "$z" | grep -v "CVS")
-else
-    update=yes
-fi
-
-if [ ! -z "$update" ]; then
-
-    echo Zip file for $d needs to be updated ...
-
-    if [ -e "${d}/compact.xml" ]; then
-	(
-	    if [ -e "${d}.zip" ]; then
-		rm $z
-	    fi
-
-	    cd $d
-
-	    for f in $(find . -print | grep -v CVS); do
-		zip -o $d $f &> /dev/null
-	    done
-	)
-
-	mv $d/$d.zip .
-
-	chmod 775 $d.zip
-
-	zipinfo $d.zip
-
-    else
-	echo "ERROR: $d has no compact.xml file."
-    fi
-
-else
-    echo Detector $d is up to date.
-fi

LCDetectors/detectors
make_lcdd.sh removed after 1.1
diff -N make_lcdd.sh
--- make_lcdd.sh	29 Aug 2006 20:15:20 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-#
-# Script to convert all detectors from compact to LCDD.
-#
-# Make sure you have Java 1.5.0 setup before running this.
-#
-
-# Where is your GeomConverter run script?
-if [ -z "$GEOMCONVERTER" ]; then
-    GEOMCONVERTER="${PRJ_DIST}/GeomConverter/pro/bin/GeomConverter"
-fi
-
-if [ -z "$1" ]; then
-  echo "ERROR: Missing detector to convert."
-  exit 1
-fi
-
-f=./$1/compact.xml
-d=$(dirname $f)
-
-$GEOMCONVERTER -o lcdd $f $d.lcdd
-
-mv $d.lcdd $d

LCDetectors/detectors
make_taglist.sh removed after 1.2
diff -N make_taglist.sh
--- make_taglist.sh	29 Aug 2006 19:46:43 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-#
-# Script to create the list of detector tags
-# for www-lcsim. 
-#
-
-> taglist.txt
-
-for d in `find . -type d -mindepth 1 -maxdepth 1`; do
-    if [ -d $d ]; then
-        if [ -e $d/compact.xml ]; then
-            echo $(basename $d) >> taglist.txt 
-        fi
-    fi
-done
-
-sort taglist.txt > taglist.txt.tmp
-mv taglist.txt.tmp taglist.txt
-
-cp taglist.txt /nfs/slac/g/lcd/mc/prj/www/lcsim/detectors

LCDetectors/detectors
make_zips.sh removed after 1.1
diff -N make_zips.sh
--- make_zips.sh	29 Aug 2006 19:33:53 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-#!/bin/sh
-for d in $(cat taglist.txt); do
-  ./make_detector_zip.sh $d
-done

LCDetectors/detectors
update_detector.sh removed after 1.2
diff -N update_detector.sh
--- update_detector.sh	5 Sep 2006 18:57:42 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-if [ -z "$PRJ_WWW" ]; then
-    echo "ERROR: Set PRJ_WWW to lcsim WWW dir."
-    exit 1
-fi
-
-if [ -z "$1" ]; then
-    echo "ERROR: Missing name of detector."
-    exit 1
-fi
-
-d=$1
-
-if [ ! -e "$d.zip" ]; then
-    echo "ERROR: $d.zip does not exist in this directory."
-fi
-
-z=$d.zip
-
-# Check the date.
-if [ $z -nt $PRJ_WWW/detectors/$z ]; then
-
-    # Check the checksum.
-    chk_local=$(md5sum $z | awk '{print $1}')
-    chk_www=$(md5sum $PRJ_WWW/detectors/$z | awk '{print $1'})
-
-    if [[ $chk_local != $chk_www ]]; then
-	echo Detector $d needs update ...
-	echo Copying $z to $PRJ_WWW/detectors ...
-	cp $z $PRJ_WWW/detectors
-    else
-	echo "$PRJ_WWW/detectors/$z is already up-to-date."
-    fi
-
-else
-    echo Detector $d is up to date.
-fi

LCDetectors/detectors
update_detectors.sh removed after 1.1
diff -N update_detectors.sh
--- update_detectors.sh	29 Aug 2006 19:31:53 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-for d in $(cat taglist.txt); do
-  ./update_detector.sh $d
-done
CVSspam 0.2.8