Thread: Help me with some simple makefile scripting

  1. #1
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

    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.

  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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    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.

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, 07: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, 07:01 PM
  4. Simple makefile Problem
    By kishorepalle in forum Tech Board
    Replies: 5
    Last Post: 07-28-2004, 04:12 PM