-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·42 lines (29 loc) · 794 Bytes
/
Makefile
File metadata and controls
executable file
·42 lines (29 loc) · 794 Bytes
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
BDIR=build/
INCLUDES=-I.
MAIN_SOURCES=main.cpp parser.cpp ast.cpp
SOURCES=$(wildcard lexer/*.cpp) $(wildcard common/*.cpp) $(MAIN_SOURCES)
OBJECTS=$(addprefix $(BDIR), $(SOURCES:.cpp=.o))
BINARIES=a.out
CC=$(shell which g++)
CFLAGS=-std=c++11 -O2
LFLAGS=-lm
BISON=bison
OBJ_WILD=$(addprefix $(BDIR), %.o)
SRC_WILD=%.cpp
make: $(BDIR) $(dir $(OBJECTS)) $(BINARIES)
$(OBJ_WILD): $(SRC_WILD)
$(CC) $(INCLUDES) -c $< -o $@ $(CFLAGS)
a.out: $(OBJECTS)
$(CC) -o $@ $(OBJECTS) $(LFLAGS)
$(BDIR):
mkdir -p $@
$(BDIR)%:
mkdir -p $@
home: $(BDIR) parser $(dir $(OBJECTS)) $(BINARIES)
@echo "done..."
package: make
rm -rf mata61.zip
zip -r mata61.zip main.cpp ast.cpp parser.cpp *.hpp lexer/ common/ tclap/ Makefile
clean:
rm -f *.o $(OBJECTS) $(BINARIES) *.exe a.out
rm -rf $(BDIR)