dbf14a6061227ef2dd3212fd6d6ea991c4f52718
Merge parents 1ecdcf6 c1da41a
kent
  Tue May 28 19:08:54 2013 -0700
Fixing merge conflict.
diff --cc src/utils/makefile
index f23ea17,c0de6d9..354b194
--- src/utils/makefile
+++ src/utils/makefile
@@@ -1,180 -1,200 +1,201 @@@
  # Build all directories in utils
  
  include ../inc/common.mk
  
- all:    
- 	@for D in $(USE_DIRS) x; do \
- 	  if test "$$D" != "x" ; then \
- 	    ( cd $$D && echo $$D && $(MAKE) ) ;\
- 	    x=$$? ; if [ $$x -ne 0 ]; then exit $$x ; fi \
- 	    fi ;\
- 	done
- 
- scripts:
- 	@for F in ${SCRIPT_FILES}; do \
- 	    chmod +x $$F; \
- 	    rm -f ${SCRIPTS}/$${F}; \
- 	    echo cp -p $$F ${SCRIPTS}; \
- 	    cp -p $$F ${SCRIPTS}; \
- 	 done
- 	chmod +x genePredToBed/genePredToBed;
- 	rm -f ${SCRIPTS}/genePredToBed;
- 	echo cp -p genePredToBed/genePredToBed ${SCRIPTS};
- 	@cp -p genePredToBed/genePredToBed ${SCRIPTS};
- 
- alpha: scripts all
- 
- test:
- 	cd faToTwoBit && ${MAKE} test
- 	cd twoBitToFa && ${MAKE} test
- 	cd twoBitInfo && ${MAKE} test
- 	cd pslLiftSubrangeBlat && ${MAKE} test
- 	cd bedGeneParts && ${MAKE} test
- 
- clean:
- 	@for D in $(USE_DIRS) x; do \
- 	  if test "$$D" != "x" ; then \
- 	    ( cd $$D && echo $$D && $(MAKE) clean ) ;\
- 	    x=$$? ; if [ $$x -ne 0 ]; then exit $$x ; fi \
- 	    fi ;\
- 	done
- 	touch non-empty-rm.o
- 	- find . -name \*.o -print | xargs rm
- 
- SCRIPT_FILES = \
-         agpToLift \
-         bedCollapse.pl \
-         iSync \
-         lodToBedScore \
- 	mkMafFrames.pl
+ # note: lists such as the following need to be defined *before*
+ # they are used in the wildcard target rules.  An oddity of gnu make
  
- # List of directories to build
- USE_DIRS = $(DIRS)
+ # define the list of user applications to build
  
- DIRS = \
- 	aNotB \
+ UTILS_APPLIST = \
  	addCols \
  	ave \
  	aveCols \
  	bedClip \
- 	bedCommonRegions \
- 	bedGeneParts \
  	bedGraphToBigWig \
- 	bedPileUps \
- 	bedRemoveOverlap \
- 	bedRestrictToPositions \
  	bedToBigBed \
  	bigBedInfo \
  	bigBedNamedItems \
  	bigBedSummary \
  	bigBedToBed \
- 	bigWigAverageOverBed \
+ 	bedCommonRegions \
+ 	bedGeneParts \
+ 	bedPileUps \
+ 	bedRemoveOverlap \
+ 	bedRestrictToPositions \
+ 	bigWigAverageOverBed  \
 +	bigWigCorrelate \
  	bigWigInfo \
  	bigWigMerge \
  	bigWigSummary \
  	bigWigToBedGraph \
  	bigWigToWig \
  	calc \
  	catDir \
  	catUncomment \
- 	ccCp \
  	chopFaLines \
  	colTransform \
  	countChars \
- 	convolve \
- 	detab \
- 	endsInLf \
  	fastqToFa \
- 	faAlign \
  	faCmp \
  	faCount \
  	faFilterN \
  	faFilter \
- 	faFlyBaseToUcsc \
  	faFrag \
- 	faGapLocs \
- 	faGapSizes \
- 	faNcbiToUcsc \
  	faNoise \
  	faOneRecord \
  	faPolyASizes \
  	faRandomize \
  	faRc \
- 	faSimplify \
  	faSize \
  	faSomeRecords \
  	faSplit \
  	faToFastq \
- 	faToNib \
  	faToTab \
  	faToTwoBit \
  	faTrans \
- 	faTrimPolyA \
- 	faTrimRead \
  	findMotif \
- 	fixCr \
- 	gapSplit \
- 	gffPeek \
- 	git-reports \
- 	gitTools \
  	headRest \
- 	htmlPics \
  	htmlCheck \
- 	jkUniq \
- 	lineCount \
  	newProg \
  	nibFrag \
  	nibSize \
- 	nt4Frag \
  	paraFetch \
  	paraSync \
  	pslLiftSubrangeBlat \
  	pslToPslx \
- 	pslToXa \
  	randomLines \
  	raSqlQuery \
  	raToTab \
  	raToLines \
  	rmFaDups \
  	rowsToCols \
- 	scaffoldFaToAgp \
- 	scrambleFa \
  	sizeof \
  	spacedToTab \
  	splitFile \
  	splitFileByColumn \
  	stringify \
  	subChar \
  	subColumn \
- 	subs \
- 	tableSum \
  	tailLines \
- 	textHist2 \
  	textHistogram \
  	tickToDate \
  	timing \
  	toLower \
  	toUpper \
- 	twoBitInfo \
+ 	twoBitDup \
+         twoBitInfo \
  	twoBitToFa \
+ 	wigCorrelate \
+ 	wigToBigWig \
+ 	wordLine
+ 
+ # list of utilities to build of interest only at UCSC
+ 
+ UCSC_APPS = \
+ 	addCols \
+ 	aNotB \
+ 	aveCols \
+ 	ccCp \
+ 	convolve \
+ 	detab \
+ 	endsInLf \
+ 	faAlign \
+ 	faFlyBaseToUcsc \
+ 	faGapLocs \
+ 	faGapSizes \
+ 	faNcbiToUcsc \
+ 	faSimplify \
+ 	faToNib \
+ 	faTrimPolyA \
+ 	faTrimRead \
+ 	fixCr \
+ 	gapSplit \
+ 	gffPeek \
+ 	git-reports \
+ 	gitTools \
+ 	htmlPics \
+ 	jkUniq \
+ 	lineCount \
+ 	nt4Frag \
+ 	pslToXa \
+ 	scaffoldFaToAgp \
+ 	scrambleFa \
+ 	subs \
+ 	tableSum \
+ 	textHist2 \
  	udcCleanup \
  	undupFa \
  	upper \
  	venn \
  	verticalSplitSqlTable \
  	weedLines \
- 	wigCorrelate \
- 	wigToBigWig \
- 	wigTestMaker \
- 	wordLine
+ 	wigTestMaker
+ 
+ # list of scripts to install
+ 
+ SCRIPT_FILES = \
+         agpToLift \
+         bedCollapse.pl \
+         iSync \
+         lodToBedScore \
+ 	mkMafFrames.pl
+ 
+ # List of all directories to build
+ 
+ ALL_APPS = $(UTILS_APPLIST) $(UCSC_APPS)
+ 
+ # all: builds all utilities here
+ 
+ all: $(ALL_APPS:%=%.all)
+ 
+ %.all:
+ 	cd $* && echo $* && $(MAKE)
+ 
+ # userAppsB: builds the user application specific programs
+ # it would have been nice to be able to use the target name 'userApps'
+ # here, but there is a directory by that name, and thus it always exists
+ # and so the target does nothing.
+ 
+ userAppsB: $(UTILS_APPLIST:%=%.userApps)
+ 
+ %.userApps:
+ 	cd $* && echo $* && $(MAKE)
+ 
+ scripts: $(SCRIPT_FILES:%=%.scripts)
+ 	chmod +x genePredToBed/genePredToBed;
+ 	rm -f ${SCRIPTS}/genePredToBed;
+ 	echo cp -p genePredToBed/genePredToBed ${SCRIPTS};
+ 	@cp -p genePredToBed/genePredToBed ${SCRIPTS};
+ 
+ %.scripts:
+ 	chmod +x $*
+ 	rm -f ${SCRIPTS}/$*
+ 	echo cp -p $* ${SCRIPTS}
+ 	cp -p $* ${SCRIPTS}
+ 
+ alpha: scripts all
+ 
+ test:
+ 	cd faToTwoBit && ${MAKE} test
+ 	cd twoBitToFa && ${MAKE} test
+ 	cd twoBitInfo && ${MAKE} test
+ 	cd pslLiftSubrangeBlat && ${MAKE} test
+ 	cd bedGeneParts && ${MAKE} test
+ 
+ clean: $(ALL_APPS:%=%.clean)
+ 	touch non-empty-rm.o
+ 	- find . -name \*.o -print | xargs rm
+ 
+ %.clean:
+ 	cd $* && echo $* && $(MAKE) clean
  
  BAD_DIRS= \
  	ccCpLock \
  	est2genomeToPsl \
  	geneStarts \
  	jimgrep \
  	jkShell \
  	dnsInfo \
  	wigAsciiToBinary \
  	cCp