-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (23 loc) · 723 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
KFS_GIT_URL ?= github.com/cea-hpc/kfs
prefix ?= /usr
sbindir ?= $(prefix)/sbin
datarootdir ?= $(prefix)/share
mandir ?= $(datarootdir)/man
GO ?= go
KFS_SRC = $(wildcard cmd/kfs/*.go)
KFS_USER_SRC = $(wildcard cmd/kfs-user/*.go)
EXE = $(addprefix bin/, kfs kfs-user)
all: exe
exe: $(EXE)
bin/kfs: $(KFS_SRC)
$(GO) build -mod=vendor -o $@ $(KFS_GIT_URL)/cmd/kfs
bin/kfs-user: $(KFS_USER_SRC)
$(GO) build -mod=vendor -o $@ $(KFS_GIT_URL)/cmd/kfs-user
install: install-binaries
install-binaries: $(EXE)
install -d $(DESTDIR)$(sbindir)
install -p -m 0755 bin/kfs $(DESTDIR)$(sbindir)
install -p -m 0755 bin/kfs-user $(DESTDIR)$(sbindir)
clean:
rm -f $(EXE)
.PHONY: all exe install install-binaries clean