Makefile cleanup.
[cumulus.git] / Makefile
1 PACKAGES=sqlite3 uuid
2 DEBUG=-g
3 CXXFLAGS=-O -Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) \
4          $(shell pkg-config --cflags $(PACKAGES)) \
5          -DCUMULUS_VERSION=$(shell cat version)
6 LDFLAGS=$(DEBUG) $(shell pkg-config --libs $(PACKAGES))
7
8 SRCS=chunk.cc localdb.cc metadata.cc ref.cc remote.cc scandir.cc sha1.cc \
9      store.cc subfile.cc util.cc
10 OBJS=$(SRCS:.cc=.o)
11
12 cumulus : $(OBJS)
13         $(CXX) $(LDFLAGS) -o $@ $^
14
15 version : NEWS
16         (git-describe || (head -n1 NEWS | cut -d" " -f1)) >version 2>/dev/null
17 $(OBJS) : version
18
19 clean :
20         rm -f $(OBJS) lbs version
21
22 dep :
23         touch Makefile.dep
24         makedepend -fMakefile.dep $(SRCS)
25
26 .PHONY : clean dep
27
28 -include *.dep