-
-
Notifications
You must be signed in to change notification settings - Fork 88
/
Makefile
83 lines (60 loc) · 2.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Makefile for lmdb++ <http://lmdbxx.sourceforge.net/>
PACKAGE_NAME := lmdb++
PACKAGE_TARNAME := lmdbxx
PACKAGE_VERSION = $(shell cat VERSION)
PACKAGE_STRING = $(PACKAGE_NAME) $(PACKAGE_TARNAME)
PACKAGE_TARSTRING = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
PACKAGE_BUGREPORT := arto@bendiken.net
PACKAGE_URL := http://lmdbxx.sourceforge.net/
DESTDIR :=
PREFIX := /usr/local
CPPFLAGS := -I.
CXXFLAGS := -g -O0 -std=c++11 -Wall -Werror
LDFLAGS :=
LDADD := -llmdb
includedir = $(PREFIX)/include
MKDIR := mkdir -p
RM := rm -f
INSTALL := install -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_HEADER = $(INSTALL_DATA)
DISTFILES := AUTHORS CREDITS INSTALL README TODO UNLICENSE VERSION \
Makefile check.cc example.cc lmdb++.h
default: help
help:
@echo 'Install the <lmdb++.h> header file using `make install`.'
check: check.o
$(CXX) $(LDFLAGS) -o $@ $^ $(LDADD) && ./$@
example: example.o
$(CXX) $(LDFLAGS) -o $@ $^ $(LDADD) && ./$@
%.o: %.cc lmdb++.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
installdirs:
$(MKDIR) $(DESTDIR)$(includedir)
install: lmdb++.h installdirs
$(INSTALL_HEADER) $< $(DESTDIR)$(includedir)
uninstall:
$(RM) $(DESTDIR)$(includedir)/lmdb++.h
clean:
$(RM) README.html README.md check example $(PACKAGE_TARSTRING).tar.* *.o *~
README: README.html README.md
README.html: README.rst
pandoc -s -f rst -t html5 -S -o $@ $<
README.md: README.rst
pandoc -s -f rst -t markdown_github -o - $< | tail -n +5 > $@
doxygen: README.md
doxygen Doxyfile
sed -e 's/Main Page/a C++11 wrapper for LMDB/' \
-e 's/lmdb++ Documentation/lmdb++: a C++11 wrapper for LMDB/' \
-i.orig .doxygen/html/index.html
maintainer-clean: clean
maintainer-doxygen: doxygen
rsync -az .doxygen/html/ bendiken@web.sourceforge.net:/home/project-web/lmdbxx/htdocs/
dist:
tar -chJf $(PACKAGE_TARSTRING).tar.xz \
--transform 's,^,$(PACKAGE_TARSTRING)/,' $(DISTFILES)
tar -chjf $(PACKAGE_TARSTRING).tar.bz2 \
--transform 's,^,$(PACKAGE_TARSTRING)/,' $(DISTFILES)
tar -chzf $(PACKAGE_TARSTRING).tar.gz \
--transform 's,^,$(PACKAGE_TARSTRING)/,' $(DISTFILES)
.PHONY: help check example installdirs install uninstall clean doxygen maintainer-doxygen dist