Makefile.

This commit is contained in:
Marc Burns 2011-11-10 20:45:35 -05:00
parent cf1ae831f9
commit ef1f25e9b3
1 changed files with 53 additions and 0 deletions

53
database/Makefile Normal file
View File

@ -0,0 +1,53 @@
# POS
CXX = g++
ifndef NDEBUG
CXXFLAGS = -g -O0 -Wall -I/users/m4burns/thrift/include/thrift -I. -Igen-cpp
else
CXXFLAGS = -O3 -fexpensive-optimizations -ffast-math -fno-math-errno -Wall -I/users/m4burns/thrift/include/thrift -I. -Igen-cpp
endif
LDFLAGS = /users/m4burns/thrift/lib//libthrift.a
SOURCES = ConfigFile.cpp db.cpp db_if.cpp linus_sha1.c log.cpp nameserver.cpp sha1.cpp gen-cpp/pos_constants.cpp gen-cpp/Pos.cpp gen-cpp/pos_types.cpp
CPPOBJECTS = $(patsubst %.cpp,%.o,$(SOURCES))
OBJECTS = $(patsubst %.c,%.o,$(CPPOBJECTS))
CPPDEPS = $(patsubst %.cpp,%.d,$(SOURCES))
DEPS = $(patsubst %.c,%.d,$(CPPDEPS))
SERVER = server
CLIENT = client
##################################################################
.PHONY : all clean
all : $(SERVER) $(CLIENT)
%.d : %.cpp
$(CXX) -MM $(CXXFLAGS) $^ > $@
%.d : %.c
$(CXX) -MM $(CXXFLAGS) $^ > $@
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif
%.o : %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o : %.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(SERVER) : $(OBJECTS) gen-cpp/Pos_server.skeleton.o
$(CXX) $(CXXFLAGS) $(OBJECTS) gen-cpp/Pos_server.skeleton.o -o $@ $(LDFLAGS)
$(CLIENT) : $(OBJECTS) client.o
$(CXX) $(CXXFLAGS) $(OBJECTS) client.o -o $@ $(LDFLAGS)
#################################################################
clean :
rm -f *.o gen-cpp/*.o $(SERVER) $(CLIENT) *.d gen-cpp/*.d