-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·51 lines (43 loc) · 1.07 KB
/
Makefile
File metadata and controls
executable file
·51 lines (43 loc) · 1.07 KB
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
# --- NOTES ---
# $? = dependent files
# Tell make which compiler to use
CC = g++
# Which flags to pass to the compilation command
CFLAGS = -G
# C++ Standard
STD = -std=c++11
# Define Include Directories
INCLUDES = -I src
# C source files
SRC = build/lex.yy.c build/parser.tab.c src/AST.cpp src/irgen.cpp
# Set executable output name and directory
BIN = bin/gmm
# List subdirectories
SUBDIRS = Lexer Parser
all: run
# ---- Build individual folders ---- #
# Generate lexer C files
lexer:
@cd Lexer ; make
parser:
@cd Parser ; make
# Run program
run:
@echo "###################################################"
@echo "### Building and Running C-- Compiler files ###"
@echo "###################################################"
@echo
for i in $(SUBDIRS) ; do \
( cd $$i ; make) ; \
done
@echo Building executable...
$(CC) $(STD) $(INCLUDES) -o $(BIN) $(SRC)
@echo
@echo
@echo Executing parser using Semantic_analyzer_testfile.cmm...
bin/gmm TestFiles/testProg.cmm
# Remove all binaries, flex, and bison generated files
clean:
rm -rf build bin
mkdir build bin
ls -l