Setting/Modifying variable specific to target in Makefile


 
Thread Tools Search this Thread
Operating Systems Solaris Setting/Modifying variable specific to target in Makefile
# 1  
Old 01-24-2011
Setting/Modifying variable specific to target in Makefile

Hi,

I have a small piece of Makefile script which throw's error on Sun Sparc machine, but works fine with Sun Optron, Linux, AIX machines.
Code:
FOO=Naveen
test1:FOO=Dhilip

test1:
@echo FOO is ${FOO}

test2:
@echo Me is ${FOO}

Output on Sun Sparc -
Code:
ukhml-v890new-~/test: make test1
make: *** No rule to make target `FOO=Dhilip', needed by `test1'. Stop.

Output on Sun Optron -
Code:
ukhml-helios-~/shivtest: make test1
FOO is Dhilip

Anyone has an idea, why this syntax error thrown on Sun Sparc ?

Regards.,
Naveen Sriram.

Moderator's Comments:
Mod Comment Please use code tags

Last edited by Yogesh Sawant; 02-01-2011 at 05:00 AM..
# 2  
Old 01-24-2011
which version of make are you using on the two sun boxes ?
Also what version of O/S ? (Any patches installed that affect make ?)
# 3  
Old 01-24-2011
Hi,

Thanks for taking a look on this.
Below details regarding Makefile version and OS details -

Optron -
=========================================================
Code:
ukhml-helios-~/shivtest: make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
ukhml-helios-~/shivtest: uname -r
5.10
ukhml-helios-~/shivtest: cat /etc/release
                        Solaris 10 5/09 s10x_u7wos_08 X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 30 March 2009
ukhml-helios-~/shivtest: uname -X
System = SunOS
Node = ukhml-helios
Release = 5.10
KernelID = Generic_141445-09
Machine = i86pc
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 4

=========================================================

Sparc
========================================================

Code:
ukhml-v890new-~/test: make -v
GNU Make version 3.75, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <bug-gnu-utils@prep.ai.mit.edu>.

ukhml-v890new-~/test: uname -r
5.10
ukhml-v890new-~/test: cat /etc/release
                     Solaris 10 3/05 HW1 s10s_wos_74L2a SPARC
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 14 July 2005
ukhml-v890new-~/test: uname -X
System = SunOS
Node = ukhml-v890new
Release = 5.10
KernelID = Generic_118833-03
Machine = sun4u
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 8

ukhml-v890new-~/test:

======================================================

Is there any command through which I could figure out what are the patches been installed (non-root) which effect make ?

Last edited by pludi; 01-24-2011 at 08:40 AM..
# 4  
Old 01-24-2011
looks like the gnu make is different - might be worth dowloading 3.80 from Sunfreeware - Free and Open Source Software (FOSS) for Sun Microsystem's Solaris or the like...
# 5  
Old 01-24-2011
Hmm...looks like...I will speak with my admin regarding upgrading version...will keep you informed once I am done with that.

Thanks a lot for your support.
# 6  
Old 02-01-2011
I verified with version 3.81 and this syntax does work. Thanks a lot for your support.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Makefile No rule to make target

I am trying to create a makefile to build a program and am getting the following error: make -f tsimplex.mk make: *** No rule to make target `/main/tsimplex_main.cpp', needed by `tsimplex_main.o'. Stop. OPSYS = $(shell uname -s ) TARGET = tsimplex ROOTDIR = ../../.. GTSDIR =... (1 Reply)
Discussion started by: kristinu
1 Replies

2. Shell Programming and Scripting

rsync delete specific files - from different target folder

Hi, I need to use rsync to delete multiple files(only specified files not all) using --delete option, these files are located in different target folders. Instead of running rsync command multiple times for each file, can we achieve this with one time execution? your help is much... (0 Replies)
Discussion started by: MVEERA
0 Replies

3. Programming

How to define dynamic Target/Prerequisite in Makefile?

I am writing a Makefile for Cobol on Linux.My sample Makefile looks like below. I do not want to Hardcode Program names in Makefile.Is there any way we can mention directories in Target and Prerequisites instead of File names sothat Makefile Pickup all the files in mentioned path as below.... (8 Replies)
Discussion started by: kiranksb
8 Replies

4. Shell Programming and Scripting

MakeFile Backup Target

Goal: I'm trying to create a PHONY target inside my Makefile so that when I run the command "make backup", It will move all the files that end in "~" into the specified backup folder. Here is my code currently, and I'll explain the problem after: .PHONY: backup backup: @mkdir -p... (2 Replies)
Discussion started by: Xploit
2 Replies

5. Programming

Makefile: multiple target variable substitution

Greetings! Basically, I would like to properly handle this with gnu make: alltools: my_tool mysecond_tool mythird_tool etc_tool %_tool: dir1/%_tool.vf dir2/%_tool/subdir2/%_tool.ver <tab>@echo done %.vf: <tab>RUN_VF $* %.ver: <tab>RUN_VER $* So, if I were to do something like:... (0 Replies)
Discussion started by: Harlinator
0 Replies

6. Shell Programming and Scripting

modifying specific lines a file

Hi I need to modify entire file starting from the 3 line. file looks like this filename : exp first line second 1,"wes","est","ws" 1,"was","qwe","qwa" also i have to replace the third content from 3 line by a counter . so the output should look like this: first line second... (12 Replies)
Discussion started by: ciba
12 Replies

7. Shell Programming and Scripting

Makefile debug target

Hello, I'm having a problem with a makefile script i'm trying to write. I want to compile a C++ program in two possible ways: "make" (default target, main) and "make debug". When i supply the debug target, exactly the same as main should be built, but then with the DEBUG flag (-g -D... (2 Replies)
Discussion started by: StevenR
2 Replies

8. HP-UX

Oracle 9i install: Error in invoking target install of makefile

I receive an error while installing Oracle 9i: Error in invoking target install of makefile /opt/oracle/product/9.2.0/sqlplus/lib/ins_sqlplus.mk Furthermore: $ whoami oracle $ echo $ORACLE_HOME /opt/oracle/product/9.2.0 $ pwd /opt/oracle/product/9.2.0/sqlplus/lib $ ll total... (5 Replies)
Discussion started by: chris2005
5 Replies

9. Shell Programming and Scripting

Setting environment variables in Makefile

I've seen a few other threads like this, but they either went unanswered or failed to answer my question. How do I set an environment variable in a Makefile? What I'm trying to do is use GNU make to automate an ant build. In order to run ant, I've got to first set a few environment... (1 Reply)
Discussion started by: Bags
1 Replies

10. Solaris

Makefile:57: *** multiple target patterns. Stop.

Hi, I am getting the following error while building on Solaris 64 , while I am trying to build. Error Snippet :- ---------------------- Makefile:57: *** multiple target patterns. Stop. make: Leaving directory `/work1/patch/vds6053sun64o/vobs/jvi' make: *** Error 2 make: Leaving directory... (0 Replies)
Discussion started by: nileshborate
0 Replies
Login or Register to Ask a Question