10-14-06 12:46 AM
"Thierry" <lamthierry@gmail.com> wrote:
# On linux redhat, using GNU makefile, is it possible to read the
# argument of a make command, for example:
#
#
# make hello
target=hello make $target
@ more makefile
TARGET=$(target)
hello:
echo hello $(TARGET)
bonjour:
cat t.c
cc t.c
a.out
@ target=hello make $target
echo hello hello
hello hello
@ target=bonjour make $target
cat t.c
#include <stdlib.h>
#include <stdio.h>
int main(int N,char **P) {
puts(getenv("target"));
return 0;
}
cc t.c
a.out
bonjour
It's trivial to write a shell script, say ~/bin/make, to do this
for you. Ignoring quote errors, something like
#!/bin/sh
target=$1 /usr/bin/make $*
--
SM Ryan http://www.rawbw.com/~wyrmwif/
Don't say anything. Especially you.
[ Post a follow-up to this message ]
|