2019-05-04 19:00:16 -07:00
|
|
|
FCGI_CXX ?= clang++
|
|
|
|
|
FCGI_CXXFLAGS ?= -O3 -std=gnu++2a -Wall -Werror
|
|
|
|
|
FCGI_LDLIBS ?= -lgflags -lglog -lpthread
|
|
|
|
|
|
2019-04-28 21:30:15 +00:00
|
|
|
all: example_simple example_clock
|
|
|
|
|
|
2019-04-29 00:11:07 +00:00
|
|
|
objects = sse.o sse_stream.o fastcgi.o fastcgi_conn.o fastcgi_request.o fastcgi_parse.o stream_buffer.o buffer.o
|
2019-04-28 21:30:15 +00:00
|
|
|
|
2019-05-04 19:00:16 -07:00
|
|
|
example_simple: example_simple.o $(objects)
|
|
|
|
|
$(FCGI_CXX) $(FCGI_CXXFLAGS) -o $@ $+ $(FCGI_LDLIBS)
|
2019-04-28 21:30:15 +00:00
|
|
|
|
2019-05-04 19:00:16 -07:00
|
|
|
example_clock: example_clock.o $(objects)
|
|
|
|
|
$(FCGI_CXX) $(FCGI_CXXFLAGS) -o $@ $+ $(FCGI_LDLIBS)
|
2019-04-28 21:30:15 +00:00
|
|
|
|
|
|
|
|
%.o: %.cc *.h Makefile
|
2019-05-04 19:00:16 -07:00
|
|
|
$(FCGI_CXX) $(FCGI_CXXFLAGS) -c -o $@ $<
|
2019-04-26 05:34:19 +00:00
|
|
|
|
|
|
|
|
clean:
|
2019-05-04 19:00:16 -07:00
|
|
|
rm --force example_simple example_clock fastcgi_conn_afl *.o
|
|
|
|
|
|
|
|
|
|
afl:
|
|
|
|
|
$(MAKE) clean
|
|
|
|
|
FCGI_CXX=afl-g++ $(MAKE) afl_int
|
|
|
|
|
|
|
|
|
|
afl_int: fastcgi_conn_afl
|
2019-04-28 00:17:32 +00:00
|
|
|
|
2019-05-04 19:00:16 -07:00
|
|
|
fastcgi_conn_afl: fastcgi_conn_afl.o $(objects)
|
|
|
|
|
$(FCGI_CXX) $(FCGI_CXXFLAGS) -o $@ $+ $(FCGI_LDLIBS)
|
2019-05-04 22:20:01 -07:00
|
|
|
|
|
|
|
|
test: fastcgi_conn_afl
|
|
|
|
|
for FILE in afl_state/testcases/*; do ./fastcgi_conn_afl < $$FILE; done
|
|
|
|
|
@printf '\033[0;32mALL TESTS PASSED\033[0m\n'
|