diff --git a/Makefile b/Makefile index 5788e8a..54ceeec 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ # Simple Makefile +# +# make sharedlibrary : make shared library D_COMPILER=ldc2 -DFLAGS = -wi -g -relocation-model=pic -unittest -Icontrib/undead -L-lz +DFLAGS = -wi -g -relocation-model=pic -Icontrib/undead -L-lz ifndef GUIX ifdef GUIX_ENVIRONMENT @@ -15,19 +17,21 @@ endif DLIBS = $(LIBRARY_PATH)/libphobos2-ldc.a $(LIBRARY_PATH)/libdruntime-ldc.a DLIBS_DEBUG = $(LIBRARY_PATH)/libphobos2-ldc-debug.a $(LIBRARY_PATH)/libdruntime-ldc-debug.a -SRC = $(wildcard contrib/undead/*.d) contrib/undead/*/*.d $(wildcard bio/*.d bio/*/*.d bio/*/*/*.d bio/*/*/*/*.d bio/*/*/*/*/*.d bio/*/*/*/*/*/*.d) test/*.d +SRC = $(wildcard contrib/undead/*.d) contrib/undead/*/*.d $(wildcard bio/*.d bio/*/*.d bio/*/*/*.d bio/*/*/*/*.d bio/*/*/*/*/*.d bio/*/*/*/*/*/*.d) test/unittests.d OBJ = $(SRC:.d=.o) BIN = bin/biod_tests +sharedlibrary: BIN = libbiod.so -debug: DFLAGS += -O0 -d-debug -link-debuglib +debug check: DFLAGS += -O0 -d-debug -unittest -link-debuglib release static: DFLAGS += -O3 -release -enable-inlining -boundscheck=off static: DFLAGS += -static -L-Bstatic +sharedlibrary: DFLAGS += -shared all: debug default: all -default debug release static: $(BIN) +default debug release static sharedlibrary: $(BIN) %.o: %.d $(D_COMPILER) $(DFLAGS) -c $< -od=$(dir $@) diff --git a/README.md b/README.md index 9c4b2b4..a178031 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ When using gdb, switch off these handlers It can be passed in from the command line -`gdb -iex "handle SIGUSR1 SIGUSR2 no stop noprint" biod_test` + gdb -ex "handle SIGUSR1 SIGUSR2 nostop noprint" ./bin/biod_tests ## Usage diff --git a/test/unittests.d b/test/unittests.d index 9c8fd4a..0d696be 100644 --- a/test/unittests.d +++ b/test/unittests.d @@ -64,9 +64,9 @@ CigarOperation[] cigarFromString(string cigar) { } unittest { - stderr.writeln("Running unittests..."); // stderr.writeln("Testing extracting SAM header..."); + auto fn = buildPath(dirName(__FILE__), "data", "ex1_header.bam"); auto bf = new BamReader(fn); assert(bf.header.format_version == "1.3"); @@ -482,4 +482,4 @@ unittest { } } -// void main() {} +void main() {}