13488a498e6b5238accdbf32c140ed30e30d173c
hiram
  Mon May 20 14:48:43 2024 -0700
correctly get mkSymLinks to run before mkGenomes refs #29545

diff --git src/hg/makeDb/doc/asmHubs/asmHubs.mk src/hg/makeDb/doc/asmHubs/asmHubs.mk
index eca83f4..85d2512 100644
--- src/hg/makeDb/doc/asmHubs/asmHubs.mk
+++ src/hg/makeDb/doc/asmHubs/asmHubs.mk
@@ -1,25 +1,31 @@
 # generic makefile to construct the index pages and symlinks
 # for any assembly hub
 #
 # will be included by those individual build directories with the
 # following variables defined to customize the resulting files:
 #
 # destDir, srcDir, orderList, indexName, testIndexName,
 # statsName, testStatsName, dataName, testDataName, genomesTxt, hubFile
 # testHubFile, Name and name
 
+# the .PHONY will make sure these targets run even if there happens to be
+#    a file by the same name existing.  These rules don't make these files,
+#    they are just procedures to run.
+
+.PHONY: sanityCheck makeDirs mkGenomes symLinks hubIndex asmStats trackData hubTxt groupsTxt
+
 toolsDir=${HOME}/kent/src/hg/makeDb/doc/asmHubs
 htdocsHgDownload=/usr/local/apache/htdocs-hgdownload
 hubsDownload=${htdocsHgDownload}/hubs/${name}
 asmHubSrc=/hive/data/genomes/asmHubs/${name}
 downloadDest1=hgdownload1.soe.ucsc.edu
 downloadDest2=hgdownload2.soe.ucsc.edu
 # 2024-02-06 hgdownload2.gi.ucsc.edu has address 128.114.198.53
 
 all:: sanityCheck makeDirs mkGenomes symLinks hubIndex asmStats trackData hubTxt groupsTxt
 
 makeDirs:
 	mkdir -p ${destDir}
 
 sanityCheck:
 	@goodBad=$$(cut -d'_' -f1-2 ${orderList} | sort | uniq -c | awk '$$1 > 1' | wc -l); \
@@ -28,32 +34,36 @@
 	    echo "ERROR: duplicate accession in '$$tsvFile'"; \
 	    cut -d'_' -f1-2 ${orderList} | sort | uniq -c | awk '$$1 > 1'; \
 	    exit 255; \
 	fi
 
 sshKeyDownload:
 	ssh -o PasswordAuthentication=no qateam@${downloadDest1} date
 	ssh -o PasswordAuthentication=no qateam@${downloadDest2} date
 
 sshKeyDynablat:
 	ssh -o PasswordAuthentication=no qateam@dynablat-01 date
 
 sshKeyCheck: sshKeyDownload sshKeyDynablat
 	@printf "# ssh keys to hgdownload and dynablat-01 are good\n"
 
-mkGenomes:: symLinks
+# mkGenomes needs symLinks to run before mkGenomes runs, and then
+# the second symLinks after mkGenomes uses business created by mkGenomes
+
+mkGenomes::
 	@printf "# starting mkGenomes " 1>&2
+	${toolsDir}/mkSymLinks.pl ${orderList}
 	@date "+%s %F %T" 1>&2
 	@rm -f hasChainNets.txt
 	${toolsDir}/mkGenomes.pl dynablat-01 4040 ${orderList} > ${destDir}/${genomesTxt}.txt
 	rm -f ${destDir}/download.${genomesTxt}.txt
 	cp -p ${destDir}/${genomesTxt}.txt ${destDir}/download.${genomesTxt}.txt
 	@printf "# finished mkGenomes " 1>&2
 	@date "+%s %F %T" 1>&2
 
 symLinks::
 	${toolsDir}/mkSymLinks.pl ${orderList}
 	@[ -d ${hubsDownload} ] && true || mkdir ${hubsDownload}
 	@for html in ${indexName} ${statsName} ${dataName} ; do \
 [ -L ${hubsDownload}/$${html}.html ] && true || ln -s ${asmHubSrc}/$${html}.html ${hubsDownload} ; \
 [ -L ${hubsDownload}/download.$${html}.html ] && true || ln -s ${asmHubSrc}/download.$${html}.html ${hubsDownload} ; \
 done