forked from repeatedly/xxhash-d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathposix.mak
40 lines (30 loc) · 827 Bytes
/
posix.mak
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
# build mode: 32bit or 64bit
MODEL ?= $(shell getconf LONG_BIT)
DMD ?= dmd
LIB = libxxhash.a
DFLAGS = -Isrc -m$(MODEL) -w -d
ifeq ($(BUILD),debug)
DFLAGS += -g -debug
else
DFLAGS += -O -release -nofloat -inline
endif
NAMES = xxhash
FILES = $(addsuffix .d, $(NAMES))
SRCS = $(addprefix src/, $(FILES))
# DDoc
DOCS = $(addsuffix .html, $(NAMES))
DOCDIR = html
CANDYDOC = $(addprefix html/candydoc/, candy.ddoc modules.ddoc)
DDOCFLAGS = -Dd$(DOCDIR) -c -o- -Isrc $(CANDYDOC)
target: $(LIB)
$(LIB):
$(DMD) $(DFLAGS) -lib -of$(LIB) $(SRCS)
doc:
$(DMD) $(DDOCFLAGS) $(SRCS)
clean:
rm $(addprefix $(DOCDIR)/, $(DOCS)) $(LIB)
MAIN_FILE = "empty_xxhash_unittest.d"
unittest:
echo 'import xxhash; void main(){}' > $(MAIN_FILE)
$(DMD) $(DFLAGS) -unittest -of$(LIB) $(SRCS) -run $(MAIN_FILE)
rm $(MAIN_FILE)