help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bizarre "missing endif"


From: Aditya Kher
Subject: Re: Bizarre "missing endif"
Date: Wed, 14 Feb 2007 12:27:13 +0530

I see at least couple of "if" statements without matching endif (higlighted). These could be the culprits.

I did not run this but this is by inspection.


$$( if $$(filter $$(MAKE_VERSION),3.81),,1)
$$(call debug,WRONG_MAKE_VERSION = $$(WRONG_MAKE_VERSION))
$$(if $$(filter 1,$$(WRONG_MAKE_VERSION)),$$
(warning This build system requires GNU make 3.81 --should get PASSED))
endef

And btw, if all you are trying to is to prevent user from proceeding (and also  warning him along the way) unless he uses correct version of make then why not use something simple as follows. Lot easier to maintain and debug

------
define MAKE_VERSION_ERROR_MSG

Error: This Makefile uses features available in GNU Make 3.80 onwards.
Please use GNU Make version 3.80 or higher
endef

#
# Error out if the Make Version is lower than 3.80
# Since we use order-only pre requisites avilable from GNU Make 3.80 or higher
#
ifneq (3.80,$(firstword $(sort $(MAKE_VERSION) 3.80)))
$(error ${MAKE_VERSION_ERROR_MSG})
endif
----------


On 2/13/07, David Greene <address@hidden> wrote:
> I'm trying to construct a system that reinvokes make 3.81 if
> make 3.80 is initially used to attempt a build.  I've attached
> a testcase showing the general structure.
>
> Make 3.80 complains about a missing endif.  Why?
>
>                                  -Dave
>
> define invoke_correct_make_impl
>
> $(warning here 2.1)
> .SUFFIXES:
>
> .PHONY: invoke_correct_make
> invoke_correct_make_rule:
>         +echo PASSED
>
> Makefile : ;
> %.mk :: ;
>
> % :: invoke_correct_make_rule ; :
> $(warning here 2.2)
>
> endef
>
> invoke_correct_make = $(warning here 2.0) $(eval $(call invoke_correct_make_impl)) $(warning here 2.3)
>
> $(check_make_version)
>
> $(warning here 1)
>
> ifeq ($(WRONG_MAKE_VERSION),1)
> $(warning here 2)
> $(call invoke_correct_make)
> $(warning here 3)
> endif
>
> $(warning here 4)
>
> all:
>         @echo Already running GNU make 3.81
>
>
> # Check make version.
> define check_make_version_impl
> WRONG_MAKE_VERSION := $$(if $$(filter $$(MAKE_VERSION), 3.81),,1)
> $$(call debug,WRONG_MAKE_VERSION = $$(WRONG_MAKE_VERSION))
> $$(if $$(filter 1,$$(WRONG_MAKE_VERSION)),$$(warning This build system requires GNU make 3.81 --should get PASSED))
> endef
>
> check_make_version = $(eval $(call check_make_version_impl))
>
> include second.mk
>
>
> include top.mk
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>
>


--
Aditya Kher
http://kher.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]