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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:09:13+00:00 2026-05-27T04:09:13+00:00

I have written a make file. In the make file i have used a

  • 0

I have written a make file.

In the make file i have used a variable, say EXTRAFLAGS which looks like this.

EXTRAFLAGS += -D _MSC_VER
EXTRAFLAGS += -D BINARYINPUT
EXTRAFLAGS += -D ENABLEVERSION2D2

Further,
I use Compiler flags

CFLAGS = -Werror -Wall -I $(INC) $(EXTRAFLAGS)

and

mingw32-gcc $(CFLAGS) -o nameofexe  OBJ's 

I have used this makefile with out any problems. But when i disable the preprocessor definitions, by introducing ‘#’ ahead of one of the statments in EXTRAFLAGS, and i remake it, i am getting target up to date. I am unable to introduce Preprocessor Definitions in to the sensitive list.

A temporary work around i am using currently is, introduce a phony target clean and remove all the object files and re compiling every thing. But this is a waste of time. How can i better manage the current scenario?

  • 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-27T04:09:14+00:00Added an answer on May 27, 2026 at 4:09 am

    Make is a tool that compiles your project new when one of your files in the project change.

    E.g. when you change your .h file it recognizes the change and rebuilds all files that depend on it, and then rebuild all that depends on the new builds, …

    But when you change the compiler flags and/or the defines in the makefile the project input files do not change, so the project is not rebuild.

    There are three ways to achieve what you want: First issue manually a make clean after changing the makefile. Secondly to include the makefile itself in your makefile (and issue there a make clean when it changed). And finally move the defines into some project specific .h file.

    Generally only the “in-a-h-file-on-its-own”-solution is the only one, that avoids building everything new, as the others are not aware of which source files actually have a reference to the changed defines.

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

Sidebar

Related Questions

I have a file named common.cs which contains commonly used functions like this public
I have written this code in javascript however I have to make it work
I have a application written in wxPython which I want to make multilingual. Our
I have written a program which takes a file as input and whenever it
i have written module which reads and write on /proc file and is working
I have a file that is read and written to. I need to make
I have an application, written in Python, which is used by a fairly technical
Summary: I have a struct that is read/written to file. This struct changes frequently,
Most of the code I've written in .NET to make REST calls have been
I have written a PHP application which requires storage of millions of integers between

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.