-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (45 loc) · 1.35 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
jars: compile
mkdir -p mlib
jar --create \
--file=mlib/com.markbucciarelli.tinyjhttpd@1.jar \
--module-version 1 \
--main-class com/markbucciarelli/tinyjhttpd/Server \
-C ./classes/com.markbucciarelli.tinyjhttpd/ \
.
jar --create \
--file=mlib/com.markbucciarelli.consolelogger@1.jar \
--module-version 1 \
-C ./classes/com.markbucciarelli.consolelogger/ \
.
testjars: compile
mkdir -p mlib
jar --create \
--file=mlib/com.example.helloworld@1.jar \
--module-version 1 \
--main-class com/example/helloworld/Server \
-C ./classes/com.example.helloworld/ \
.
jar --create \
--file=mlib/net.freeutils.httpserver@1.jar \
--module-version 1 \
--main-class net/freeutils/httpserver/HTTPServer \
-C ./classes/net.freeutils.httpserver/ \
.
compile:
javac -d ./classes --module-source-path src $$(find src -name '*.java')
testclasses: compile
javac \
-cp "testlib/*:classes/com.markbucciarelli.tinyjhttpd" \
-d ./classes/ \
$$(find test/com.markbucciarelli.tinyjhttpd -name '*.java')
test: jars testjars testclasses
@./test/runtest.sh 1 "server starts successfully" "/"
@./test/runtest.sh 2 "hello world handler works" "/hello"
@./test/memtest.sh 3 "server resident set size (RSS) test"
@./test/jlhttp-memtest.sh 4 "jlhttp RSS test"
fmt:
npx prettier --write "**/*.java"
clean:
rm -rf mlib
rm -rf classes
rm -f test/*.out