summaryrefslogtreecommitdiff
path: root/databases/lmdb/files/patch-Makefile
blob: ca624d425d670a3ac8f1d79aefda18eb5cc68748 (plain) (blame)
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
--- ./Makefile.orig	2013-08-14 09:57:25.000000000 -0700
+++ ./Makefile	2013-08-16 11:35:51.697680677 -0700
@@ -16,14 +16,12 @@
 # There may be other macros in mdb.c of interest. You should
 # read mdb.c before changing any of them.
 #
-CC	= gcc
 W	= -W -Wall -Wno-unused-parameter -Wbad-function-cast
 THREADS = -pthread
 OPT = -O2 -g
-CFLAGS	= $(THREADS) $(OPT) $(W) $(XCFLAGS)
+CFLAGS	= $(XCFLAGS)
 LDLIBS	=
 SOLIBS	=
-prefix	= /usr/local
 
 ########################################################################
 
@@ -32,13 +30,13 @@
 IPROGS	= mdb_stat mdb_copy
 IDOCS	= mdb_stat.1 mdb_copy.1
 PROGS	= $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
-all:	$(ILIBS) $(PROGS)
+all:	$(ILIBS) $(IPROGS)
 
 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
+	for f in $(IPROGS); do ${INSTALL_PROGRAM} $$f $(DESTDIR)$(prefix)/bin; done
+	for f in $(ILIBS); do ${INSTALL_LIB} $$f $(DESTDIR)$(prefix)/lib; done
+	for f in $(IHDRS); do ${INSTALL_DATA} $$f $(DESTDIR)$(prefix)/include; done
+	for f in $(IDOCS); do ${INSTALL_MAN} $$f $(DESTDIR)$(prefix)/man/man1; done
 
 clean:
 	rm -rf $(PROGS) *.[ao] *.so *~ testdb
@@ -54,7 +52,9 @@
 	$(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.o midl.o $(SOLIBS)
 
 mdb_stat: mdb_stat.o liblmdb.a
+	${CC} ${LDFLAGS} -o ${.TARGET} mdb_stat.o liblmdb.a
 mdb_copy: mdb_copy.o liblmdb.a
+	${CC} ${LDFLAGS} -o ${.TARGET} mdb_copy.o liblmdb.a
 mtest:    mtest.o    liblmdb.a
 mtest2:	mtest2.o liblmdb.a
 mtest3:	mtest3.o liblmdb.a