[GRASS5] Gmakefile question

I am trying to write a Gmakefile that creates two executables, A and B.
A and B are identical, except that they should be compiled with different
flags.

CFLAGS += ...

all: A B

#OBJ should be compiled with -DELEV_FLOAT
A: $(OBJ)
   $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)

#OBJ should be compiled with -DELEV_SHORT
B: $(OBJ)
   $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)

the .o files in OBJ are compiled using CFLAGS. Anybody knows how to change
the CFLAGS inside a rule? or how to get around this?

thanks,
-Laura

Laura I. Toma wrote:

I am trying to write a Gmakefile that creates two executables, A and B.
A and B are identical, except that they should be compiled with different
flags.

CFLAGS += ...

all: A B

#OBJ should be compiled with -DELEV_FLOAT
A: $(OBJ)
   $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)

#OBJ should be compiled with -DELEV_SHORT
B: $(OBJ)
   $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)

the .o files in OBJ are compiled using CFLAGS. Anybody knows how to change
the CFLAGS inside a rule? or how to get around this?

This is something which the GRASS5 build system doesn't support. The
only solution is to use separate directories with separate Gmakefiles.

--
Glynn Clements <glynn.clements@virgin.net>