wrapper/Makefile

37 lines
553 B
Makefile
Raw Normal View History

2023-04-06 03:08:09 +00:00
CC = gcc
INCFLAGS = -Isrc
CCFLAGS = -std=c17 -Wall -Wextra -O2
CCFLAGS += $(INCFLAGS)
LDFLAGS += $(INCFLAGS)
2023-04-08 19:58:03 +00:00
LDFLAGS += -lpthread
2023-04-06 03:08:09 +00:00
BIN = bin
APP = $(BIN)/app
SRC = $(shell find src -name "*.c")
OBJ = $(SRC:%.c=$(BIN)/%.o)
.PHONY: clean build
dirs:
mkdir -p ./$(BIN)
mkdir -p ./$(BIN)/src
mkdir -p ./$(BIN)/src/io
mkdir -p ./$(BIN)/src/packet
mkdir -p ./$(BIN)/src/server
run: build
$(APP)
build: dirs ${OBJ}
${CC} -o $(APP) $(filter %.o,$^) $(LDFLAGS)
$(BIN)/%.o: %.c
$(CC) -o $@ -c $< $(CCFLAGS)
clean:
rm -rf $(APP)
rm -rf $(BIN)