2024-06-06 20:13:46 +07:00
|
|
|
CC = clang
|
|
|
|
CPPFLAGS = -Iinclude -Isrc
|
|
|
|
CFLAGS = -Wall -pthread
|
|
|
|
LDLIBS = -lm -lpthread
|
2024-05-15 16:18:18 +07:00
|
|
|
|
2024-06-06 20:13:46 +07:00
|
|
|
SRC = src
|
|
|
|
OBJ = obj
|
|
|
|
BIN = winnie-http
|
|
|
|
MKDIR = mkdir -p
|
|
|
|
SRCs := $(shell find $(SRC) -name "*.c")
|
|
|
|
OBJs := $(subst $(SRC), $(OBJ), $(SRCs:.c=.o))
|
2024-05-23 20:07:04 +07:00
|
|
|
|
2024-06-06 20:13:46 +07:00
|
|
|
all: $(BIN)
|
2024-05-23 20:07:04 +07:00
|
|
|
|
2024-06-06 20:13:46 +07:00
|
|
|
$(BIN): $(OBJs)
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(OBJs) -o $@ $(LDLIBS)
|
2024-06-05 15:41:02 +07:00
|
|
|
|
2024-06-06 20:13:46 +07:00
|
|
|
$(OBJs): $(SRCs)
|
|
|
|
$(MKDIR) $(dir $@)
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(subst $(OBJ), $(SRC), $(@:.o=.c)) -o $@
|
2024-05-23 20:07:04 +07:00
|
|
|
|
|
|
|
clean:
|
2024-06-06 20:13:46 +07:00
|
|
|
$(RM) -R $(BIN)
|
|
|
|
$(RM) -R $(OBJ)
|