DIRS+=build
-obj/build/genhash: obj/build/genhash.o
+$(o)/build/genhash: $(o)/build/genhash.o
function try
{
TEST=$(($TEST+1))
- LOG=test$TEST.log
- echo "### Test $TEST: $@ ###" | tee $LOG
+ TDIR=tests/$TEST
+ mkdir $TDIR
+ echo "### Test $TEST: $@ ###" | tee $TDIR/log
CUST=$1
shift
fi
shift
done
- rm -rf custom
- cp -a $CUST custom
- sed "$SUBST;p;d" <$CUST/config.mk >custom/config.mk
- echo $APP | tr ! '\n' >>custom/config.mk
- make clean >>$LOG 2>&1
- rm -f run/cf/*
- if ! make >>$LOG 2>&1 ; then
- echo " FAILED"
- exit 1
- fi
- echo " PASSED"
+ (
+ cd $TDIR
+ cp -a ../../$CUST custom
+ sed "$SUBST;p;d" <../../$CUST/config.mk >custom/config.mk
+ echo $APP | tr ! '\n' >>custom/config.mk
+ if ! make -f ../../Makefile s=../.. >>log 2>&1 ; then
+ echo " FAILED"
+ exit 1
+ fi
+ echo " PASSED"
+ )
}
-if [ -e custom -a ! -e custom.old ] ; then
- mv custom custom.old
-fi
-
-rm -f test*.log
+rm -rf tests
+mkdir tests
if [ -n "$1" ] ; then
try "$@"
else
try debug/custom CONFIG_SHARED=1 # debugging configuration with shared libs
try debug/custom # debugging configuration
fi
-
-rm -rf custom
-if [ -e custom.old ] ; then
- mv custom.old custom
-fi
LIBCHARSET_MODS=toupper tolower tocat toligatures unaccent charconv setnames fb-charconv
LIBCHARSET_INCLUDES=charconv.h unicat.h fb-charconv.h
-obj/charset/libcharset.a: $(addsuffix .o,$(addprefix obj/charset/,$(LIBCHARSET_MODS)))
-obj/charset/libcharset.so: $(addsuffix .oo,$(addprefix obj/charset/,$(LIBCHARSET_MODS)))
+$(o)/charset/libcharset.a: $(addsuffix .o,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS)))
+$(o)/charset/libcharset.so: $(addsuffix .oo,$(addprefix $(o)/charset/,$(LIBCHARSET_MODS)))
-INCLUDES+=obj/charset/.include-stamp
-obj/charset/.include-stamp: $(addprefix charset/,$(LIBCHARSET_INCLUDES))
- build/install-includes charset run/include/charset $(?F)
- touch obj/charset/.include-stamp
+INCLUDES+=$(o)/charset/.include-stamp
+$(o)/charset/.include-stamp: $(addprefix $(s)/charset/,$(LIBCHARSET_INCLUDES))
+ $(s)/build/install-includes $(s)/charset run/include/charset $(?F)
+ touch $(o)/charset/.include-stamp
build_charsets:
- cd charset && sh misc/generate
+ cd $(s)/charset && sh misc/generate
clean::
- rm -f charset/misc/u-*
+ rm -f $(s)/charset/misc/u-*
DIRS+=lib
ifdef CONFIG_UCW_DBTOOL
-PROGS+=obj/lib/db-tool
+PROGS+=$(o)/lib/db-tool
endif
LIBUCW_MODS= \
qache.h
ifdef CONFIG_OWN_REGEX
-include lib/regex/Makefile
+include $(s)/lib/regex/Makefile
endif
-LIBUCW=obj/lib/libucw.$(LS)
-LIBUCW_MOD_PATHS=$(addprefix obj/lib/,$(LIBUCW_MODS))
+LIBUCW=$(o)/lib/libucw.$(LS)
+LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
-obj/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
-obj/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
+$(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
+$(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
-obj/lib/hashfunc.o obj/lib/hashfunc.oo: CFLAGS += -funroll-loops
-obj/lib/lizard.o: CFLAGS += -O6 -funroll-loops
+$(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
+$(o)/lib/lizard.o: CFLAGS += -O6 -funroll-loops
-obj/lib/db-test: obj/lib/db-test.o $(LIBUCW)
-obj/lib/db-tool: obj/lib/db-tool.o $(LIBUCW)
-obj/lib/conf-test: obj/lib/conf-test.o $(LIBUCW)
-obj/lib/sort-test: obj/lib/sort-test.o $(LIBUCW)
-obj/lib/lfs-test: obj/lib/lfs-test.o $(LIBUCW)
-obj/lib/hash-test: obj/lib/hash-test.o $(LIBUCW)
-obj/lib/str-test: obj/lib/str-test.o $(LIBUCW)
-obj/lib/asort-test: obj/lib/asort-test.o $(LIBUCW)
-obj/lib/redblack-test: obj/lib/redblack-test.o $(LIBUCW)
-obj/lib/binheap-test: obj/lib/binheap-test.o $(LIBUCW)
-obj/lib/lizard-test: obj/lib/lizard-test.o $(LIBUCW)
+$(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
+$(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
+$(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
+$(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
+$(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
+$(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
+$(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
+$(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
+$(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
+$(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
+$(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
-TESTS+=$(addprefix obj/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test)
-obj/lib/regex.test: obj/lib/regex-t
-obj/lib/unicode-utf8.test: obj/lib/unicode-utf8-t
-obj/lib/hash-test.test: obj/lib/hash-test
-obj/lib/mempool.test: obj/lib/mempool-fmt-t obj/lib/mempool-str-t
-obj/lib/stkstring.test: obj/lib/stkstring-t
+TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test)
+$(o)/lib/regex.test: $(o)/lib/regex-t
+$(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
+$(o)/lib/hash-test.test: $(o)/lib/hash-test
+$(o)/lib/mempool.test: $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
+$(o)/lib/stkstring.test: $(o)/lib/stkstring-t
-INCLUDES+=obj/lib/.include-stamp
-obj/lib/.include-stamp: $(addprefix lib/,$(LIBUCW_INCLUDES))
- build/install-includes lib run/include/lib $(?F)
- touch obj/lib/.include-stamp
+INCLUDES+=$(o)/lib/.include-stamp
+$(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
+ $(s)/build/install-includes $(s)/lib run/include/lib $(?F)
+ touch $(o)/lib/.include-stamp
ifdef CONFIG_UCW_PERL
-include lib/perl/Makefile
+include $(s)/lib/perl/Makefile
endif
ifdef CONFIG_UCW_SHELL_UTILS
-include lib/shell/Makefile
+include $(s)/lib/shell/Makefile
endif
# Perl modules
DIRS+=lib/perl
-PROGS+=$(addprefix obj/lib/perl/,Config.pm)
+PROGS+=$(addprefix $(o)/lib/perl/,Config.pm)
ifdef CONFIG_UCW_PERL_ULIMIT
-include lib/perl/Ulimit/Makefile
+include $(s)/lib/perl/Ulimit/Makefile
endif
+++ /dev/null
-Makefile.tmp
-Ulimit.bs
-Ulimit.c
-arch
-lib
-pm_to_blib
# Makefile for the Ulimit Perl module (c) 2003 Tomas Valla <tom@ucw.cz>
DIRS+=lib/perl/Ulimit/arch/auto/Sherlock/Ulimit
-
-
ULIMIT_DIR=lib/perl/Ulimit
-PROGS+=obj/lib/perl/Ulimit/Ulimit.pm
-DATAFILES+=obj/lib/perl/Ulimit/arch/auto/Sherlock/Ulimit/Ulimit.so
-
-
-lib/perl/Ulimit/arch/auto/Sherlock/Ulimit/Ulimit.so: $(ULIMIT_DIR)/Ulimit.xs $(ULIMIT_DIR)/Ulimit.pm $(ULIMIT_DIR)/Makefile.tmp
- cd $(ULIMIT_DIR) && $(MAKE) -f Makefile.tmp
-
-$(ULIMIT_DIR)/Makefile.tmp: $(ULIMIT_DIR)/Makefile.PL
- cd $(ULIMIT_DIR) && perl Makefile.PL
+PROGS+=$(o)/lib/perl/Ulimit/Ulimit.pm
+extras:: $(o)/lib/perl/Ulimit/arch/auto/Sherlock/Ulimit/Ulimit.so
-clean::
- cd $(ULIMIT_DIR) && if [ -f Makefile.tmp ]; then $(MAKE) -f Makefile.tmp distclean; fi && rm -rf lib arch
+$(o)/lib/perl/Ulimit/arch/auto/Sherlock/Ulimit/Ulimit.so: $(o)/$(ULIMIT_DIR)/Ulimit.xs $(o)/$(ULIMIT_DIR)/Ulimit.pm $(o)/$(ULIMIT_DIR)/Makefile
+ cd $(o)/$(ULIMIT_DIR) && $(MAKE) -f Makefile
+ cp $@ run/$(DATADIR)/
+$(o)/$(ULIMIT_DIR)/Makefile: $(o)/$(ULIMIT_DIR)/Makefile.PL
+ cd $(o)/$(ULIMIT_DIR) && perl Makefile.PL
+$(o)/$(ULIMIT_DIR)/%: $(s)/$(ULIMIT_DIR)/%
+ cp $^ $@
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'Sherlock::Ulimit',
- 'MAKEFILE' => 'Makefile.tmp',
'VERSION_FROM' => 'Ulimit.pm',
'INST_LIB' => 'lib',
'INST_ARCHLIB' => 'arch',
LIBUCW_MODS+=regex/regex
-obj/lib/regex/regex.o obj/lib/regex/regex.oo: CWARNS=
+$(o)/lib/regex/regex.o $(o)/lib/regex/regex.oo: CWARNS=
# Support routines for shell scripts
DIRS+=lib/shell
-PROGS+=obj/lib/shell/config obj/lib/shell/logger
+PROGS+=$(o)/lib/shell/config $(o)/lib/shell/logger
-obj/lib/shell/config: obj/lib/shell/config.o $(LIBSH)
-obj/lib/shell/logger: obj/lib/shell/logger.o $(LIBSH)
+$(o)/lib/shell/config: $(o)/lib/shell/config.o $(LIBSH)
+$(o)/lib/shell/logger: $(o)/lib/shell/logger.o $(LIBSH)