-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
70 lines (49 loc) · 2.1 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
61
62
63
64
65
66
67
68
69
70
DEPDIR=$(PWD)/deps
BUILDDIR=$(PWD)/build
LIBECSRC=$(DEPDIR)/liberasurecode
ISALSRC=$(DEPDIR)/isa-l
GFCOMPLETESRC=$(DEPDIR)/gf-complete
JERASURESRC=$(DEPDIR)/jerasure
.PHONY: default test clean pretty cmds
default: $(BUILDDIR)/lib/liberasurecode.a $(BUILDDIR)/lib/libisal.a $(BUILDDIR)/lib/libJerasure.la cmds
PKG_CONFIG_PATH=$(BUILDDIR)/lib/pkgconfig \
go build
test: $(BUILDDIR)/lib/liberasurecode.a $(BUILDDIR)/lib/libisal.a $(BUILDDIR)/lib/libJerasure.la
DYLIB_LIBRARY_PATH=$(BUILDDIR)/lib \
LD_LIBRARY_PATH=$(BUILDDIR)/lib \
PKG_CONFIG_PATH=$(BUILDDIR)/lib/pkgconfig \
go test -v
cmds: ec-split ec-info
ec-split: $(PWD)/cmd/ec-split/main.go $(PWD)/backend.go $(PWD)/streaming.go
PKG_CONFIG_PATH=$(BUILDDIR)/lib/pkgconfig \
go build github.com/tipabu/erasurecode/cmd/ec-split
ec-info: $(PWD)/cmd/ec-info/main.go $(PWD)/backend.go $(PWD)/streaming.go
PKG_CONFIG_PATH=$(BUILDDIR)/lib/pkgconfig \
go build github.com/tipabu/erasurecode/cmd/ec-info
clean:
rm -rf $(BUILDDIR) $(DEPDIR)
pretty:
find $(PWD) -name '*.go' | xargs gofmt -l -w
$(ISALSRC)/autogen.sh:
git clone https://github.com/01org/isa-l.git $(ISALSRC)
$(LIBECSRC)/autogen.sh:
git clone https://github.com/openstack/liberasurecode.git $(LIBECSRC)
$(JERASURESRC)/configure.ac:
git clone https://github.com/ceph/jerasure.git $(JERASURESRC)
$(GFCOMPLETESRC)/autogen.sh:
git clone https://github.com/ceph/gf-complete.git $(GFCOMPLETESRC)
$(PWD)/deps/%/configure: $(PWD)/deps/%/autogen.sh
cd $(@D) && ./autogen.sh
$(JERASURESRC)/configure: $(JERASURESRC)/configure.ac
cd $(@D) && autoreconf --force --install
$(PWD)/deps/%/Makefile: $(PWD)/deps/%/configure
cd $(@D) && ./configure --prefix=$(BUILDDIR) \
LDFLAGS=-L$(BUILDDIR)/lib CPPFLAGS=-I$(BUILDDIR)/include
$(BUILDDIR)/lib/liberasurecode.a: $(LIBECSRC)/Makefile
cd $(LIBECSRC) && make install
$(BUILDDIR)/lib/libisal.a: $(ISALSRC)/Makefile
cd $(ISALSRC) && make install
$(BUILDDIR)/lib/libgf_complete.a: $(GFCOMPLETESRC)/Makefile
cd $(GFCOMPLETESRC) && make install
$(BUILDDIR)/lib/libJerasure.la: $(BUILDDIR)/lib/libgf_complete.a $(JERASURESRC)/Makefile
cd $(JERASURESRC) && make install