From: Howard Chu Date: Thu, 11 Aug 2011 21:23:01 +0000 (-0700) Subject: Start using as a library X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~116 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=785d8e184cba7b7d1fcc45eceb5e7b1a9b7725c8;p=openldap Start using as a library --- diff --git a/libraries/libmdb/Makefile b/libraries/libmdb/Makefile index 4786429ecc..f9cf075ee9 100644 --- a/libraries/libmdb/Makefile +++ b/libraries/libmdb/Makefile @@ -4,21 +4,25 @@ OPT = -O2 -g CFLAGS = -pthread $(OPT) $(W) $(XCFLAGS) LDLIBS = -all: mdb_stat mtest mtest2 mtest3 +PROGS = mdb_stat mtest mtest2 mtest3 +all: libmdb.a $(PROGS) clean: - rm -rf mtest mdb_stat *.[ao] *~ testdb + rm -rf $(PROGS) *.[ao] *~ testdb test: all mkdir testdb ./mtest && ./mdb_stat testdb -mdb_stat: mdb_stat.o mdb.o idl.o -mtest: mtest.o mdb.o idl.o -mtest2: mtest2.o mdb.o idl.o -mtest3: mtest3.o mdb.o idl.o +libmdb.a: mdb.o idl.o + ar rs $@ mdb.o idl.o -%: %.o mdb.o +mdb_stat: mdb_stat.o libmdb.a +mtest: mtest.o libmdb.a +mtest2: mtest2.o libmdb.a +mtest3: mtest3.o libmdb.a + +%: %.o $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ %.o: %.c mdb.h diff --git a/libraries/libmdb/idl.c b/libraries/libmdb/idl.c index 50effaa34d..7fc39c0072 100644 --- a/libraries/libmdb/idl.c +++ b/libraries/libmdb/idl.c @@ -14,7 +14,7 @@ * . */ -#include +#include #include #include #include "idl.h" diff --git a/libraries/libmdb/idl.h b/libraries/libmdb/idl.h index 288b16f92c..1a51df4850 100644 --- a/libraries/libmdb/idl.h +++ b/libraries/libmdb/idl.h @@ -17,7 +17,7 @@ #ifndef _MDB_IDL_H_ #define _MDB_IDL_H_ -#define AC_MEMCPY(dst,src,size) bcopy(src,dst,size) +#define AC_MEMCPY(dst,src,size) memcpy(dst,src,size) #define ID unsigned long #define NOID ((ID)~0)