aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 5e50ea666b479b3be31a66a03025418800620a3d (plain)
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
RUSTC ?= rustc
RUSTDOC ?= rustdoc
BUILD ?= build
LIB := $(BUILD)/$(shell $(RUSTC) --print-file-name src/toml.rs)
TEST := $(BUILD)/tomltest

all: $(LIB)

-include $(BUILD)/toml.d
-include $(BUILD)/tomltest.d

$(LIB): src/toml.rs
	@mkdir -p $(@D)
	$(RUSTC) $< --out-dir $(@D) --dep-info

check: $(TEST) doctest
	$(TEST)

$(TEST): src/toml.rs
	$(RUSTC) $< --test -o $@ --dep-info

doctest: $(LIB)
	$(RUSTDOC) --test -L $(BUILD) src/toml.rs

clean:
	rm -rf $(BUILD)