mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
Hook orbit into the build
This commit is contained in:
parent
a2a87adf19
commit
0c21c08b6d
22
Makefile
22
Makefile
@ -1,21 +1,26 @@
|
||||
# Kore Makefile
|
||||
|
||||
CC=gcc
|
||||
BIN=kore
|
||||
KORE=kore
|
||||
ORBIT=orbit
|
||||
INSTALL_DIR=/usr/local/bin
|
||||
INCLUDE_DIR=/usr/local/include/kore
|
||||
|
||||
S_SRC+= src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \
|
||||
S_SRC= src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \
|
||||
src/connection.c src/domain.c src/http.c src/mem.c src/module.c \
|
||||
src/net.c src/pool.c src/spdy.c src/validator.c src/utils.c \
|
||||
src/worker.c src/zlib_dict.c
|
||||
S_OBJS= $(S_SRC:.c=.o)
|
||||
|
||||
O_SRC= src/orbit.c
|
||||
|
||||
CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
|
||||
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
|
||||
CFLAGS+=-Wsign-compare -Iincludes -g
|
||||
LDFLAGS+=-rdynamic -lssl -lcrypto -lz
|
||||
|
||||
ORBIT_CFLAGS=$(CFLAGS)
|
||||
|
||||
ifneq ("$(DEBUG)", "")
|
||||
CFLAGS+=-DKORE_DEBUG
|
||||
endif
|
||||
@ -54,16 +59,19 @@ else
|
||||
S_SRC+=src/bsd.c
|
||||
endif
|
||||
|
||||
all: $(S_OBJS)
|
||||
$(CC) $(CFLAGS) $(S_OBJS) $(LDFLAGS) -o $(BIN)
|
||||
all: $(S_OBJS) $(O_SRC)
|
||||
$(CC) $(ORBIT_CFLAGS) $(O_SRC) -o $(ORBIT)
|
||||
$(CC) $(LDFLAGS) $(S_OBJS) -o $(KORE)
|
||||
|
||||
install:
|
||||
mkdir -p $(INCLUDE_DIR)
|
||||
install -m 555 $(BIN) $(INSTALL_DIR)/$(BIN)
|
||||
install -m 555 $(KORE) $(INSTALL_DIR)/$(KORE)
|
||||
install -m 555 $(ORBIT) $(INSTALL_DIR)/$(ORBIT)
|
||||
install -m 644 includes/*.h $(INCLUDE_DIR)
|
||||
|
||||
uninstall:
|
||||
rm -f $(INSTALL_DIR)/$(BIN)
|
||||
rm -f $(INSTALL_DIR)/$(KORE)
|
||||
rm -f $(INSTALL_DIR)/$(ORBIT)
|
||||
rm -rf $(INCLUDE_DIR)
|
||||
|
||||
.c.o:
|
||||
@ -71,6 +79,6 @@ uninstall:
|
||||
|
||||
clean:
|
||||
find . -type f -name \*.o -exec rm {} \;
|
||||
rm -f $(BIN)
|
||||
rm -f $(KORE) $(ORBIT)
|
||||
|
||||
.PHONY: clean
|
||||
|
@ -14,8 +14,6 @@
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/queue.h>
|
||||
@ -318,11 +316,13 @@ static void
|
||||
orbit_file_write(int fd, const void *buf, size_t len)
|
||||
{
|
||||
ssize_t r;
|
||||
const u_int8_t *d;
|
||||
size_t written;
|
||||
|
||||
d = buf;
|
||||
written = 0;
|
||||
while (written != len) {
|
||||
r = write(fd, buf + written, len - written);
|
||||
r = write(fd, d + written, len - written);
|
||||
if (r == -1) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user