Files
firecgi/Makefile

45 lines
1.1 KiB
Makefile
Raw Normal View History

2019-05-04 23:42:03 -07:00
FIRE_CXX ?= clang++
FIRE_CXXFLAGS ?= -O3 -std=gnu++2a -Wall -Werror
FIRE_LDLIBS ?= -lgflags -lglog -lpthread
all: firecgi.a example_simple
objects = firecgi.o connection.o request.o parse.o
2019-05-07 23:16:04 -07:00
_firebuf:
2019-05-04 23:42:03 -07:00
$(MAKE) --directory=firebuf
2019-05-07 23:16:04 -07:00
firecgi.a: $(objects) _firebuf
ar rcs $@ $(objects) $(addprefix firebuf/,$(shell ar t firebuf/firebuf.a))
2019-05-04 23:42:03 -07:00
example_simple: example_simple.o firecgi.a
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ $(FIRE_LDLIBS)
2019-05-04 23:42:03 -07:00
%.o: %.cc *.h Makefile
$(FIRE_CXX) $(FIRE_CXXFLAGS) -c -o $@ $<
clean:
$(MAKE) --directory=firebuf clean
2019-05-05 00:02:36 -07:00
rm --force example_simple connection_afl *.o *.a
2019-05-04 23:42:03 -07:00
afl:
$(MAKE) clean
FIRE_CXX=afl-g++ $(MAKE) afl_int
afl_int: connection_afl
connection_afl: connection_afl.o firecgi.a
2019-05-04 23:46:26 -07:00
$(MAKE) --directory=firebuf
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ $(FIRE_LDLIBS)
2019-05-04 23:42:03 -07:00
test: test_connection
2019-05-04 23:46:26 -07:00
test_connection: connection_afl
@echo "Running $$(ls testcases | wc -l) tests"
for FILE in testcases/*; do ./connection_afl < $$FILE; done
2019-05-04 23:42:03 -07:00
@printf '\033[0;32mALL TESTS PASSED\033[0m\n'
asan:
$(MAKE) clean
FIRE_CXXFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer -std=gnu++2a -Wall -Werror" $(MAKE) all