diff --git a/Makefile b/Makefile index 1ee5511..44687af 100644 --- a/Makefile +++ b/Makefile @@ -2,18 +2,20 @@ FIRE_CXX ?= clang++ FIRE_CXXFLAGS ?= -O3 -std=gnu++2a -Wall -Werror FIRE_LDLIBS ?= -lgflags -lglog -lpthread -all: firecgi.a example_simple +all: firecgi.a firecgi.o example_simple -objects = firecgi.o connection.o request.o parse.o +objects = server.o connection.o request.o parse.o -_firebuf: +firebuf/firebuf.o: $(MAKE) --directory=firebuf -firecgi.a: $(objects) _firebuf - ar x firebuf/firebuf.a - ar rcs $@ $(objects) $(shell ar t firebuf/firebuf.a) +firecgi.a: $(objects) + ar rcs $@ $(objects) -example_simple: example_simple.o firecgi.a +firecgi.o: $(objects) firebuf/firebuf.o + ld --relocatable --output=$@ $^ + +example_simple: example_simple.o firecgi.o $(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ $(FIRE_LDLIBS) %.o: %.cc *.h Makefile @@ -29,8 +31,7 @@ afl: afl_int: connection_afl -connection_afl: connection_afl.o firecgi.a - $(MAKE) --directory=firebuf +connection_afl: connection_afl.o firecgi.o $(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ $(FIRE_LDLIBS) test: test_connection diff --git a/example_simple.cc b/example_simple.cc index 6c83bc0..b7bac4a 100644 --- a/example_simple.cc +++ b/example_simple.cc @@ -1,7 +1,7 @@ #include #include -#include "firecgi.h" +#include "server.h" DEFINE_int32(port, 9000, "TCP port to bind"); DEFINE_int32(threads, 1, "Number of server threads"); diff --git a/firebuf b/firebuf index fa20ad9..63b3584 160000 --- a/firebuf +++ b/firebuf @@ -1 +1 @@ -Subproject commit fa20ad9d29083eb67bc9fc44789b005d09e712c9 +Subproject commit 63b3584cfab40845aa61f31aeb036b06f657e728 diff --git a/firecgi.cc b/server.cc similarity index 99% rename from firecgi.cc rename to server.cc index 227ff7e..d3fe199 100644 --- a/firecgi.cc +++ b/server.cc @@ -6,7 +6,7 @@ #include #include -#include "firecgi.h" +#include "server.h" #include "connection.h" namespace firecgi { diff --git a/firecgi.h b/server.h similarity index 100% rename from firecgi.h rename to server.h