473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Getting conditionals to work in a gmake makefile

I am trying to put some conditional in my makefile and I have tried every combination in the public gmake manual..
Why does this not work and if it is wrong how DO I do a conditional that would work?

file1:
Expand|Select|Wrap|Line Numbers
  1. test = "tom"
  2.  
  3. all: test
  4. .PHONY test:
  5.  
  6. test:
  7.  
  8.         ifeq ($(test), "tom")
  9.              @echo "this works"
  10.         endif
  11.  
  12.  
  13.  
  14. OR...............
  15. test:
  16.  
  17.       ifeq ("$(test)","tom")
  18.           @echo "this works"
  19.      endif
  20.  
  21.  
  22. OR.... 
  23.       ifeq $(test) "tom"
  24.            @echo "this works"
  25.       endif
  26.  
  27. EVEN this doesn't work:
  28.  
  29.       ifdef  $(test)
  30.            @echo "nope, this doesn't work also"
  31.       endif
  32.  
[Please use CODE tags when posting source code. Thanks! --pbmods]

So, how DO you do conditional execution of variables, either
internally set or environmentally set?
Jun 21 '07 #1
1 2920
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as 'question' actually get FEWER responses?).

Moving to the *n?x forum....
Jun 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Miguel Cardenas | last post by:
Hello list For some strange reason `mysql_config --...` does not work. If try something like gcc -o progname `mysql_config --cflags` progname.c `mysql_config --libs` (NOTE:...
1
by: jose luis fernandez diaz | last post by:
Hi, VAR=hello VAR=$(subst hello,bye,$(VAR)) print: echo $(VAR)
1
by: Rhiner Dan | last post by:
Here are the errors from my Dev-c compiler //////////////////////////////////////////////////////////////////////////// Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make... make.exe...
4
by: chenqy2004 | last post by:
I used to code in unix. Now I need to run them in Visual C++. But I don't know how to change the makefile so that it will work for visual c++. Can anyone help me out?
5
by: Hul Tytus | last post by:
comp.lang.c c programs & shell conditionals How is a unix shell script made to respond to the value returned by a program compiled from c code? The shell script below is my current effort,...
1
by: rpjanaka | last post by:
I am using an open source library called IGI_UDP for measure the available bandwidth of a link (http://www.cs.cmu.edu/%7Ehnn/igi/ ). with that library they have provided a "Makefile" which is not an...
1
by: psiddhu | last post by:
Hi All, I am not able to run gmake in system command. I get the following output sh: gmake: not found but, if I run the command directly, it run fine. Let me know if anyone has...
1
Xx r3negade
by: Xx r3negade | last post by:
I'm using this tutorial to learn Qt. I've gotten to the point where I've used qmake to generate the makefile and the ui_myqtapp.h file. When compiling with the Makefile, I get these errors: ...
1
by: D3|\\||\\|!$ | last post by:
Hi all!!! I have been trying to port a piece of C++ code from windows to Linux environment. I'm using redhat9 which has KDE3 and QT3.1.x on it. I used KDevelop 2.1 bundled with it. I created a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.