-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (22 loc) · 605 Bytes
/
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
JAVAC := javac
OUT_DIR := build/classes
JAVAC_FLAGS := -d $(OUT_DIR)
JAVA := java
JAVA_FLAGS := -cp $(OUT_DIR)
PACKAGE_DIR = .
PACKAGE := server
MAIN_CLASS := Server
MAIN_SOURCE := src/$(MAIN_CLASS).java
ADDITIONAL_SOURCES := src/*.java
.PHONY: all build run clean open
all: $(OUT_DIR) $(OUT_DIR)/$(MAIN_CLASS).class
$(OUT_DIR):
mkdir -p $(OUT_DIR)
$(OUT_DIR)/$(MAIN_CLASS).class: $(MAIN_SOURCE) $(ADDITIONAL_SOURCES)
$(JAVAC) $(JAVAC_FLAGS) $(MAIN_SOURCE) $(ADDITIONAL_SOURCES)
run:
@$(JAVA) $(JAVA_FLAGS) $(PACKAGE)/$(MAIN_CLASS)
open:
open http://127.0.0.1:8080
clean:
@rm -rf build