Files
firecgi/Makefile

47 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 firecgi.o example_simple
2019-05-04 23:42:03 -07:00
objects = server.o connection.o request.o parse.o
2019-05-04 23:42:03 -07:00
firebuf/firebuf.o:
2019-05-04 23:42:03 -07:00
$(MAKE) --directory=firebuf
2019-05-07 23:16:04 -07:00
firecgi.a: $(objects)
ar rcs $@ $(objects)
2019-05-04 23:42:03 -07:00
firecgi.o: $(objects) firebuf/firebuf.o
ld --relocatable --output=$@ $^
example_simple: example_simple.o firecgi.o
$(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.o
$(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