diff --git a/Makefile b/Makefile index 8a74c871800a4ce8d89c3d69c2c665a438c8914d..02b41864fe201fe59519a7d22e5a74644ea37c2e 100644 --- a/Makefile +++ b/Makefile @@ -378,7 +378,13 @@ analyze: clean $(MAKE) dbg unity.cc: - $(shell (export ROCKSDB_ROOT="$(CURDIR)"; "$(CURDIR)/build_tools/unity" "$(CURDIR)/unity.cc")) + rm -f $@ $@-t + for source_file in $(LIB_SOURCES); do \ + echo "#include <$$source_file>" >> $@-t; \ + done + echo 'int main(int argc, char** argv){ return 0; }' >> $@-t + chmod a=r $@-t + mv $@-t $@ unity: unity.o $(AM_LINK) diff --git a/build_tools/unity b/build_tools/unity deleted file mode 100755 index 8138de542495cfd10e9246cf5b0e1678cc23df6f..0000000000000000000000000000000000000000 --- a/build_tools/unity +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# -# Create the unity file -# - -OUTPUT=$1 -if test -z "$OUTPUT"; then - echo "usage: $0 " >&2 - exit 1 -fi - -# Delete existing file, if it exists -rm -f "$OUTPUT" -touch "$OUTPUT" - -# Detect OS -if test -z "$TARGET_OS"; then - TARGET_OS=`uname -s` -fi - -# generic port files (working on all platform by #ifdef) go directly in /port -GENERIC_PORT_FILES=`cd "$ROCKSDB_ROOT"; find port -name '*.cc' | tr "\n" " "` - -# On GCC, we pick libc's memcmp over GCC's memcmp via -fno-builtin-memcmp -case "$TARGET_OS" in - Darwin) - # PORT_FILES=port/darwin/darwin_specific.cc - ;; - IOS) - ;; - Linux) - # PORT_FILES=port/linux/linux_specific.cc - ;; - SunOS) - # PORT_FILES=port/sunos/sunos_specific.cc - ;; - FreeBSD) - # PORT_FILES=port/freebsd/freebsd_specific.cc - ;; - NetBSD) - # PORT_FILES=port/netbsd/netbsd_specific.cc - ;; - OpenBSD) - # PORT_FILES=port/openbsd/openbsd_specific.cc - ;; - DragonFly) - # PORT_FILES=port/dragonfly/dragonfly_specific.cc - ;; - OS_ANDROID_CROSSCOMPILE) - # PORT_FILES=port/android/android.cc - ;; - *) - echo "Unknown platform!" >&2 - exit 1 -esac - -# We want to make a list of all cc files within util, db and table -# except for the test and benchmark files. By default, find will output a list -# of all files matching either rule, so we need to append -print to make the -# prune take effect. -DIRS="util db table utilities" - -set -f # temporarily disable globbing so that our patterns arent expanded -PRUNE_TEST="-name *test*.cc -prune" -PRUNE_BENCH="-name *bench*.cc -prune" -PORTABLE_FILES=`cd "$ROCKSDB_ROOT"; find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o -name '*.cc' -print | sort` -PORTABLE_CPP=`cd "$ROCKSDB_ROOT"; find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o -name '*.cpp' -print | sort` -set +f # re-enable globbing - -# The sources consist of the portable files, plus the platform-specific port -# file. -for SOURCE_FILE in $PORTABLE_FILES $GENERIC_PORT_FILES $PORT_FILES $PORTABLE_CPP -do - echo "#include <$SOURCE_FILE>" >> "$OUTPUT" -done - -echo "int main(int argc, char** argv){ return 0; }" >> "$OUTPUT" -