Post New Thread
Results 1 to 2 of 2

Thread: Makefile question

  1. #1
    1000 Point Level TheBlackElf's Avatar
    Join Date
    Mar 2005
    Location
    Romania
    Posts
    1,011

    Makefile question

    I'm supposed to modify this monster Makefile that I get very little of - I have very little experience with such things.

    I've got just one more thing to do. Namely, there exists a certain #define COMMUNICATION_MODE XXX in a certain header, and I want to give XXX as a parameter to the make command (e.g, make COMMUNICATION_MODE=COMMUNICATION_DDS).

    The way I figured it, I just replace the said macro declaration in the header with a @sed command in the makefile. It works fine, replace is great and all but the problem is that modifying the header doesn't trigger a recompile. I guess that the make script gets the timestamps of the file before the header is modified. For example, if I set COMMUNICATION_MODE=FOO I get something like "nothing to be done for 'all'" and next time I run make it produces errors as expected. I tried adding a @touch after @sed but it doesn't make any difference.

    My question is: is there any way to force the header to be considered as modified and recompile it? Or, is there any other solution for my problem?

    Thx a lot, I know there are quite a few programmers on WCR, maybe some of you knows how to do it. I don't even know what to google, and I'd probably get crucified on StackOverflow for not knowing the basics etc.
    ______________________________
    20:52 Cows-go-moo: search us east too
    20:52 Cows-go-moo: like tears of americans
    20:52 Cows-go-moo: when they lose

  2. #2
    1000 Point Level TheBlackElf's Avatar
    Join Date
    Mar 2005
    Location
    Romania
    Posts
    1,011

    Found it, apparently you can make use of #ifdef MY_MACRO and invoke gcc -DMY_MACRO if you want it enabled.
    ______________________________
    20:52 Cows-go-moo: search us east too
    20:52 Cows-go-moo: like tears of americans
    20:52 Cows-go-moo: when they lose

Post New Reply

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts