help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

define variable in rule


From: franksong
Subject: define variable in rule
Date: Wed, 8 Jun 2005 23:54:56 +0800

Hi

Can the variable be defined in rule ? Like this:

1 target :  $(OBJ_FILE)
2       TMP_LIB := $(shell cat $(OBJ_FILES))
3       $(LD) $(OPT_LD_STD) $(LDFLAGS) -o $@   $(TMP_LIB)
$(EXTERNAL_LIBS) $(SYSTEM_LIBS) 

The OBJ_FILE is a text file with .o file list, and I want to translate
it to .o list used as the argument of link, so the variable TMP_LIB is
defined. 

But when do Make, syntax error found in line 3. So I doubt the variable
can not be defined within a fule.

Who can help me on this? Thanks.

Frank





reply via email to

[Prev in Thread] Current Thread [Next in Thread]