-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
42 lines (33 loc) · 950 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
repo = github.com/pixiv/go-libwebp
build_dir = /tmp
cur_dir = $(shell pwd)
libwebp_so = ${LIBWEBP_PREFIX}/lib/libwebp.so
LIBWEBP_VERSION ?= 1.3.1
all: test
test:
go test -v --ldflags "-extldflags '$(GOLIBWEBP_EXTLDFLAGS)'" ./...
libwebp: $(libwebp_so)
$(libwebp_so):
cd $(build_dir) \
&& wget http://downloads.webmproject.org/releases/webp/libwebp-$(LIBWEBP_VERSION).tar.gz \
&& tar xf libwebp-$(LIBWEBP_VERSION).tar.gz \
&& cd libwebp-$(LIBWEBP_VERSION) \
&& ./configure --prefix=$(LIBWEBP_PREFIX) \
&& make \
&& make install
docker-test:
docker run -v $(cur_dir):/go/src/$(repo) -it go-libwebp:$(LIBWEBP_VERSION)
docker-sh:
docker run -v $(cur_dir):/go/src/$(repo) -it go-libwebp:$(LIBWEBP_VERSION) sh
docker-build:
docker build -t go-libwebp:$(LIBWEBP_VERSION) .
docker-clean:
docker rm $$(docker ps -a -q -f "ancestor=go-libwebp")
.PHONY: \
all \
test \
libwebp \
docker-test \
docker-sh \
docker-build \
docker-clean