-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 821 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
PREFIX ?= /usr/local
MANDIR ?= $(PREFIX)/share/man
TARGET ?= x86_64-unknown-linux-gnu
.PHONY: all install uninstall build build-arm64 build-armv7
build:
cargo build --release --target $(TARGET)
build-arm64:
RUSTFLAGS='-C linker=aarch64-linux-gnu-gcc' cargo build --release --target aarch64-unknown-linux-gnu
build-armv7:
cargo build --release --target armv7-unknown-linux-gnueabihf
all: build
install:
# Install binary
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 target/$(TARGET)/release/flux $(DESTDIR)$(PREFIX)/bin/
# Install man page
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 resources/flux.1 $(DESTDIR)$(MANDIR)/man1/
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/flux
rm -f $(DESTDIR)$(MANDIR)/man1/flux.1
clean:
cargo clean
distclean:
cargo clean
rm -rf target
format:
cargo fmt