File: posix.mak

package info (click to toggle)
sambamba 1.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,900 kB
  • sloc: javascript: 552; sh: 220; python: 166; ruby: 147; makefile: 104; lisp: 85
file content (50 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download
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
# build mode: 32bit or 64bit
MODEL ?= $(shell getconf LONG_BIT)

ifeq (,$(DMD))
	DMD := dmd
endif

LIB    = libmsgpack-d.a
DFLAGS = -Isrc -m$(MODEL) -d -w -dip25 -dip1000

ifeq (true, $(EnableReal))
	DFLAGS += -version=EnableReal
endif

ifeq ($(BUILD),debug)
	DFLAGS += -g -debug
else
	DFLAGS += -O -release -nofloat -inline -noboundscheck
endif

NAMES = attribute common package register unpacker buffer exception packer streaming_unpacker  value
FILES = $(addsuffix .d, $(NAMES))
SRCS  = $(addprefix src/msgpack/, $(FILES))

# DDoc
DOCS      = $(addsuffix .html, $(NAMES))
DOCDIR    = html
CANDYDOC  = $(addprefix html/candydoc/, candy.ddoc modules.ddoc)
DDOCFLAGS = -Dd$(DOCDIR) -c -o- -Isrc $(CANDYDOC)

target: doc $(LIB)

$(LIB):
	$(DMD) $(DFLAGS) -lib -of$(LIB) $(SRCS)

doc:
	$(DMD) $(DDOCFLAGS) $(SRCS)

clean:
	rm $(addprefix $(DOCDIR)/, $(DOCS)) $(LIB)

MAIN_FILE = "empty_msgpack_unittest.d"

unittest:
	echo 'import msgpack; void main(){}' > $(MAIN_FILE)
	$(DMD) $(DFLAGS) -unittest -of$(LIB) $(SRCS) -run $(MAIN_FILE)
	rm $(MAIN_FILE)

run_examples:
	echo example/* | xargs -n 1 $(DMD) src/msgpack/*.d $(DFLAGS) -Isrc -run