preprocessor


m4 does not obey expansion?


I use m4 for a little text preprocessing here, and it behaves in a way I don't understand.
This is the portion in question:
ifdef(`TEST',
define(`O_EXT', `.obj'),
define(`O_EXT', `.o'))
This macro will always be expanded to .o, regardless whether TEST is defined (m4 -DTEST) or not.
What am I doing wrong?
You're not quoting the other arguments to ifdef. Try this:
ifdef(`TEST', `define(`O_EXT', `.obj')', `define(`O_EXT', `.o')')

Related Links

Fortran preprocessing with Portland compiler
Making a macro expansion dependent on its arguments
How to set ISPP defines based on default Inno Setup variables?
standalone C++ preprocessor
Annotations in OCaml
Obtaining the include paths cpp searches
Test for empty macro definition
m4 does not obey expansion?
Detect compilation on Bada OS
Which of the C-family languages have a preprocessor?
Generic preprocessor: How to use for any kind of file?
What's the macro to distinguish ifort from other fortran compilers?
Inno Setup: How do I see the output (translation) of the Inno Setup Preprocessor?
how do I add preprocessor #define in devenv command line?
preprocessing directives to prevent a project from release and debug symbols
Can I see shader preprocessor output?

Categories

HOME
grok
api
ng-idle
nvd3.js
hessian
jsf-2.2
shiro
spring-data-mongodb
entity-framework-core
nuget-package
endeca
x-cart
endpoint
altera
job-scheduling
standards
video-editing
cfml
bourbon
backpack-for-laravel
gulp-watch
tiki-wiki
surveymonkey
has-and-belongs-to-many
exchangewebservices
sqlpackage
scrollview
hreflang
dynamic-jasper
getpixel
openalpr
loading
health-monitoring
doc
odoo-website
apriori
lpsolve
http-request
vaadin-charts
stylecop
getchar
dynamic-linq
yii2-api
dbcontext
rserve
activeperl
filehandle
arules
cup
er-diagram
payload
seq
filenet
parfor
seek
latin
preprocessor
myspace
jquery-jscrollpane
i386
nss
cortex-m
kendo-upload
assertion
dynatree
graphics2d
j-security-check
zxspectrum
cosine-similarity
primitive-types
android-vibration
dot42
windows-embedded-standard
mysql-error-1044
breakout
gpars
cmmi
android-icons
virtual-pc
robotlegs
sentestingkit
dajaxice
rmiregistry
cross-database
expression-blend-4
listactivity
uipagecontrol
clrstoredprocedure
http-daemon
django-paypal
application-verifier
purepdf
feasibility
google-wave
fail-fast-fail-early
fdf
firefox-3
idatareader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App