-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (20 loc) · 694 Bytes
/
Makefile
File metadata and controls
26 lines (20 loc) · 694 Bytes
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
JAVAC=javac
JAVA=java
SOURCE_DIR=src
BUILD_DIR=build
LIBS_DIR=libs
LIBS=$(shell find $(LIBS_DIR) -name '*.jar' | tr '\n' ':')
MAIN_CLASS=src.main.Main
all: compile test
compile:
mkdir -p $(BUILD_DIR)/main
mkdir -p $(BUILD_DIR)/test
$(JAVAC) -cp "$(LIBS)" -d $(BUILD_DIR)/main $(SOURCE_DIR)/main/*.java
$(JAVAC) -cp "$(BUILD_DIR)/main:$(LIBS)" -d $(BUILD_DIR)/test $(SOURCE_DIR)/test/*.java
run: compile
$(JAVA) -cp "$(BUILD_DIR)/main:$(LIBS)" $(MAIN_CLASS)
test: compile
$(JAVA) -cp "$(BUILD_DIR)/main:$(BUILD_DIR)/test:$(LIBS)" org.junit.platform.console.ConsoleLauncher --scan-classpath --class-path=$(BUILD_DIR)/test
clean:
rm -rf $(BUILD_DIR)
.PHONY: all compile run test clean