forked from mfontanini/sloth-fuzzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (41 loc) · 1.35 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
CXX=g++
CP=cp
MV=mv
CXXFLAGS= -c -Wall -g -O2 -std=c++11 -DFUZZER_VERSION=0.1
LEX=flex
YACC=bison -y
INCLUDE = -Iinclude
LDFLAGS= -lpthread -lcrypto
RM=rm
SOURCES= $(wildcard src/*.cpp src/functions/*.cpp) src/parser/syntax_parser.cpp src/parser/nodes.cpp
OBJECTS=$(SOURCES:.cpp=.o) src/parser/grammar.o src/parser/syntax.o
DEPS = $(SOURCES:.cpp=.d)
EXECUTABLE=sloth
all: $(SOURCES) $(EXECUTABLE)
compile: $(OBJECTS)
recompile: clean all
depends: $(SOURCES)
rm -f ./depends.d
make do_make_deps
do_make_deps: $(DEPS)
%.d : %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) -MG -MM -MP -MT"$(<:.cpp=.o)" $< >> depends.d
install:
$(CP) $(EXECUTABLE) /usr/bin/
uninstall:
$(RM) /usr/bin/$(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -o $@
src/parser/grammar.o: parser/grammar.y parser/syntax.lex include/parser/nodes.h
$(YACC) -d -o parser/grammar-output parser/grammar.y
$(MV) parser/grammar-output src/parser/grammar.cpp
$(MV) parser/grammar-output.h include/parser/syntax.tab.h
$(CXX) $(CXXFLAGS) $(INCLUDE) src/parser/grammar.cpp -o src/parser/grammar.o
src/parser/syntax.o: parser/syntax.lex src/parser/grammar.o
$(LEX) -o src/parser/syntax.cpp parser/syntax.lex
$(CXX) $(CXXFLAGS) $(INCLUDE) src/parser/syntax.cpp -o src/parser/syntax.o
clean:
rm $(OBJECTS) $(EXECUTABLE)
-include depends.d