help-gplusplus
[Top][All Lists]
Advanced

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

Need help with the following make file


From: emp1953
Subject: Need help with the following make file
Date: Thu, 7 Feb 2008 05:25:58 -0800 (PST)
User-agent: G2/1.0

Below is my makefile
It works fine as it is
I want to put all the .o files into the ../bin/ directory OBJDIR
then upon a clean I want the .o's removed from that directory
I was able to get the executable to go into the ../exe/ directory and
it is removed upon a clean.

I cannot get it the .o's to work. any help would be appreciated.


CC=g++
CFLAGS=-c -Wall
LDFLAGS=
OBJDIR=../bin/
SOURCES=a.cpp \
b.cpp \
c.cpp \
d.cpp \
e.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=../exe/msg_broker

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
$(CC) $(CFLAGS) $< -o $@

clean:
-rm -rf *.o
-rm -rf $(EXECUTABLE)


reply via email to

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