kore/Makefile
Joris Vink 49ca95f390 Add our messaging framework.
With this framework apps can now send messages between worker processes.

A new API function exists:
	int kore_msg_register(u_int8_t id, void (*cb)(const void *, u_int32_t);

This API call allows your app to register a new message callback for a given ID.

You can then send messages on this ID to other workers using:
	void kore_msg_send(u_int8_t id, void *data, u_int32_t length);

This framework will interally be used for a few things such as allowing
websocket data to broadcasted between all workers, adding unified caching
and hopefully eventually moving the access log to this as well.

Some internals have changed with this commit:
	* worker_clients has been called connections.
	* the parent now initializes the net, and event subsystems.
	* kore_worker_websocket_broadcast() is dead.
2015-06-22 21:13:32 +02:00

82 lines
1.9 KiB
Makefile

# Kore Makefile
CC?=gcc
PREFIX?=/usr/local
KORE=kore
INSTALL_DIR=$(PREFIX)/bin
INCLUDE_DIR=$(PREFIX)/include/kore
S_SRC= src/kore.c src/accesslog.c src/auth.c src/buf.c src/cli.c \
src/config.c src/connection.c src/domain.c src/http.c src/mem.c \
src/msg.c src/module.c src/net.c src/pool.c src/spdy.c src/timer.c \
src/validator.c src/utils.c src/websocket.c src/worker.c \
src/zlib_dict.c
S_OBJS= $(S_SRC:.c=.o)
CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes -g
CFLAGS+=-DPREFIX='"$(PREFIX)"'
LDFLAGS+=-rdynamic -lssl -lcrypto -lz
ifneq ("$(DEBUG)", "")
CFLAGS+=-DKORE_DEBUG
endif
ifneq ("$(KORE_PEDANTIC_MALLOC)", "")
CFLAGS+=-DKORE_PEDANTIC_MALLOC
endif
ifneq ("$(NOTLS)", "")
CFLAGS+=-DKORE_NO_TLS
LDFLAGS=-rdynamic -lz -lcrypto
endif
ifneq ("$(PGSQL)", "")
S_SRC+=src/pgsql.c
LDFLAGS+=-L$(shell pg_config --libdir) -lpq
CFLAGS+=-I$(shell pg_config --includedir) -DKORE_USE_PGSQL \
-DPGSQL_INCLUDE_PATH="\"$(shell pg_config --includedir)\""
endif
ifneq ("$(TASKS)", "")
S_SRC+=src/tasks.c
LDFLAGS+=-lpthread
CFLAGS+=-DKORE_USE_TASKS
endif
OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
ifeq ("$(OSNAME)", "darwin")
CFLAGS+=-I/opt/local/include/ -I/usr/local/opt/openssl/include
LDFLAGS+=-L/opt/local/lib -L/usr/local/opt/openssl/lib
S_SRC+=src/bsd.c
else ifeq ("$(OSNAME)", "linux")
CFLAGS+=-D_GNU_SOURCE=1
LDFLAGS+=-ldl
S_SRC+=src/linux.c
else
S_SRC+=src/bsd.c
endif
all: $(S_OBJS)
$(CC) $(S_OBJS) $(LDFLAGS) -o $(KORE)
install:
mkdir -p $(INCLUDE_DIR)
mkdir -p $(INSTALL_DIR)
install -m 555 $(KORE) $(INSTALL_DIR)/$(KORE)
install -m 644 includes/*.h $(INCLUDE_DIR)
uninstall:
rm -f $(INSTALL_DIR)/$(KORE)
rm -rf $(INCLUDE_DIR)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
find . -type f -name \*.o -exec rm {} \;
rm -f $(KORE)
.PHONY: clean