-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (55 loc) · 1.9 KB
/
Makefile
File metadata and controls
64 lines (55 loc) · 1.9 KB
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
VERSION=$(shell cat VERSION)
NAME=vocab-$(VERSION)
JAR=target/$(NAME).jar
RES=src/test/resources
HTML=html
DIST=target/vocab
help:
@echo
@echo "Available goals are:"
@echo
@echo " clean : Removes all artifacts from previous builds."
@echo " jar : Creates the vocab-$(VERSION).jar file."
@echo " release : Creates and zips the startup script and jar file."
@echo " install : Copies the jar and startup script to the user's bin directory."
@echo " upload : Uploads the zip files to the ANC web server."
@echo " commit : Commits the jar to GitHub and creates a PR."
@echo " all : Does all of the above."
@echo " help : Displays this help message."
@echo
jar:
mvn package
clean:
mvn clean
install:
cp $(JAR) $(HOME)/bin
cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(HOME)/bin/vocab
debug:
@echo "Current version is $(VERSION)"
release:
if [ ! -f $(JAR) ] ; then mvn clean package ; fi
if [ -d $(DIST) ] ; then rm -rf $(DIST) ; fi
if [ -f target/$(NAME).zip ] ; then rm target/$(NAME).zip ; fi
if [ -f target/vocab-latest.zip ] ; then rm target/vocab-latest.zip ; fi
mkdir $(DIST)
cat $(RES)/vocab | sed 's|__JAR__|vocab-$(VERSION).jar|' > $(DIST)/vocab
chmod u+x $(DIST)/vocab
cp $(JAR) $(DIST)
cd target ; zip -r vocab vocab ; cp vocab.zip $(NAME).zip ; mv vocab.zip vocab-latest.zip
echo "Release ready."
upload:
if [ -e target/$(NAME).zip ] ; then scp -P 22022 target/$(NAME).zip anc.org:/home/www/anc/downloads ; fi
if [ -e target/vocab-latest.zip ] ; then scp -P 22022 target/vocab-latest.zip anc.org:/home/www/anc/downloads ; fi
echo "Upload complete."
ifeq ($(TOKEN),)
commit:
@echo "Please set TOKEN with your GitHub token."
@echo
@echo "NOTE: if you just ran 'make all' then you only have to run 'make commit'"
@echo "after setting TOKEN"
@echo
else
commit:
ghc -f vocabulary.commit -t $(TOKEN)
endif
all: clean jar install release upload commit