Files
cse-130-http-server/Makefile
T

24 lines
502 B
Makefile
Raw Normal View History

2026-05-24 23:24:25 -07:00
CC=gcc
2026-05-25 17:25:50 -07:00
CFLAGS=-Wall -Wextra -Wpedantic -std=c23 -D_POSIX_C_SOURCE=200809L -pthread -O2
2026-05-24 23:24:25 -07:00
CFLAGS+=-Og -g -fsanitize=address,undefined
2026-05-25 17:25:50 -07:00
SRCS=main.c threadpool.c util.c server.c http.c
2026-05-24 23:24:25 -07:00
OBJS=$(SRCS:%.c=bin/%.o)
all: httpserver
httpserver: $(OBJS)
$(CC) $(CFLAGS) -o $@ $^
2026-05-25 17:25:50 -07:00
# Auto-rebuild if Makefile changes
2026-05-25 21:59:56 -07:00
bin/%.o: %.c Makefile
2026-05-24 23:24:25 -07:00
@mkdir -p bin/deps/
2026-05-25 21:59:56 -07:00
$(CC) $(CFLAGS) -MD -MF $(patsubst %.c,bin/deps/%.d,$<) -c -o $@ $<
2026-05-24 23:24:25 -07:00
include $(SRCS:%.c/bin/deps/%.d)
clean:
rm -rf bin/ httpserver
.PHONY: all clean