Start using as a library

vmware
Howard Chu 13 years ago
parent 920115f747
commit 785d8e184c
  1. 18
      libraries/libmdb/Makefile
  2. 2
      libraries/libmdb/idl.c
  3. 2
      libraries/libmdb/idl.h

@ -4,21 +4,25 @@ OPT = -O2 -g
CFLAGS = -pthread $(OPT) $(W) $(XCFLAGS) CFLAGS = -pthread $(OPT) $(W) $(XCFLAGS)
LDLIBS = LDLIBS =
all: mdb_stat mtest mtest2 mtest3 PROGS = mdb_stat mtest mtest2 mtest3
all: libmdb.a $(PROGS)
clean: clean:
rm -rf mtest mdb_stat *.[ao] *~ testdb rm -rf $(PROGS) *.[ao] *~ testdb
test: all test: all
mkdir testdb mkdir testdb
./mtest && ./mdb_stat testdb ./mtest && ./mdb_stat testdb
mdb_stat: mdb_stat.o mdb.o idl.o libmdb.a: mdb.o idl.o
mtest: mtest.o mdb.o idl.o ar rs $@ mdb.o idl.o
mtest2: mtest2.o mdb.o idl.o
mtest3: mtest3.o 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 $@ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
%.o: %.c mdb.h %.o: %.c mdb.h

@ -14,7 +14,7 @@
* <http://www.OpenLDAP.org/license.html>. * <http://www.OpenLDAP.org/license.html>.
*/ */
#include <strings.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <assert.h> #include <assert.h>
#include "idl.h" #include "idl.h"

@ -17,7 +17,7 @@
#ifndef _MDB_IDL_H_ #ifndef _MDB_IDL_H_
#define _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 ID unsigned long
#define NOID ((ID)~0) #define NOID ((ID)~0)

Loading…
Cancel
Save