-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·44 lines (28 loc) · 801 Bytes
/
Makefile
File metadata and controls
executable file
·44 lines (28 loc) · 801 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
34
35
36
37
38
39
40
41
42
43
44
#Adaptation of Makefiles from various authors.
.SUFFIXES: .java .class
PKG = main/ \
BIN = ./bin/
LIBS = ./libs/*
SRC = ./src/
JFLAGS = -g -d $(BIN) -cp $(SRC):$(LIBS)
JC = javac
COMPILE = $(JC) $(JFLAGS)
EMPTY =
SOURCE = $(subst $(SRC), $(EMPTY), $(wildcard $(SRC)*.java))
ifdef PKG
PACKAGEDIRS = $(addprefix $(SRC), $(PKG))
PACKAGEFILES = $(subst $(SRC),$(EMPTY),$(foreach DIR, $(PACKAGEDIRS), $(wildcard $(DIR)/*.java)))
ALL_FILES = $(PACKAGEFILES) $(SOURCE)
else
ALL_FILES = $(SOURCE)
endif
CLASS_Files = $(ALL_FILES:.java=.class)
all: $(addprefix $(BIN), $(CLASS_Files))
$(BIN)%.class: $(SRC)%.java
$(COMPILE) $<
docs:
javadoc -d ./doc/ $$(find -name *java)
clean:
rm -rf $(BIN)*.class
run:
java -cp $(BIN):$(LIBS) ToCTeditor