radare2/shlr/sdb/Makefile

166 lines
5.3 KiB
Makefile
Raw Normal View History

include config.mk
2012-09-17 09:18:20 +00:00
VALADIR=bindings/vala
PWD=$(shell pwd)
PFX=${DESTDIR}${PREFIX}
HGFILES=`find sdb-${SDBVER} -type f | grep -v hg | grep -v swp`
MKDIR=mkdir
all: pkgconfig src/sdb_version.h
2013-04-01 03:52:21 +00:00
${MAKE} -C src
2015-05-24 21:30:13 +00:00
ifeq ($(BUILD_MEMCACHE),1)
2013-04-01 03:52:21 +00:00
${MAKE} -C memcache
endif
2016-10-20 19:12:52 +00:00
vala:
ifneq (${HAVE_VALA},)
2012-09-17 09:18:20 +00:00
cd ${VALADIR} && ${MAKE}
cd ${VALADIR}/types && ${MAKE}
2016-10-20 19:12:52 +00:00
else
@echo Nothing to do.
endif
.PHONY: test sdb.js pkgconfig
2014-01-14 01:57:21 +00:00
test:
${MAKE} -C test
asan:
${MAKE} src/sdb_version.h
2016-10-20 19:12:52 +00:00
${MAKE} -C src CC="gcc -fsanitize=address" all
pkgconfig:
2014-11-19 21:50:54 +00:00
[ -d pkgconfig ] && ${MAKE} -C pkgconfig || true
src/sdb_version.h:
echo '#define SDB_VERSION "${SDBVER}"' > src/sdb_version.h
CFILES=cdb.c buffer.c cdb_make.c ls.c ht.c sdb.c num.c base64.c
CFILES+=json.c ns.c lock.c util.c disk.c query.c array.c fmt.c main.c
EMCCFLAGS=-O2 -s EXPORTED_FUNCTIONS="['_sdb_querys','_sdb_new0']"
2013-04-05 01:09:54 +00:00
#EMCCFLAGS+=--embed-file sdb.data
sdb.js: src/sdb_version.h
cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js ${CFILES}
clean:
rm -f src/sdb_version.h
cd src && ${MAKE} clean
2013-03-13 10:58:36 +00:00
cd memcache && ${MAKE} clean
cd test && ${MAKE} clean
2013-04-30 23:43:35 +00:00
ifneq (${HAVE_VALA},)
2012-09-17 09:18:20 +00:00
cd ${VALADIR} && ${MAKE} clean
2013-04-30 23:43:35 +00:00
endif
dist:
rm -f sdb-${SDBVER}.tar.gz
rm -rf sdb-${SDBVER}
git clone . sdb-${SDBVER}
rm -rf sdb-${SDBVER}/.git*
tar czvf sdb-${SDBVER}.tar.gz sdb-${SDBVER}
pub sdb-${SDBVER}.tar.gz
rm -rf sdb-${SDBVER}
2015-05-24 21:30:13 +00:00
w32dist:
rm -f sdb-${SDBVER}.zip
rm -rf sdb-${SDBVER}
mkdir -p sdb-${SDBVER}
cp src/sdb.exe sdb-${SDBVER}
zip -r sdb-${SDBVER}.zip sdb-${SDBVER}
rm -rf sdb-${SDBVER}
2015-05-24 21:30:13 +00:00
install-dirs:
$(INSTALL_DIR) ${DESTDIR}${MANDIR} ${DESTDIR}${LIBDIR}/pkgconfig ${DESTDIR}${BINDIR}
$(INSTALL_DIR) ${DESTDIR}${DATADIR}/vala/vapi ${DESTDIR}${INCDIR}/sdb
INCFILES=src/sdb.h src/sdb_version.h src/cdb.h src/ht.h src/types.h
2014-02-05 15:36:03 +00:00
INCFILES+=src/ls.h src/cdb_make.h src/buffer.h src/config.h
install: pkgconfig install-dirs
$(INSTALL_MAN) src/sdb.1 ${DESTDIR}${MANDIR}
$(INSTALL_LIB) src/libsdb.${EXT_SO} ${DESTDIR}${LIBDIR}
2017-05-24 23:57:10 +00:00
$(INSTALL_DATA) src/libsdb.a ${DESTDIR}${LIBDIR}
2015-07-13 14:02:28 +00:00
-if [ "$(EXT_SO)" != "$(SOVER)" ]; then \
cd ${DESTDIR}${LIBDIR} ; \
2015-07-13 14:02:28 +00:00
mv libsdb.$(EXT_SO) libsdb.$(SOVER) ; \
ln -s libsdb.$(SOVER) libsdb.$(EXT_SO) ; \
2015-10-16 10:54:44 +00:00
ln -s libsdb.$(SOVER) libsdb.$(EXT_SO).$(SOVERSION) ; \
fi
$(INSTALL_DATA) $(INCFILES) ${DESTDIR}${INCDIR}/sdb
$(INSTALL_PROGRAM) src/sdb ${DESTDIR}${BINDIR}
ifeq ($(BUILD_MEMCACHE),1)
2017-05-24 23:57:10 +00:00
$(INSTALL_DATA) memcache/libmcsdb.a ${DESTDIR}${LIBDIR}
$(INSTALL_DATA) memcache/mcsdb.h ${DESTDIR}${INCDIR}/sdb
$(INSTALL_PROGRAM) memcache/mcsdbd ${DESTDIR}${BINDIR}
$(INSTALL_PROGRAM) memcache/mcsdbc ${DESTDIR}${BINDIR}
$(INSTALL_DATA) pkgconfig/mcsdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
endif
$(INSTALL_DATA) pkgconfig/sdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
ifneq (${HAVE_VALA},)
2017-09-30 16:34:19 +00:00
test -f ${VALADIR}/types/sdbtypes.h || $(MAKE) -C $(VALADIR)/types
$(INSTALL_DATA) ${VALADIR}/sdb.vapi ${DESTDIR}${DATADIR}/vala/vapi
cd ${VALADIR}/types && ${MAKE} install DESTDIR=${DESTDIR} PREFIX=${PREFIX}
ifeq ($(BUILD_MEMCACHE),1)
$(INSTALL_DATA) ${VALADIR}/mcsdb.vapi ${DESTDIR}${DATADIR}/vala/vapi
endif
endif
deinstall uninstall:
rm -rf ${DESTDIR}${INCDIR}/sdb
rm -f ${DESTDIR}${BINDIR}/sdb
rm -f ${DESTDIR}${BINDIR}/mcsdbc
rm -f ${DESTDIR}${BINDIR}/mcsdbd
rm -f ${DESTDIR}${LIBDIR}/libsdb.*
2017-05-24 23:57:10 +00:00
rm -f ${DESTDIR}${LIBDIR}/libmcsdb.a
rm -f ${DESTDIR}${LIBDIR}/pkgconfig/sdb.pc
rm -f ${DESTDIR}${LIBDIR}/pkgconfig/mcsdb.pc
rm -f ${DESTDIR}${MANDIR}/sdb.1
ifneq (${HAVE_VALA},)
rm -f ${DESTDIR}${DATADIR}/vala/vapi/sdb.vapi
rm -f ${DESTDIR}${DATADIR}/vala/vapi/mcsdb.vapi
cd ${VALADIR}/types && ${MAKE} uninstall DESTDIR=${DESTDIR} PREFIX=${PREFIX}
endif
symstall: install-dirs
cd src ; for a in libsdb.* ; do \
ln -fs ${PWD}/src/$$a ${DESTDIR}${LIBDIR}/$$a ; done
ln -fs ${PWD}/src/sdb.1 ${DESTDIR}${MANDIR}/sdb.1
ln -fs ${PWD}/src/sdb ${DESTDIR}${BINDIR}
ln -fs ${PWD}/src/sdb.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/sdb_version.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/cdb.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/ht.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/types.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/ls.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/cdb_make.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/buffer.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/src/config.h ${DESTDIR}${INCDIR}/sdb
ln -fs ${PWD}/bindings/vala/sdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
ln -fs ${PWD}/bindings/vala/mcsdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
ifneq (${HAVE_VALA},)
$(MKDIR) -p ${DESTDIR}$(VAPIDIR)
ln -fs ${PWD}/bindings/vala/sdb.vapi ${DESTDIR}$(VAPIDIR)
ln -fs ${PWD}/bindings/vala/mcsdb.vapi ${DESTDIR}$(VAPIDIR)
ln -fs ${PWD}/bindings/vala/sdb.vapi ${DESTDIR}$(VAPIDIR)
ln -fs ${PWD}/bindings/vala/mcsdb.vapi ${DESTDIR}$(VAPIDIR)
cd ${VALADIR}/types && ${MAKE} symstall DESTDIR=${DESTDIR} PREFIX=${PREFIX}
endif
2013-04-01 03:52:21 +00:00
# windows compiler prefix
2015-05-11 23:36:42 +00:00
# travis/debian
2013-04-01 03:52:21 +00:00
WCP=i386-mingw32
2015-05-11 23:36:42 +00:00
# mxe
2015-04-01 00:07:29 +00:00
#WCP=i686-pc-mingw32
2013-04-01 03:52:21 +00:00
w32: src/sdb_version.h
2013-04-01 03:52:21 +00:00
cd src ; \
${MAKE} OS=w32 WCP=${WCP} CC=${WCP}-gcc AR=${WCP}-ar RANLIB=${WCP}-ranlib sdb.exe
2013-04-01 03:52:21 +00:00
2015-03-30 23:31:35 +00:00
# ios toolchain
IOS_CC=$(shell xcrun --sdk iphoneos --find clang) -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -arch armv7 -arch arm64
IOS_AR=$(shell xcrun --sdk iphoneos --find ar)
IOS_RL=$(shell xcrun --sdk iphoneos --find ranlib)
ios: src/sdb_version.h
2015-03-30 23:31:35 +00:00
${MAKE} OS=Darwin ARCH=arm CC="${IOS_CC}" AR="${IOS_AR}" RANLIB="${IOS_RL}" HAVE_VALA= all
.PHONY: all ${VALADIR} clean dist w32 ios
2013-04-01 03:52:21 +00:00
.PHONY: install-dirs install uninstall deinstall symstall