This repository has been archived by the owner on Dec 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
65 lines (50 loc) · 1.62 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Simple Makefile
#
# make shared : make shared lib
# make lib : make static lib (nyi)
# make check
#
# You can also use 'dub' and 'dub test' instead
D_COMPILER=ldc2
DFLAGS = -wi -g -relocation-model=pic -Icontrib/undead -L-lz
ifndef GUIX
ifdef GUIX_ENVIRONMENT
GUIX=$(GUIX_ENVIRONMENT)
endif
endif
ifdef GUIX
LIBRARY_PATH=$(GUIX)/lib
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/unittests.d test/read_bam_file.d
OBJ = $(SRC:.d=.o)
BIN = bin/biod_tests
shared: LIB = libbiod.so
lib: LIB = libbiod
# debug check: DFLAGS += -O0 -d-debug -unittest -link-debuglib
check: DFLAGS += -O0 -d-debug -link-debuglib -unittest
release static: DFLAGS += -O3 -release -enable-inlining -boundscheck=off
static: DFLAGS += -static -L-Bstatic
shared: DFLAGS += -shared
lib: DFLAGS += -lib
all: debug
default: all
default debug release static: $(BIN)
shared lib: $(LIB)
%.o: %.d
$(D_COMPILER) $(DFLAGS) -c $< -od=$(dir $@)
$(LIB): $(OBJ)
$(info linking lib...)
$(D_COMPILER) $(DFLAGS) $(OBJ) -of=$(LIB)
$(BIN): $(OBJ)
$(info linking...)
$(D_COMPILER) $(DFLAGS) $(OBJ) -of=$(BIN)
check: $(BIN)
$(info Make check running tests...)
$(BIN)
# $(BIN) "--DRT-gcopt=gc:precise disable:1 cleanup:none"
clean:
rm -vf $(OBJ)
rm -v $(BIN)
# find -name '*.o' -exec rm \{\} \;