Can I make this Makefile work?
From: William Payne (mikas493_no_spam_at_student.liu.se)
Date: 08/28/04
- Next message: mjt: "Re: Data structure in system call/user program"
- Previous message: terry: "Data structure in system call/user program"
- Next in thread: Basile Starynkevitch [news]: "Re: Can I make this Makefile work?"
- Reply: Basile Starynkevitch [news]: "Re: Can I make this Makefile work?"
- Reply: John Fusco: "Re: Can I make this Makefile work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Aug 2004 15:04:45 +0200
Consider this Makefile:
CXX = g++
LD = g++
CXXFLAGS = -Wall -W -ansi -pedantic -g -ggdb -c -o
LDFLAGS = -L/usr/local/gcc-3.4.1/lib/ -o $(EXEC)
EXEC = NULL
Q4_EXEC = 4q
Q4_OBJECTS = q4.o
q4:
EXEC = $(Q4_EXEC)
$(Q4_OBJECTS)
$(LD) $(Q4_OBJECTS) $(LDFLAGS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $@ $<
clean:
rm -f $(Q4_OBJECTS) *~ *.stackdump
When I do "$ make" or "$ make q4" I always get the message "make: 'q4' is up
to date."
I know I could do:
CXX = g++
LD = g++
CXXFLAGS = -Wall -W -ansi -pedantic -g -ggdb -c -o
LDFLAGS = -L/usr/local/gcc-3.4.1/lib/ #-o $(EXEC)
EXEC = NULL
Q4_EXEC = 4q
Q4_OBJECTS = q4.o
q4:
#EXEC = $(Q4_EXEC)
$(Q4_OBJECTS)
$(LD) $(Q4_OBJECTS) $(LDFLAGS) -o $(Q4_EXEC)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $@ $<
clean:
rm -f $(Q4_OBJECTS) *~ *.stackdump
But can I make it work my way? When I am done I will have q1-to-q11 in the
makefile and I want to a short makefile, but still perfectly readable.
What's the best way to proceed?
/ WP
- Next message: mjt: "Re: Data structure in system call/user program"
- Previous message: terry: "Data structure in system call/user program"
- Next in thread: Basile Starynkevitch [news]: "Re: Can I make this Makefile work?"
- Reply: Basile Starynkevitch [news]: "Re: Can I make this Makefile work?"
- Reply: John Fusco: "Re: Can I make this Makefile work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|