forked from emichael/dslabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (53 loc) · 1.52 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: all test dependencies serve clean clean-all
.FORCE:
FRAMEWORK_FILES = $(shell find framework -type f | sed 's/ /\\ /g')
LAB_FILES = $(shell find labs -type f | sed 's/ /\\ /g')
HANDOUT_FILES = $(shell find handout-files -type f | sed 's/ /\\ /g')
JAR_FILES = build/libs/framework.jar \
build/libs/grader.jar \
build/libs/framework-sources.jar \
build/libs/grader-sources.jar \
build/libs/framework-deps.jar \
build/libs/grader-deps.jar \
build/libs/framework-deps-sources.jar
OTHER_FILES = build/doc/ lombok.config
ifeq ($(shell uname -s),Darwin)
TAR = gtar
else
TAR = tar
endif
ifeq ($(shell uname -s),Darwin)
CP = gcp
else
CP = cp
endif
all: build/handout/
dependencies:
./gradlew copyDependencies
build/libs/: $(FRAMEWORK_FILES)
./gradlew assemble
touch $@
build/doc/: $(FRAMEWORK_FILES)
./gradlew javadoc
touch $@
build/handout/: $(LAB_FILES) $(HANDOUT_FILES) $(OTHER_FILES) build/libs/
rm -rf $@
mkdir $@ build/handout/jars
$(CP) -r labs handout-files/. $(OTHER_FILES) $@
$(CP) $(JAR_FILES) build/handout/jars
build/handout.tar.gz: build/handout/
$(TAR) -czf $@ --transform "s/^build\/handout/dslabs/" $^
test:
./gradlew test
www/javadoc/: build/doc/
rsync -a --delete $< $@
build/www/: www/javadoc/ .FORCE
mkdir -p $@
cd ./www; bundle exec jekyll build -d ../$@
touch $@
serve: www/javadoc/
cd www; watchy -w _config.yml -- bundle exec jekyll serve --watch -d ../build/www/
clean:
rm -rf build www/javadoc www/.jekyll-cache
clean-all: clean
rm -rf deps .gradle traces