-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
42 lines (32 loc) · 1016 Bytes
/
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
CC = gcc
CXX = g++
CFLAGS = -W -Wall -Wextra -ansi -pedantic -lm -O2 -Wno-unused-function
CXXFLAGS = -W -Wall -Wextra -ansi -pedantic -O2
ZOPFLI_RUST_DEBUG := target/debug/libzopfli.a
ZOPFLI_RUST_RELEASE := target/release/libzopfli.a
ZOPFLILIB_OBJ := $(patsubst src/zopfli/%.c,%.o,$(ZOPFLILIB_SRC))
.PHONY: zopfli
.PHONY: target/debug/libzopfli.a
target/debug/libzopfli.a:
cargo build --verbose
.PHONY: target/release/libzopfli.a
target/release/libzopfli.a:
cargo build --verbose --release
# Zopfli binary
zopfli: $(ZOPFLI_RUST_RELEASE)
ln -sf target/release/zopfli zopfli
# Zopfli debug binary
zopflidebug: $(ZOPFLI_RUST_DEBUG)
ln -sf target/debug/zopfli zopfli
# Zopfli shared library
libzopfli:
$(CC) $(ZOPFLILIB_SRC) $(CFLAGS) -fPIC -c
$(CC) $(ZOPFLILIB_OBJ) $(CFLAGS) -shared -Wl,-soname,libzopfli.so.1 -o libzopfli.so.1.0.1
.PHONY: test
test:
cargo test --release
./test/run.sh
# Remove all libraries and binaries
.PHONY: clean
clean:
cargo clean && rm -f zopfli $(ZOPFLILIB_OBJ) libzopfli*