Re: Pass a C option based on command-line output?
Re: Pass a C option based on command-line output?
- Subject: Re: Pass a C option based on command-line output?
- From: Daniel Jalkut <email@hidden>
- Date: Sun, 8 Jan 2006 10:39:23 -0500
Thanks, Brian. But unless I'm missing something, these all rely on my
using a Makefile.  Since I'm moving away  from the Makefile, I'd like
to come up with a solution that doesn't depend on make (otherwise I'd
just use the entire Makefile, and everything "works fine."
What I'm leaning towards is a "generated source file" that includes a
#define for the desired value.  It's quite a different approach from
the original Makefile, but ...
Daniel
On Jan 8, 2006, at 9:47 AM, Brian Onn wrote:
I have 4 possible solutions, not in any particular order:
1) You could set the HOSTNAME inside the Makefile where it's
needed, using make features to execute a shell script:
	HOSTNAME	:=	$(shell /bin/hostname)
	$(CC) -DHOSTNAME=$(HOSTNAME) ...
2) you could create a shell script to run the make and have xcode
execute
this shell script as the build command in your target settings,
instead
of /usr/bin/make
	#!/bin/sh
	export HOSTNAME=`hostname`
	exec /usr/bin/make -DHOSTNAME=${HOSTNAME} "$@"
3) use the shell as your target settings Build Command, like this:
	Build Tool: 	/bin/sh
	Arguments: 	-c 'exec /usr/bin/make HOSTNAME=`hostname` $$@'  xx $
(ACTION)
4) use perl as your target settings Build Command, like this:
	Build Tool:	/usr/bin/perl
	Arguments:	-MSys::Hostname -e '$$ENV{"HOSTNAME"}=hostname(); exec
"/usr/bin/make",@ARGV;' $(ACTION)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden