LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-13-2007, 11:03 AM   #1
enzom83
LQ Newbie
 
Registered: Dec 2006
Posts: 3

Rep: Reputation: 0
excluding some lines from compiling


Dear all,
I have created some C++ classes for a plugin of a simulator.
Some lines of these classes are useful for making up a log file, in order to testing the good working of the plugin.

When I use this plugin, I would disable the making up of the log file.
I thought to use the following macro:
Code:
#ifdef DEBUG
    // code for making up the log file
#endif
In this way, if I compile the classes in release mode, the code within
Code:
#ifdef DEBUG
and
Code:
#endif
statements is not compiled.

In order to compiling the plugin, I use a Makefile.gen, and I generate the Makefile by the command
Code:
make -f Makefile.gen
.

Within the Makefile I found the following line:
Code:
CFLAGS=-O2 -DNDEBUG=1 -DWITH_PARSIM -DWITH_NETBUILDER
Does it exist an option for make command in order to create the following line in the Makefile?
Code:
CFLAGS=-O2 -DDEBUG -DWITH_PARSIM -DWITH_NETBUILDER
Thanks a lot!
 
Old 10-13-2007, 12:12 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
From the gcc man page:
Code:
-D name=definition
           The contents of definition are tokenized and processed as if they appeared during
           translation phase three in a #define directive.  In particular, the definition will be
           truncated by embedded newline characters.

           If you are invoking the preprocessor from a shell or shell-like program you may need
           to use the shell’s quoting syntax to protect characters such as spaces that have a
           meaning in the shell syntax.

           If you wish to define a function-like macro on the command line, write its argument
           list with surrounding parentheses before the equals sign (if any).  Parentheses are
           meaningful to most shells, so you will need to quote the option.  With sh and csh,
           -D’name(args...)=definition’ works.

           -D and -U options are processed in the order they are given on the command line.  All
           -imacros file and -include file options are processed after all -D and -U options.
 
Old 10-13-2007, 12:42 PM   #3
enzom83
LQ Newbie
 
Registered: Dec 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Sorry...
I don't understand...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse lines need from /var/log/message but excluding... grant-skywalker Linux - General 8 03-20-2007 02:30 PM
Asterisk box to connect VoIP lines with normal telephone lines. sraju Linux - Software 1 11-08-2006 12:38 AM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 09:19 AM
using egrep and excluding lines beginning in # thebudbottle Programming 2 05-10-2006 02:27 PM
printer printing vertical lines at beginning and end of lines makhand Linux - Hardware 0 09-02-2005 02:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration