-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.in
50 lines (37 loc) · 1.54 KB
/
Makefile.in
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
RUST_SOURCES = $(shell find src/ -type f -name '*.rs')
RUST_EXTRA = \
Cargo.toml
EXTRA_DIST += $(RUST_SOURCES) $(RUST_EXTRA)
DESTDIR ?=
MAKE_PID := $(shell echo $$PPID)
JOB_FLAG := $(filter -j%, $(subst -j ,-j,$(shell ps T | grep "^\s*$(MAKE_PID).*$(MAKE)")))
JOBS := $(subst -j,,$(JOB_FLAG))
ifdef JOBS
CARGO_FLAGS=-j $(JOBS)
else
CARGO_FLAGS=
endif
prefix := @prefix@
exec_prefix := @exec_prefix@
all: @RUST_TARGET_DIR@/@RUST_TARGET_SUBDIR@/libredirectionio.a redirectionio.h
redirectionio.h: $(EXTRA_DIST)
@CARGO_BIN@ build $(CARGO_FLAGS) --lib @RUST_RELEASE@ --target-dir @RUST_TARGET_DIR@
@RUST_TARGET_DIR@/@RUST_TARGET_SUBDIR@/libredirectionio.a: $(EXTRA_DIST)
@CARGO_BIN@ build $(CARGO_FLAGS) --lib @RUST_RELEASE@ --target-dir @RUST_TARGET_DIR@
install: @RUST_TARGET_DIR@/@RUST_TARGET_SUBDIR@/libredirectionio.a redirectionio.h
mkdir -p $(DESTDIR)@prefix@/include/
install -c -m 644 redirectionio.h $(DESTDIR)@prefix@/include/
mkdir -p $(DESTDIR)@libdir@/
install -c -m 644 @RUST_TARGET_DIR@/@RUST_TARGET_SUBDIR@/libredirectionio.a $(DESTDIR)@libdir@/
mkdir -p $(DESTDIR)@libdir@/pkgconfig/
install -c -m 644 libredirectionio.pc $(DESTDIR)@libdir@/pkgconfig/
build-wasm:
wasm-pack build --scope redirection.io --no-default-features --out-dir pkg/wasm --no-pack --release --features wasmbind
.PHONY: clean
clean:
rm -f redirectionio.h
rm -f @RUST_TARGET_DIR@/@RUST_TARGET_SUBDIR@/libredirectionio.a
@CARGO_BIN@ clean --package redirectionio @RUST_RELEASE@
.PHONY: fullclean
fullclean:
rm -rf target