On Sun, Feb 20, 2005 at 03:40:08PM +0800, qiang zeng wrote: > what i intend to do is that i have a variable in my c program, > while i am trying to send it a value i get (e.g., an address )when > executing the makefile. > so is that possible ? Easy: /* mytest.c */ #include <stdio.h> int main(int argc, char *argv[]) { printf("MYVAL = %d\n", MYVAL); return 0; } And in the Makefile: CFLAGS=-Wall -O2 -DMYVAL=42 all: mytest Run "make", run "./mytest" and voila: MYVAL = 42 Erik -- Erik Mouw J.A.K.Mouw@xxxxxxxxxxxxxx mouw@xxxxxxxxxxxx
Attachment:
signature.asc
Description: Digital signature