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 7488445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:54:56+00:00 2026-05-29T14:54:56+00:00

ifeq ($(KBUILD_SRC),) I saw the above in Makefile of linux kernel. It doesn’t look

  • 0
ifeq ($(KBUILD_SRC),)

I saw the above in Makefile of linux kernel.

It doesn’t look like regular if statement in most other scripting languages AFAIK.

There’s even no endif closing tag which exists in other places.

How does it work?

  • 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-05-29T14:54:58+00:00Added an answer on May 29, 2026 at 2:54 pm

    ifeq checks if both statements are equal. As the second statement is empty, the statement basicalliy checks wether $KBUILD_SRC is empty/unset. By replacing ifeq with ifneq it sould check whether the variable is set.

    The endif must be somewhere, otherwise there is a syntax error and make will complain.

    And… as Mario already explained, make uses two phases, the first one parses the Makefile and expands all macros, includes, etc. It also evaluates the conditionals. So afterwards all targets are created according the conditionals and other included Makefiles. In the second phase, make uses the targets and their dependencies (on other targets) to actually execute the commands (to build the kernel for example). The first target encountered is used as ‘parent target’, unless the make command included one or more ‘parent targets’

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

Sidebar

Related Questions

I am reading a Makefile from someone else as follows. LDFLAGS=-lm -ljpeg -lpng ifeq
I need to generate a directory in my makefile and I would like to
At the top of my makefile I have the following. USE_44 = 0 ifeq($(USE_44),
So, this is odd. In my makefile I have CC:=icc ifeq ($(CC),icc) CFLAGS :=
I need to find the text 'ifeq ($(Param1)' using grep. I try to assign
How do I express the following logic in a Makefile? if $(XORG_VERSION) > 7.7
Is there a way to tell automake not to interpret part of the Makefile.am?
The problem arises when makefile needs be run on different OS and various setting
I need to have a makefile work under Windows and Cygwin. I having problems
Here is my try: (if (eq system-type 'gnu/linux) (load /usr/share/emacs/site-lisp/site-gentoo) (require 'site-gentoo)) But anyways

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.