Help me with some simple makefile scripting

This is a discussion on Help me with some simple makefile scripting within the Tech Board forums, part of the Community Boards category; I wan't to make the makefile in such a way that if I invoke the make command with an extra ...

  1. #1
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490

    Help me with some simple makefile scripting

    I wan't to make the makefile in such a way that if I invoke the make command with an extra flag... say (-g) , it will be somewhat like
    Code:
    #ifdef g
    gdb main
    #else
    ./main
    #endif
    I don't know how to correlate it.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    You can't provide your own flags to make. Maybe there are some user definable flags, but I doubt it.

    Why don't you just use different targets for this purpose?
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    Quote Originally Posted by MK27 View Post
    You can't provide your own flags to make. Maybe there are some user definable flags, but I doubt it.

    Why don't you just use different targets for this purpose?
    Didn't think of that, in a fit of confusion.
    It is a perfect solution.
    Thank You.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Scripting Language Advice
    By timmeh in forum C++ Programming
    Replies: 3
    Last Post: 03-03-2010, 06:39 PM
  2. Simple GNU Makefile
    By OriginalCopy in forum Linux Programming
    Replies: 5
    Last Post: 05-14-2008, 12:17 PM
  3. Simple makefile problem
    By jimzy in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2007, 06:01 PM
  4. Simple makefile Problem
    By kishorepalle in forum Tech Board
    Replies: 5
    Last Post: 07-28-2004, 04:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21