-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (29 loc) · 1016 Bytes
/
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
# This is a very simple makefile for building the Lisp interpreter
# project when using C++ on stdlinux. 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.
# C++ compiler
CXX = g++
# C++ compiler flags
CXXFLAGS = -g -Wall -std=c++0x
# Creating a .o file
COMPILE = $(CXX) $(CXXFLAGS) -c
# Name of the executable; should match the contents of Runfile
EXE = part1
# All object files
OBJS = main.o Lexer.o Parser.o Token.o SExpression.o
# The first target is the one that is executed when you invoke
# "make". The line describing the action starts with <TAB>. Variable
# "$@" stands for the current target.
$(EXE) : $(OBJS) # depends on all object files
$(CXX) $^ -o $@
clean :
rm *.o part1
# An object file is dependent on the corresponding source file
%.o : %.cc
$(COMPILE) -o $@ $<
main.o : Parser.h
Lexer.o : Lexer.h Token.h
Parser.o : Lexer.h Token.h
Token.o : Token.h
SExpression.o : SExpression.h