ebd69ed96b9efc5289fe2a2490ddc06f818a393b
angie
  Fri May 22 12:45:28 2015 -0700
common.mk: auto-detect hgwdev's installation of node.js tools.
If jshint, jsxhint, jsx and/or uglifyjs are installed, set the corresponding
JSHINT etc. variables; if not found, set variable to 'true' so makefile can
invoke those steps without any effect (in which case the precompiled files
in hg/js/react/bundle/ will not reflect any changes made to *.jsx).

diff --git src/inc/common.mk src/inc/common.mk
index 63ef57f..987cb81 100644
--- src/inc/common.mk
+++ src/inc/common.mk
@@ -393,19 +393,48 @@
 endif
 
 #ENCODE COMMON VARIABLES
 CONFIG_FILES = \
 	fields.ra \
 	labs.ra
 CV = cv.ra
 CVDIR=${HOME}/kent/src/hg/makeDb/trackDb/cv/alpha
 PIPELINE_PATH=/hive/groups/encode/dcc/pipeline
 CONFIG_DIR = ${PIPELINE_PATH}/${PIPELINE_DIR}/config
 ENCODEDCC_DIR = ${PIPELINE_PATH}/downloads/encodeDCC
 
 %.o: %.c
 	${CC} ${COPT} ${CFLAGS} ${HG_DEFS} ${LOWELAB_DEFS} ${HG_WARN} ${HG_INC} ${XINC} -o $@ -c $<
 
-# jshint: off unless JSHINT is already in environment
+# autodetect UCSC installation of node.js:
+ifeq (${NODEBIN},)
+    NODEBIN = /cluster/software/src/node-v0.10.24-linux-x64/bin
+    ifeq ($(wildcard ${NODEBIN}),)
+	NODEBIN=
+    endif
+endif
+
+# node.js tools: jshint, jsx, jsxhint, uglifyjs, ...
 ifeq (${JSHINT},)
+    JSHINT=${NODEBIN}/jshint
+    ifeq ($(wildcard ${JSHINT}),)
 	    JSHINT=true
     endif
+endif
+ifeq (${JSXHINT},)
+    JSXHINT=${NODEBIN}/jsxhint
+    ifeq ($(wildcard ${JSXHINT}),)
+        JSXHINT=true
+    endif
+endif
+ifeq (${JSX},)
+    JSX=${NODEBIN}/jsx
+    ifeq ($(wildcard ${JSX}),)
+        JSX=true
+    endif
+endif
+ifeq (${UGLIFYJS},)
+    UGLIFYJS=${NODEBIN}/uglifyjs
+    ifeq ($(wildcard ${UGLIFYJS}),)
+        UGLIFYJS=true
+    endif
+endif