-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (61 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This is a very simple makefile for building the Lisp interpreter
# project when using Java on stdsun. Feel free to add any improvements:
# e.g. pattern rules, automatic tracking of dependencies, etc. There
# is a lot of info about "make" on the web.
# Tools
JAVAC = javac
JAR = jar
RM = rm -rf
ECHO = echo
MKDIR = mkdir -p
MV = mv
# Directories
SRC_DIR = src
BIN_DIR = bin
DIST_DIR = dist
# Java compiler flags
JAVAFLAGS = -g -d $(BIN_DIR) -sourcepath $(SRC_DIR) -source 1.2 -target 1.2
JAVA_DEBUG_FLAGS = -g -d $(BIN_DIR) -sourcepath $(SRC_DIR) -source 1.2 -target 1.2
# Manifest file
MANIFEST_FILE = manifest
# Deploy name
DEPLOY_NAME = intrpreter.jar
# Jar flags
JARFLAGS = cvfm $(DEPLOY_NAME) $(MANIFEST_FILE) -C $(BIN_DIR) .
# Creating a .class file
COMPILE = $(JAVAC) $(JAVAFLAGS)
COMPILE_TO_DEBUG = $(JAVAC) $(JAVAFLAGS)
# Creating a .jar file
ARCHIVE = $(JAR) $(JARFLAGS)
# One of these should be the "main" class listed in Runfile
MAIN_CLASS = src/edu/osu/cse/meisam/interpreter/Interpreter.java
# The first target is the one that is executed when you invoke
# "make".
default: deploy
init:
$(ECHO) "Creating BIN directory"
$(MKDIR) $(BIN_DIR)
$(ECHO) "Creating DIST directory"
$(MKDIR) $(DIST_DIR)
$(ECHO) "Init finished"
build: init
$(ECHO) "Going to build the project"
$(ECHO) "Compiling..."
$(COMPILE) $(MAIN_CLASS)
$(ECHO) "Build finished"
debug: init
$(ECHO) "Going to build the project"
$(ECHO) "Compiling..."
$(COMPILE_TO_DEBUG) $(MAIN_CLASS)
$(ECHO) "Build finished"
deploy: build
$(ECHO) "Going to deploying the project into a jar file"
$(ARCHIVE)
$(ECHO) "Moving the deployed jar file to the DIST directory"
$(MV) $(DEPLOY_NAME) $(DIST_DIR)
$(ECHO) "Finished deploying the jar file"
clean:
$(ECHO) "Going to clean up..."
$(RM) $(BIN_DIR)
$(RM) $(DIST_DIR)
$(ECHO) "Clean up finished"