-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 732 Bytes
/
Makefile
File metadata and controls
33 lines (24 loc) · 732 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
27
28
29
30
31
32
33
# USAGE:
# make # Compile the Java files
# make run ARGS="-n 123" # Run the program with specified arguments
# make clean # Clean the compiled files
MAIN_CLASS = simulation.cli.CliMain
SRC_DIR = src
BIN_DIR = bin
LIB_DIR = lib
CLASSPATH = $(BIN_DIR):$(LIB_DIR)/*
CLASSES = $(shell find $(SRC_DIR) -name "*.java")
.PHONY: build clean run
build: $(BIN_DIR) $(CLASSES)
javac -d $(BIN_DIR) -cp "$(CLASSPATH)" $(CLASSES)
$(BIN_DIR):
mkdir -p $(BIN_DIR)
run:
@java -cp "$(CLASSPATH)" $(MAIN_CLASS) $(ARGS)
clean:
rm -rf $(BIN_DIR)
# You can ignore the targets below, they are used for automated testing
concat:
@cat $(CLASSES)
prepare:
@java -jar /static/formatter.jar -r $(CLASSES)