[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Alter CXX for new target
From: |
Eric Lilja |
Subject: |
Alter CXX for new target |
Date: |
Wed, 25 May 2005 15:55:36 +0200 |
Say I have a Makefile like this:
CXX = g++
CXXFLAGS = -Wall -W -ansi -pedantic -g -c -o
LDFLAGS = -o $(EXEC)
EXEC = string_test
OBJECTS = string.o string_test.o
all: $(OBJECTS)
$(CXX) $^ $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $@ $<
clean:
rm -f $(OBJECTS) $(EXEC) *~ *.stackdump
And now I want to add a new target and alter CXXFLAGS for that target (I
want to add preprocessor define). How do I do that? I tried:
pretranslate_method: $(OBJECTS)
$(CXXFLAGS) = -Wall -W -ansi -pedantic -g -DUSE_PRETRANSLATE -c -o
$(CXX) $^ $(LDFLAGS)
but that didn't work..
Please help
/ E
- Alter CXX for new target,
Eric Lilja <=