• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

"make debug" in command line

I have makefile like (by name "makefile"),

my_program: processing.o gui.o
      c++ processing.o gui.o -o my_program

- If I give a command "make debug" in command line the above pgm should compile in debug mode. How to achieve this?

-thanks
0
princyrajan
Asked:
princyrajan
  • 5
1 Solution
 
yuzhCommented:
Try to run:
make -dD

instead of  "make debug"

man make
to learn more deatails
0
 
yuzhCommented:
or
make -dDD
0
 
princyrajanAuthor Commented:
No my friends, If I give like "make debug", the pgm inside i.e
"c++ processing.o gui.o  -o my_program" should compile in debug mode like,
"c++ processing.o gui.o -g -o my_program"

-thanks

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
yuzhCommented:
Add the followings in your Makefile

debug:
            make -dDD


then try
make debug
0
 
yuzhCommented:
In most of the case "make debug" is for debug the C codes, but you want to do it for Makefile.
0
 
yuzhCommented:
Sorry, I did read your comment in (http:#11889515), you mean use -g with the complier.

Here's the example:
http://vergil.chemistry.gatech.edu/resources/programming/c-tutorial/make.html
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now