]> git.sur5r.net Git - openldap/blobdiff - libraries/liblmdb/Makefile
ITS#8169 more Makefile tweaks
[openldap] / libraries / liblmdb / Makefile
index 5f8ef64461efd14bd2ccc5cd387ffb2b5238659d..0940c496ea2f1d41d0f88333f43ec9dd8dfdb551 100644 (file)
 # - MDB_USE_POSIX_SEM
 # - MDB_DSYNC
 # - MDB_FDATASYNC
+# - MDB_FDATASYNC_WORKS
 # - MDB_USE_PWRITEV
+# - MDB_USE_ROBUST
 #
 # There may be other macros in mdb.c of interest. You should
 # read mdb.c before changing any of them.
 #
 CC     = gcc
+AR     = ar
 W      = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized
 THREADS = -pthread
 OPT = -O2 -g
@@ -24,6 +27,12 @@ CFLAGS       = $(THREADS) $(OPT) $(W) $(XCFLAGS)
 LDLIBS =
 SOLIBS =
 prefix = /usr/local
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+libdir = $(exec_prefix)/lib
+includedir = $(prefix)/include
+datarootdir = $(prefix)/share
+mandir = $(datarootdir)/man
 
 ########################################################################
 
@@ -35,20 +44,24 @@ PROGS       = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
 all:   $(ILIBS) $(PROGS)
 
 install: $(ILIBS) $(IPROGS) $(IHDRS)
-       for f in $(IPROGS); do cp $$f $(DESTDIR)$(prefix)/bin; done
-       for f in $(ILIBS); do cp $$f $(DESTDIR)$(prefix)/lib; done
-       for f in $(IHDRS); do cp $$f $(DESTDIR)$(prefix)/include; done
-       for f in $(IDOCS); do cp $$f $(DESTDIR)$(prefix)/man/man1; done
+       mkdir -p $(DESTDIR)$(bindir)
+       mkdir -p $(DESTDIR)$(libdir)
+       mkdir -p $(DESTDIR)$(includedir)
+       mkdir -p $(DESTDIR)$(mandir)/man1
+       for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
+       for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
+       for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
+       for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
 
 clean:
-       rm -rf $(PROGS) *.[ao] *.so *~ testdb
+       rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
 
 test:  all
        rm -rf testdb && mkdir testdb
        ./mtest && ./mdb_stat testdb
 
 liblmdb.a:     mdb.o midl.o
-       ar rs $@ mdb.o midl.o
+       $(AR) rs $@ mdb.o midl.o
 
 liblmdb.so:    mdb.lo midl.lo
 #      $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)