Table of Contents
Newsgroups: comp.unix.questions
>Can I use conditions in make file?
>
>E.g.:
>
> [ ${TAG} = tag1 ] && {
> do this
> do that
> }
>
>How can I achive the above behavior?The action (tab-indented) lines in the file are passed to the shell after a small amount of processing on make's part. To do the above, you need to:
you want make to be expanding), then the above example becomes:
[ $${TAG} = tag1 ] && { \
do this; \
do that; \
}just remove one of the $s.)
Ken Pizzini
!! |
$ export TAG=tag1
$ make
[ ${TAG} = tag1 ] && { \
echo "action 1!"; \
echo "action 2!"; \
}
action 1!
action 2!