diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | plugins/Makefile | 2 | ||||
-rw-r--r-- | util.h | 2 |
4 files changed, 7 insertions, 3 deletions
@@ -2,3 +2,4 @@ cserver *.o *.dSYM *.dylib +*.so @@ -1,10 +1,11 @@ CC = gcc -CFLAGS = -Wall -Wextra -std=c11 -fwrapv +CFLAGS = -Wall -Wextra -std=c11 -fwrapv -fPIC ifneq ($(DEBUG),) CFLAGS += -g else CFLAGS += -O2 endif +LDFLAGS = -ldl BIN = cserver PLUGINDIR = plugins @@ -24,7 +25,7 @@ remake: clean all $(BIN): $(patsubst %.c,%.o,$(wildcard *.c)) - $(CC) -o $@ $^ + $(CC) -o $@ $^ $(LDFLAGS) %.o: %.c $(wildcard $(dir %.o)*.h) $(CC) $(CFLAGS) -c -o $@ $< diff --git a/plugins/Makefile b/plugins/Makefile index 145500c..03501e4 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -Wall -Wextra -std=c11 -fwrapv -I.. +CFLAGS = -Wall -Wextra -std=c11 -fwrapv -I.. -fPIC ifneq ($(DEBUG),) CFLAGS += -g else @@ -1,5 +1,7 @@ #pragma once +#include <sys/socket.h> + char* copy_buf(const char *buf,int len); char* copy_str(const char *str); |