"Paul D. Smith" <[EMAIL PROTECTED]> writes:
[snip]
> You can add a dummy file into your for-loop then check for it, like
> this:
>
> install_target1: $(SRC_FILES)
> $(INS) ...
> for i in / $(SRC_FILES) ; do \
> case $$i in /) continue ;; esac; \
> echo "Installing $$i"; \
> ...; \
> done
>
> Or, you can test before the for loop:
>
> install_target1: $(SRC_FILES)
> $(INS) ...
> if [ -n "$(SRC_FILES)" ]; then \
> for i in $(SRC_FILES) ; do \
> echo "Installing $$i"; \
> ...; \
> done; \
> fi
Almost :-) (This is still off-topic, but one more piece of trivia...)
Some shells complain about syntax errors in this use of 'for' too. Try
install_target1: $(SRC_FILES)
$(INS) ...
if [ -n "$(SRC_FILES)" ]; then \
for i in ''$(SRC_FILES) ; do \
echo "Installing $$i"; \
...; \
done; \
For those playing find the difference:
- for i in $(SRC_FILES)
+ for i in ''$(SRC_FILES)
The '[ -n "$(SRC_FILES)" ]' check is still needed.
- Hari
--
Raja R Harinath ------------------------------ [EMAIL PROTECTED]
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make