forked from chipsalliance/chisel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (44 loc) · 1.64 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
buildDir ?= build
subprojects = $(buildDir)/subprojects
docs = $(buildDir)/docs
chisel3 = ../
www-docs = \
$(shell find $(chisel3)/docs/ -name "*.md")
www-src = \
$(shell find docs/src/main/resources) \
docs/src/main/tut/chisel3/docs \
docs/src/main/tut/chisel3/index.md \
$(chisel3)/README.md
# Get the latest version of some sequence of version strings
# Usage: $(call getTags,$(foo))
define latest
$(shell echo $(1) | tr " " "\n" | sort -Vr | head -n1 | sed 's/^v//')
endef
.PHONY: all clean mrproper publish serve
.PRECIOUS: \
$(subprojects)/chisel3/%/.git $(subprojects)/chisel3/%/target/scala-$(scalaVersion)/unidoc/index.html
# Build the site into the default directory (docs/target/site)
all: docs/target/site/index.html
# Remove the output of all build targets
clean:
rm -rf docs/target docs/src/main/tut/contributors.md docs/src/main/tut/chisel3/docs
# Remove everything
mrproper:
rm -rf $(buildDir) target project/target
# Publish Microsite
publish: all
sbt docs/ghpagesPushSite
# Start a Jekyll server for the site
serve: all
(cd docs/target/site && jekyll serve)
# Build the sbt-microsite
docs/target/site/index.html: build.sbt docs/src/main/tut/contributors.md $(www-src)
sbt docs/makeMicrosite
# Determine contributors
docs/src/main/tut/contributors.md: build.sbt
sbt contributors/determineContributors
# Build docs in subproject with a specific tag.
# This command is brittle as it assumes chisel3 is up one dir from here in the path to where
# we want to put the website docs.
docs/src/main/tut/chisel3/docs: $(chisel3)/docs/ $(www-docs)
(cd $(chisel3) && sbt docs/mdoc && cp -r docs/generated website/docs/src/main/tut/chisel3/docs)