--- ./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