-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.31 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
#-----------------------------------------------------------------------
# Define compiler and compiler flag variables for Java
#-----------------------------------------------------------------------
# Flag for class path
J_DIRECTORY_CLASS_FLAG = -d
# Specify the path where to place .class files
J_DIRECTORY_CLASS_PATH = ./bin/
# Specify where to place generated class files
J_DIRECTORY_CLASS = $(J_DIRECTORY_CLASS_FLAG) $(J_DIRECTORY_CLASS_PATH)
# Flag for source path
J_DIRECTORY_SOURCE_FLAG = -sourcepath
# Specify the path where are the source files .java
J_DIRECTORY_SOURCE_PATH = ./src/
# Specify where are the source files .java
J_DIRECTORY_SOURCE = $(J_DIRECTORY_SOURCE_FLAG) $(J_DIRECTORY_SOURCE_PATH)
SRC = $(shell find ./src -type f)
OBJ = $(SRC:.java=.class)
JC = javac
JAVAC_COMPILE = $(JC) $(J_DIRECTORY_SOURCE) $(J_DIRECTORY_CLASS)
#-----------------------------------------------------------------------
# Default Java compilation
#-----------------------------------------------------------------------
default : bin $(OBJ)
# Creation des .class dans le dossier bin.
%.class: %.java
@$(JAVAC_COMPILE) $*.java
# Creation du dossier bin
bin :
@mkdir -p ./bin/
# Clean up but keep executables
clean :
rm -Rfv bin/*
# Détruit également le dossier bin
fullclean : clean
rmdir ./bin
@echo "Full Clean Done!"