Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8474591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:40:09+00:00 2026-06-10T17:40:09+00:00

I have a makefile that gives a non-obvious failure when an older version of

  • 0

I have a makefile that gives a non-obvious failure when an older version of gmake is used. I’d like to have a rule that checks the version is at least version 3.82 or later. I’ve gotten as far as the following rule, but the comparison is brittle, I really want a comparison allowing for later versions too:

GMAKE_VERSION :=  $(shell gmake --version | head -n 1 | sed 's/GNU Make //')

.PHONY: testMake
testMake:
    @if [ "$(GMAKE_VERSION)" != "3.82" ];               \
    then                                \
        echo >&2 "Unexpected gmakefile version "        \
            "$(GMAKE_VERSION), expecting 3.82 or later.";   \
        false;                          \
    fi

What GNU makefile rule can ensure the version of make is at least v3.82?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:40:11+00:00Added an answer on June 10, 2026 at 5:40 pm

    Here is how I would implement it:

    # Check Make version (we need at least GNU Make 3.82). Fortunately,
    # 'undefine' directive has been introduced exactly in GNU Make 3.82.
    ifeq ($(filter undefine,$(value .FEATURES)),)
    $(error Unsupported Make version. \
        The build system does not work properly with GNU Make $(MAKE_VERSION), \
        please use GNU Make 3.82 or above.)
    endif
    

    The check is based on testing .FEATURES built-in variable. From GNU Make 3.82 NEWS file:

    New make directive: undefine allows you to undefine a variable so that
    it appears as if it was never set. Both $(flavor) and $(origin) functions
    will return ‘undefined’ for such a variable. To detect this feature search
    for undefine in the .FEATURES special variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Makefile that looks like this CXX = g++ -O2 -Wall all:
I have a Makefile that looks something like this: sometarget: command_one # calls fork()
I have a makefile that looks like: default: lua blah.lua Now, in Vim, I
I have a Makefile.am file right now that looks like this: lib_LIBRARIES = foo.a
I have a gnu Makefile that collects version information through environment variables. Now, I
I have a big makefile that I have configured with several phony targets. One
I have a makefile project that builds and links a DLL, using the command-line
I have a gnu makefile template that has served me well, but when I
I have some demos that I downloaded and they come with a Makefile.win and
I have written a small makefile for a few simple C programs that compiles

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.