lib9p/GNUmakefile

49 lines
764 B
Text
Raw Permalink Normal View History

CFLAGS := \
-Weverything \
-Wno-padded \
-Wno-gnu-zero-variadic-macro-arguments \
-Wno-format-nonliteral \
-Werror \
-g \
-O0
LIB_SRCS := \
pack.c \
connection.c \
request.c \
log.c \
hashtable.c \
utils.c \
sbuf/sbuf.c \
transport/socket.c \
backend/fs.c
SERVER_SRCS := \
example/server.c
BUILD_DIR := build
2016-01-31 02:57:38 +01:00
LIB_OBJS := $(addprefix build/,$(LIB_SRCS:.c=.o))
SERVER_OBJS := $(SERVER_SRCS:.c=.o)
LIB := lib9p.dylib
SERVER := server
all: build $(LIB) $(SERVER)
$(LIB): $(LIB_OBJS)
2016-02-02 16:30:54 +01:00
cc -dynamiclib $^ -o build/$@
$(SERVER): $(SERVER_OBJS) $(LIB)
2016-02-02 16:30:54 +01:00
cc $< -o build/$(SERVER) -Lbuild/ -l9p
clean:
rm -rf build
build:
mkdir build
2016-01-31 02:57:38 +01:00
mkdir build/sbuf
mkdir build/transport
mkdir build/backend
2016-01-31 02:57:38 +01:00
build/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@