From 2f19f2e85746eca309ae5e355e1ff860c62ec11d Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 26 Dec 2016 14:41:02 +0100 Subject: Compile on linux --- .gitignore | 1 + Makefile | 5 +++-- plugins/Makefile | 2 +- util.h | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ffa1d4b..8e70550 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ cserver *.o *.dSYM *.dylib +*.so diff --git a/Makefile b/Makefile index 078b0a0..0eea24b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/util.h b/util.h index 1124982..5457ffe 100644 --- a/util.h +++ b/util.h @@ -1,5 +1,7 @@ #pragma once +#include + char* copy_buf(const char *buf,int len); char* copy_str(const char *str); -- cgit v1.2.3