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

  • Home
  • SEARCH
  • 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 8184769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:37:06+00:00 2026-06-07T01:37:06+00:00

Are := and += same in Linux Kernel Makefiles and could be used interchangeably?

  • 0

Are := and += same in Linux Kernel Makefiles and could be used interchangeably? If not, then what is the difference between the two ?

  • 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-07T01:37:08+00:00Added an answer on June 7, 2026 at 1:37 am

    As others say, := is assignment.

    But there’s a fine difference between := and =. In most cases it doesn’t matter, but it may make a big difference.

    X = $(Y) defines X as a recursive variable, which is something like a C preprocessor macro.
    Whenever X is referenced, the value of Y will be used.
    The expansion happens when X is expanded. So you can define Y after you’ve defined X, and it’s OK.

    X := $(Y) defines X as a simple variable. This is more like a C assignment.
    Now, Y is expanded at the time of definition, so changing it later will do nothing.

    X += $(Y) appends to X, but keeps its type.
    If X was previously defined with =, Y will not be expanded immediately. Same if X was never defined.
    If X was previously defined with :=, Y will be expanded immediately.

    You can try this exmaple makefile:

    X = 1
    
    Y  = $(X)
    Z := $(X)
    
    X = 2
    
    Y += $(X)
    Z += $(X)
    
    X = 3
    
    test:
            @echo "Y = $(Y)"
            @echo "Z = $(Z)"
    

    It prints

    Y = 3 3
    Z = 1 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is the Linux kernel preemptive or not? There is a big difference between Understanding
I often switch between MonoDevelop on Linux and VS2010 with the same code base
I want to distinguish between various execution paths in linux kernel so that I
Recently, I am reading some Linux kernel space codes, I see this uint64_t used;
For linux and windows, in the same process, how to make two page entries
I am writing a linux kernel module that needs to pin two threads on
I don't really understand the difference between the user-level threads and kernel-level threads. This
I'm searching if it's possible to build the same Linux Kerneltwice (same sources, same
We are several persons using the same login id on Linux Box. I want
How can I replace the same text in folder names in linux? Say I

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.