473,508 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

make: are command line variables stored in a macro?

In a Makefile, I have something like the following:

# makefile start

X = "default_x"
Y = "default_y"

targA:
dosomething -x $(X) -y $(Y)

targB:
$(MAKE) targA X=newX

#makefile end

I'd like to be able to have the option to specify another value of Y
on the command line when making targB and have that passed correctly
to "dosomething"

make targB Y=new_Y

In fact, in my real makefile, I have several such variables I'd like
to be able to modify on the command line. The only way I've been able
to come up with to do this is to modify targB so

targB:
$(MAKE) targA X=newX Y=$(Y)

but this gets unwieldy for several variables. Is there a better way to
do this? Is there a Make macro in which command line variables/macros
are stored?

Oct 19 '07 #1
1 1538
Dave Programmer wrote:
In a Makefile, I have something like the following:
And your C question was what exactly?

Your question is more likely to be on topic in comp.unix.programmer, I
suspect.

<Off-Topic>

You could look at the manual for (your particular implementation of)
"make" and see if the way it uses environment variables would help you

But don't continue the discussion here, please.
</Off-Topic>
Oct 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4359
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
0
2340
by: Bret Shortall | last post by:
Using the SENDOBJECT action command in a Macro works fine if you hard code in their email address. SENDOBJECT TO bret@emailaddress.com SUBJECT This is the Subject line...
6
4841
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
8
10670
by: Seeker | last post by:
Hello, In using Solaris Pro Compiler to compile Pro*C code. I am getting this error: make: Fatal error in reader: parser_proc_online.mk, line 26: Badly formed macro assignment Based on other...
2
37473
by: tonytony24 | last post by:
Hi All: I was wondering if there's a simple way to call a MS Access Module through either Command Prompt MS Script any other way... Thanks for the response.
6
5898
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
0
1156
by: AlexZh | last post by:
Hi! I saw a number of topics about the problem, however I still have troubles. Each time I join /command and /build keys in the same command line I receive error message: Not enough storage is...
36
2509
by: sh.vipin | last post by:
how to make large macro paste the code as it is Problem Explanation '-- For example in the program below /* a.c - starts here */ #define DECL_VARS() \ unsigned int a0;\ unsigned int a1;\...
1
47351
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.