Skip to content

Commit caba001

Browse files
committed
Make to use dependencies and variables.
1 parent ad17bf0 commit caba001

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Makefile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
BUILDDIR=/tmp
2-
WORKDIR=github.com/harukasan/go-libwebp
3-
CURDIR=$(shell pwd)
1+
repo=github.com/harukasan/go-libwebp
2+
build_dir=/tmp
3+
cur_dir=$(shell pwd)
4+
libwebp_so = ${LIBWEBP_PREFIX}/lib/libwebp.so
45

56
all: test
67

78
test:
8-
go test -v ${WORKDIR}/...
9-
10-
libwebp:
11-
test -e ${LIBWEBP_PREFIX}/lib/libwebp.so || ( \
12-
cd ${BUILDDIR} \
13-
&& wget http://downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP_VERSION}.tar.gz \
14-
&& tar xf libwebp-${LIBWEBP_VERSION}.tar.gz \
15-
&& cd libwebp-${LIBWEBP_VERSION} \
16-
&& ./configure --prefix=${LIBWEBP_PREFIX} \
17-
&& make \
18-
&& make install \
19-
)
9+
go test -v $(repo)/...
10+
11+
libwebp: $(libwebp_so)
12+
13+
$(libwebp_so):
14+
cd $(build_dir) \
15+
&& wget http://downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP_VERSION}.tar.gz \
16+
&& tar xf libwebp-${LIBWEBP_VERSION}.tar.gz \
17+
&& cd libwebp-${LIBWEBP_VERSION} \
18+
&& ./configure --prefix=${LIBWEBP_PREFIX} \
19+
&& make \
20+
&& make install
2021

2122
docker-test:
22-
docker run -v ${CURDIR}:/go/src/github.com/harukasan/go-libwebp -it go-libwebp
23+
docker run -v $(cur_dir):/go/src/$(repo) -it go-libwebp
2324

2425
docker-sh:
25-
docker run -v ${CURDIR}:/go/src/github.com/harukasan/go-libwebp -it go-libwebp sh
26+
docker run -v $(cur_dir):/go/src/$(repo) -it go-libwebp sh
2627

2728
docker-build:
2829
docker build -t go-libwebp .
2930

30-
3131
.PHONY: \
3232
all \
3333
test \

0 commit comments

Comments
 (0)