forked from sfackler/rust-openssl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
41 lines (29 loc) · 919 Bytes
/
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
RUSTC ?= rustc
BUILDDIR := build
RUSTCFGS := %RUSTCFGS%
RUSTFLAGS += -O --cfg ndebug $(RUSTCFGS)
INSTALL_DIR := %PREFIX%
OPENSSL_LIB := lib.rs
OPENSSL := $(foreach file,$(shell $(RUSTC) --crate-file-name $(OPENSSL_LIB)),$(BUILDDIR)/$(file))
OPENSSL_TEST := $(BUILDDIR)/$(shell $(RUSTC) --test --crate-file-name $(OPENSSL_LIB))
all: $(OPENSSL)
-include $(BUILDDIR)/openssl.d
-include $(BUILDDIR)/openssl_test.d
$(BUILDDIR):
mkdir -p $@
$(OPENSSL): $(OPENSSL_LIB) | $(BUILDDIR)
$(RUSTC) $(RUSTFLAGS) --dep-info $(@D)/openssl.d --out-dir $(@D) $<
check: $(OPENSSL_TEST)
$<
$(OPENSSL_TEST): $(OPENSSL_LIB) | $(BUILDDIR)
$(RUSTC) $(RUSTFLAGS) --test --dep-info $(@D)/openssl_test.d \
--out-dir $(@D) $<
clean:
rm -rf $(BUILDDIR)
doc: $(OPENSSL)
rustdoc $(RUSTCFGS) $(OPENSSL_LIB)
install: $(OPENSSL)
install $(OPENSSL) $(INSTALL_DIR)
print-target:
@echo $(OPENSSL)
.PHONY: all check clean print-target