-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.17 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
ECHO=/bin/echo
ECHO_N=/bin/echo -n
GIT=git
GIT_ARCHIVE=git-archive-all
all: build
clean:
@rm -f [^_]*.html
build:
@$(MAKE) `ls -1 *.md | sort | sed 's/\.md$$/\.html/'` || exit 1
upload: build upload_timestamp
docs: build docs_timestamp
archives:
@wd=`pwd`; cd `cat repo_loc` || exit 1; \
tag=`$(GIT) tag -l | grep '^v3' | sort | tail -n 1`; \
branch=`$(GIT) rev-parse --abbrev-ref HEAD`; \
$(GIT) checkout -q $$tag; \
$(GIT) submodule update --init; \
$(GIT_ARCHIVE) --prefix=tractor/ tractor.tar.gz && mv tractor.tar.gz "$$wd/"; \
$(GIT_ARCHIVE) --prefix=tractor/ tractor.zip && mv tractor.zip "$$wd/"; \
$(GIT) checkout -q $$branch; \
echo "$$tag" >"$$wd/latest.txt"
install.html: install.md _template.html build.rb latest.txt
@$(ECHO_N) "Building $@... "
@./build.rb $< >$@ || ( rm -f $@; exit 1 )
@$(ECHO) "done"
%.html: %.md _template.html build.rb
@$(ECHO_N) "Building $@... "
@./build.rb $< >$@ || ( rm -f $@; exit 1 )
@$(ECHO) "done"
upload_timestamp: [^_]*.html *.png tractor.tar.gz tractor.zip latest.txt paper/* assets/*
@./upload.rb $? && touch upload_timestamp
docs_timestamp: [^_]*.html *.png paper/* assets/*
@./upload.rb -d $? && touch docs_timestamp