-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMakefile
52 lines (38 loc) · 1.03 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
export
DISCODB_VERSION = 0.2
DISCODB_RELEASE = 0.2
prefix = /usr/local
CFLAGS = -O3
CSRCS = $(wildcard src/*.c)
COBJS = $(patsubst %.c,%.o,$(CSRCS))
REBAR = rebar
PYTHON = python
SPHINXOPTS = "-D version=$(DISCODB_VERSION) -D release=$(DISCODB_RELEASE)"
.PHONY: build clean doc doc-clean erlang python
build: $(COBJS)
utils: create query
create query: build
$(CC) $(CFLAGS) -Isrc -o $@ src/util/[email protected] src/*.o -lcmph
src/%.o: src/%.c
$(CC) $(CFLAGS) -Isrc -c $< -o $@
libdiscodb.a: $(COBJS)
$(AR) -ruvs $@ $^
libdiscodb.so: $(COBJS)
$(CC) $(CFLAGS) -Isrc -shared -o $@ $^ -lcmph
clean:
rm -rf `find . -name \*.o`
rm -rf create query *.dSYM
rm -rf python/build
rm -rf erlang/ebin erlang/priv
doc:
(cd doc && $(MAKE) SPHINXOPTS=$(SPHINXOPTS) html)
doc-clean:
(cd doc && $(MAKE) SPHINXOPTS=$(SPHINXOPTS) clean)
doc-test:
(cd doc && $(MAKE) SPHINXOPTS=$(SPHINXOPTS) doctest)
erlang: CMD = compile
erlang:
(cd erlang && $(REBAR) $(CMD))
python: CMD = build
python:
(cd python && $(PYTHON) setup.py $(CMD))