-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (45 loc) · 1.26 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
ZLIBVER = 1.2.11
ZLIB = zlib-$(ZLIBVER)
ZLIBZ = $(ZLIB).tar.gz
XPCOREVER = 1.4.17
XPCORE = xapian-core-$(XPCOREVER)
XPCOREZ = $(XPCORE).tar.xz
.PHONY: build release clean target/debug/mdq target/release/mdq
CARGO ?= cargo
build: target/debug/mdq
tag:
git tag v`cargo metadata --format-version 1 | jq -r '.packages[] | select(.name =="mdq") | .version'` && \
git push --tags
release: target/release/mdq
target/debug/mdq: $(ZLIB) $(XPCORE)/.libs
$(CARGO) build $(TARGET_FLAGS)
target/release/mdq: $(ZLIB) $(XPCORE)/.libs
$(CARGO) build --release $(TARGET_FLAGS)
test: $(ZLIB) $(XPCORE)/.libs
$(CARGO) test
run: $(ZLIB) $(XPCORE)/.libs
$(CARGO) run
clean:
rm -rf $(ZLIB)
rm -rf $(XPCORE)
$(CARGO) clean
# Fetch dependencies
$(ZLIBZ):
wget https://zlib.net/$(ZLIBZ)
$(XPCOREZ):
wget https://oligarchy.co.uk/xapian/$(XPCOREVER)/$(XPCOREZ)
$(ZLIB): $(ZLIBZ)
tar -xvzf $(ZLIBZ)
cd $(ZLIB) \
&& ./configure --static \
&& $(MAKE)
$(XPCORE): $(XPCOREZ)
tar -xvf $(XPCOREZ)
$(XPCORE)/.libs: $(ZLIB) $(XPCORE)
# Apply patches to xapian-core from xapian-rusty:
cp -R xapian-rusty/include $(XPCORE)/.
cp omenquire.cc $(XPCORE)/api/
# Build it
cd $(XPCORE) \
&& ./configure --enable-static --disable-shared CPPFLAGS=-I../$(ZLIB) LDFLAGS=-L../$(ZLIB) \
&& $(MAKE)