forked from drycpp/lmdbxx
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
80 lines (59 loc) · 2.22 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
# 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 := -Iinclude/
CXXFLAGS := -g -O2 -std=c++17 -Wall -Werror -fsanitize=address -fsanitize=undefined
LDFLAGS := -fsanitize=address -fsanitize=undefined
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 testdb
$(CXX) $(LDFLAGS) -o $@ check.o $(LDADD) && ./$@
testdb:
$(MKDIR) testdb/
$(RM) testdb/data.mdb testdb/lock.mdb
example: example.o
$(MKDIR) example.mdb/
$(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 check example $(PACKAGE_TARSTRING).tar.* *.o *~
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 testdb