![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Makefile help | tantric | High Level Programming | 4 | 04-13-2007 01:35 AM |
| Makefile | NamrataGurav | High Level Programming | 7 | 10-07-2006 02:29 PM |
| about the makefile | ligerdave | High Level Programming | 2 | 01-31-2006 01:21 AM |
| Using cut within makefile | wvdeijk | UNIX for Dummies Questions & Answers | 2 | 12-14-2005 05:11 PM |
| makefile | ECBROWN | UNIX for Dummies Questions & Answers | 4 | 02-17-2005 12:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
makefile help
i'd like to execute a particular command if i'm running gcc version 3.2 for instance.
my approach is as follows: GCC_VERSION := `gcc --version | head -1` suppose the result of `gcc --version | head -1` was gcc 3.2 then i'd like to perform the following: ifeq ($(GCC_VERSION), "gcc 3.2") ... endif ... i know the result of gcc --version is not as clean and elegant as "gcc 3.2", but just suppose it was -- in fact it's not even gcc that i want to do this for, but again suppose it was ... the ifeq doesn't work for me. any suggestions on how i can achieve what i'm attempting to do? |
|
|||||
|
As far as I can understand, you are looking to run some statements if you have gcc 3.2.
On my machine, gcc --version | head -1 gives Code:
gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-47) Your modified code would be Code:
GCC_VERSION := `gcc --version | head -1 | awk -F" " '{ printf $3 }'`
3.2.3 Your ifeq statements looks fine. For more help on ifeq see http://www.gnu.org/software/make/man...er/make_7.html You could also checkout findstring option available for makefile to check for the required gcc --version. vino |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|