[EMAIL PROTECTED] wrote:
a. should I ask user to pass some env variable such as KVER=2.4 or KVER=2.6 at
the make command line and then check the $(KVER) and setup the flags
accordingly.
Well that's one way to do it, if you can't do autodetection of the
version that you are trying to build.
Also is it possible to check for empty variable and exist with some error msg
like following
check_ver:
ifeq ($(strip $(KVER)),)
@echo "Error: Please set KVER"
Endif
That's not going to work because you've got a tab before ifeq and endif
which means GNU Make is going to pass them to the shell and those are
internal GNU Make preprocessor commands.
My recommendation is not to do the checking of KVER in a rule (because
that rule might never get run). Instead just check KVER in the Makefile
at the start and using $(error) to output the message.
ifeq ($(strip $(KVER)),)
$(error Please set KVER before running Make)
endif
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
POPFile: http://getpopfile.org/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make