I have the following in my makefile:
RESULT=`../${TOOLS_ROOT_PATH}/ext_tools.sh 11`; \
set $$RESULT > tMp; \
rm tMp; \
if [ $$# -ne 0 ]; then \
echo copying external-local tool: $< \($$*\); \
mkdir -p ${EXTERNAL_LOCAL_BIN_DIR}/$<; \
cp -f `../${TOOLS_ROOT_PATH}/ext_tools.sh 11` ${EXTERNAL_LOCAL_BIN_DIR}/$< || exit $$?;\
if [ -f $<"-install-script" ]; then \
echo copying $<"-install-script"; \
mkdir -p ${EXTERNAL_LOCAL_BIN_DIR}/install-scripts; \
cp -f $<"-install-script" ${EXTERNAL_LOCAL_BIN_DIR}/install-scripts; \
chmod +x ${EXTERNAL_LOCAL_BIN_DIR}/install-scripts/$<"-install-script"; \
fi; \
fi; \
set `../${TOOLS_ROOT_PATH}/ext_tools.sh 12` > tMp; \
if [ $$# -ne 0 ]; then \
echo copying external-remote tool: $< \($$*\); \
mkdir -p ${EXTERNAL_REMOTE_BIN_DIR}/$<; \
cp -f `../${TOOLS_ROOT_PATH}/ext_tools.sh 11` ${EXTERNAL_REMOTE_BIN_DIR}/$< || exit $$?;\
if [ -f $<"-install-script" ]; then \
echo copying $<"-install-script"; \
mkdir -p ${EXTERNAL_REMOTE_BIN_DIR}/install-scripts; \
cp -f $<"-install-script" ${EXTERNAL_REMOTE_BIN_DIR}/install-scripts; \
chmod +x ${EXTERNAL_REMOTE_BIN_DIR}/install-scripts/$<"-install-script"; \
fi; \
fi; \
rm tMp; \
When ext_tools.sh returned nothing, the $$# in the second if-condition is evaluating to 1. Any idea why it is happening is much appreciated.
+ .././makefiles/tools/ext_tools.sh 11
RESULT=test_tool1
+ set test_tool1
+ rm tMp
+ [ 1 -ne 0 ]
+ echo copying external-local tool: test_tool1 (test_tool1)
copying external-local tool: test_tool1 (test_tool1)
+ mkdir -p /tmp/lmcsrpe/ggsn_ttx/external/local/bin/ttx/external/test_tool1
+ .././makefiles/tools/ext_tools.sh 11
+ cp -f test_tool1 /tmp/lmcsrpe/ggsn_ttx/external/local/bin/ttx/external/test_tool1
+ [ -f test_tool1-install-script ]
+ .././makefiles/tools/ext_tools.sh 12
+ set
+ [ 1 -ne 0 ]
+ echo copying external-remote tool: test_tool1 (test_tool1)
copying external-remote tool: test_tool1 (test_tool1)
+ mkdir -p /tmp/lmcsrpe/ggsn_ttx/external/remote/bin/ttx/external/test_tool1
+ .././makefiles/tools/ext_tools.sh 11
+ cp -f test_tool1 /tmp/lmcsrpe/ggsn_ttx/external/remote/bin/ttx/external/test_tool1
+ [ -f test_tool1-install-script ]
+ rm tMp
Thanks