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