-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (38 loc) · 1.08 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
# A simple Makefile for UNSW cs3161/cs9102 programming languages and compilers
# Written by Chris Hall
#
# Place this Makefile inside your VC/ folder, so your directory layout
# should look like:
#
# VC/
# ErrorReporter.java
# vc.java
# Makefile
# Scanner/
# <a bunch of .vc files>
# <a bunch of .sol files>
# <a bunch of .java files>
#
# if you change directory to VC/
# $ cd VC/
#
# you can then use the below make commands
# $ make run
.POSIX:
# `make` is the same as `make run`
all: run
# This is the rule for actually doing the compile of vc.java into vc.class
../vc.class:
CLASSPATH=../ javac vc.java
# `make clean` will remove "tokens.out" and any .class files (compiled java)
clean:
find . -iname '*.class' -delete
rm -rf tokens.out
# `make run` will compile and run your scanner
run: clean ../vc.class
CLASSPATH=../ java VC.vc Scanner/tokens.vc
# `make tokens.out` will compile and run your scanner, writing all output to
# "tokens.out"
tokens.out: clean ../vc.class
CLASSPATH=../ java VC.vc Scanner/tokens.vc > tokens.out
.PHONY: all clean run