Commit 147d9c78 authored by David Disseldorp's avatar David Disseldorp

ntdb: build core components via static Makefile

As part of Samba, ntdb was built using the Waf build system. As part of
ccan, convert this to a simple Makefile, and add a static config.h.

The Makefile only builds core ntdb components for now - libntdb and
tools.
Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
parent d69ef83f
# simple makefile wrapper to run waf CC=gcc
CFLAGS=-g -O0 -Wall -W -I../../ -I./
LIBS=
WAF=WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$$PATH waf LIBNTDB_OBJ = ccan_hash.o ccan_tally.o check.o free.o hash.o io.o lock.o open.o summary.o ntdb.o transaction.o traverse.o
all: all: ntdbtorture ntdbtool ntdbdump ntdbrestore ntdbbackup
$(WAF) build
install: ntdbtorture: tools/ntdbtorture.c libntdb.a
$(WAF) install $(CC) $(CFLAGS) -o tools/$@ tools/$@.c libntdb.a $(LIBS)
uninstall: ntdbtool: tools/ntdbtool.c libntdb.a
$(WAF) uninstall $(CC) $(CFLAGS) -o tools/$@ tools/$@.c libntdb.a $(LIBS)
test: FORCE ntdbdump: tools/ntdbdump.c libntdb.a
$(WAF) test $(TEST_OPTIONS) $(CC) $(CFLAGS) -o tools/$@ tools/$@.c libntdb.a $(LIBS)
testenv: ntdbrestore: tools/ntdbrestore.c libntdb.a
$(WAF) test --testenv $(TEST_OPTIONS) $(CC) $(CFLAGS) -o tools/$@ tools/$@.c libntdb.a $(LIBS)
quicktest: ntdbbackup: tools/ntdbbackup.c libntdb.a
$(WAF) test --quick $(TEST_OPTIONS) $(CC) $(CFLAGS) -o tools/$@ tools/$@.c libntdb.a $(LIBS)
dist: libntdb.a: $(LIBNTDB_OBJ)
touch .tmplock @echo Creating library $@
WAFLOCK=.tmplock $(WAF) dist ar r libntdb.a $(LIBNTDB_OBJ)
ranlib libntdb.a
distcheck: check.o: check.c
touch .tmplock @echo Compiling $@
WAFLOCK=.tmplock $(WAF) distcheck $(CC) $(CFLAGS) -c check.c -o $@
clean: free.o: free.c
$(WAF) clean @echo Compiling $@
$(CC) $(CFLAGS) -c free.c -o $@
distclean:
$(WAF) distclean
reconfigure: configure hash.o: hash.c
$(WAF) reconfigure @echo Compiling $@
$(CC) $(CFLAGS) -c hash.c -o $@
show_waf_options: io.o: io.c
$(WAF) --help @echo Compiling $@
$(CC) $(CFLAGS) -c io.c -o $@
# some compatibility make targets lock.o: lock.c
everything: all @echo Compiling $@
$(CC) $(CFLAGS) -c lock.c -o $@
testsuite: all open.o: open.c
@echo Compiling $@
$(CC) $(CFLAGS) -c open.c -o $@
.PHONY: check summary.o: summary.c
check: test @echo Compiling $@
$(CC) $(CFLAGS) -c summary.c -o $@
torture: all ntdb.o: ntdb.c
@echo Compiling $@
$(CC) $(CFLAGS) -c ntdb.c -o $@
# this should do an install as well, once install is finished transaction.o: transaction.c
installcheck: test @echo Compiling $@
$(CC) $(CFLAGS) -c transaction.c -o $@
etags: traverse.o: traverse.c
$(WAF) etags @echo Compiling $@
$(CC) $(CFLAGS) -c traverse.c -o $@
ctags: ccan_hash.o: ../hash/hash.c
$(WAF) ctags @echo Compiling $@
$(CC) $(CFLAGS) -c ../hash/hash.c -o $@
pydoctor: ccan_tally.o: ../tally/tally.c
$(WAF) pydoctor @echo Compiling $@
$(CC) $(CFLAGS) -c ../tally/tally.c -o $@
bin/%:: FORCE clean:
$(WAF) --targets=`basename $@` rm -f *.o
FORCE: rm -f *.a
rm -f tools/ntdbtorture tools/ntdbtool tools/ntdbdump tools/ntdbrestore tools/ntdbbackup
This diff is collapsed.
#!/bin/sh
PREVPATH=`dirname $0`
if [ -f $PREVPATH/../../buildtools/bin/waf ]; then
WAF=../../buildtools/bin/waf
elif [ -f $PREVPATH/buildtools/bin/waf ]; then
WAF=./buildtools/bin/waf
else
echo "replace: Unable to find waf"
exit 1
fi
# using JOBS=1 gives maximum compatibility with
# systems like AIX which have broken threading in python
JOBS=1
export JOBS
cd . || exit 1
$WAF configure "$@" || exit 1
cd $PREVPATH
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment