Makefile.
This commit is contained in:
parent
cf1ae831f9
commit
ef1f25e9b3
|
@ -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
|
||||
|
Loading…
Reference in New Issue