-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (45 loc) · 1.92 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
#====== U S E R - S E T T I N G S =========;;
# Source code
src := $(wildcard src/*.scala)
# Application name without file extension
app := jmhttp
# Installation directory
installdir := ~/bin
# ===== S E T T I N G S =====================;;
appjar := bin/$(app).jar
# ===== R U L E S ========================== ;;
all: $(appjar)
uber: bin/jmhttp-uber.jar
force: $(src)
jarget exec javax.jmdns/jmdns/3.4.1 -- scalac $(src) -d $(appjar)
$(appjar): $(src)
jarget exec javax.jmdns/jmdns/3.4.1 -- fsc $(src) -d $(appjar)
# Make executable uber-jar not shrunk.
sh: $(appjar)
jarget uber -scala -exe uexe -m $(appjar) -o bin/jmhttp -p javax.jmdns/jmdns/3.4.1
# Make executable uber-jar and shrink it with proguard.
sh-guard: $(appjar) config.pro
mkdir -p bin
jarget uber -o bin/jmhttp-uber.jar -scala -m $(appjar) -p javax.jmdns/jmdns/3.4.1
@# Shrink app with proguard
java -jar proguard.jar @config.pro
@# Make file executable
java -jar ~/bin/jarget uber -exjar bin/$(app)-pro.jar bin/$(app)
@# Remove temporary files
rm -rf bin/$(app)-uber.jar bin/$(app)-pro.jar
@# Generate sha256 hash for application data integrity checking.
cd bin && sha256sum $(app) > $(app).sha256
doc: $(src)
scaladoc $(src) -doc-title "jmHttp Server - Scala Micro Http Server" -doc-version "1.0" -doc-source-url "https://github.com/caiorss/jmhttp" -d ./bin/docs
test1: $(appjar)
jarget exec javax.jmdns/jmdns/3.4.1 -- scala $(appjar) --loglevel=INFO -p=9090 /home/archbox/Pictures
test2: $(appjar)
jarget exec javax.jmdns/jmdns/3.4.1 -- scala $(appjar) --zeroconf --loglevel=ALL --multiple -p=8000 image:/home/archbox/Pictures music:/home/archbox/Music wiki:/home/archbox/Documents/wiki
# Requires the rule $ make sh or $ make sh-guard to be run before.
install:
@echo "Installing application "
cp -v bin/jmhttp $(installdir)
cp -v jmhttp-daemon.sh $(installdir)
uninstall:
@echo "Uninstalling application"
rm -v $(installdir)/$(app)