Put build products in build/ directory.
This commit is contained in:
parent
e9a6a2c64c
commit
ff65b2338b
1 changed files with 10 additions and 6 deletions
16
GNUmakefile
16
GNUmakefile
|
@ -1,4 +1,6 @@
|
|||
CFLAGS := -Wall -Wextra -Werror -g -O0
|
||||
BUILD_DIR := build
|
||||
|
||||
LIB_SRCS := \
|
||||
pack.c \
|
||||
connection.c \
|
||||
|
@ -15,20 +17,22 @@ SERVER_SRCS := \
|
|||
|
||||
LIB_OBJS := $(LIB_SRCS:.c=.o)
|
||||
SERVER_OBJS := $(SERVER_SRCS:.c=.o)
|
||||
|
||||
LIB := lib9p.dylib
|
||||
SERVER := server
|
||||
|
||||
all: $(LIB) $(SERVER)
|
||||
all: build $(LIB) $(SERVER)
|
||||
|
||||
$(LIB): $(LIB_OBJS)
|
||||
cc -dynamiclib $^ -o $@
|
||||
cc -dynamiclib $^ -o build/$@
|
||||
|
||||
$(SERVER): $(SERVER_OBJS)
|
||||
cc $< -o $(SERVER) -L. -l9p
|
||||
$(SERVER): $(SERVER_OBJS) $(LIB)
|
||||
cc $< -o build/$(SERVER) -Lbuild/ -l9p
|
||||
|
||||
clean:
|
||||
rm -f $(LIB_OBJS) $(SERVER_OBJS)
|
||||
rm -rf build
|
||||
|
||||
build:
|
||||
mkdir build
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
|
Loading…
Add table
Reference in a new issue