2023-02-09 09:25:15 +00:00
|
|
|
|
2023-02-10 16:39:04 +00:00
|
|
|
CFLAGS = \
|
|
|
|
-std=c17 \
|
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Wpedantic \
|
|
|
|
-Wconversion \
|
|
|
|
|
|
|
|
CC = gcc
|
2023-02-09 09:25:15 +00:00
|
|
|
|
2023-02-09 12:50:26 +00:00
|
|
|
HEADERS = $(wildcard *.h)
|
2023-02-09 09:25:15 +00:00
|
|
|
|
2023-02-09 12:50:26 +00:00
|
|
|
all: compile_flags.txt server
|
|
|
|
|
2023-02-10 16:39:04 +00:00
|
|
|
server: main.o http.o linux.o
|
|
|
|
$(CC) $^ -o $@
|
2023-02-09 12:50:26 +00:00
|
|
|
|
|
|
|
%.o: %.c $(HEADERS)
|
2023-02-10 16:39:04 +00:00
|
|
|
$(CC) $< -c -o $@ $(CFLAGS)
|
2023-02-09 09:25:15 +00:00
|
|
|
|
|
|
|
clean:
|
2023-02-09 12:52:25 +00:00
|
|
|
rm -rf *.o server client
|
2023-02-09 12:50:26 +00:00
|
|
|
|
|
|
|
compile_flags.txt:
|
2023-02-09 12:52:25 +00:00
|
|
|
echo -xc $(CFLAGS) | sed 's/\s\+/\n/g' > compile_flags.txt
|
2023-02-09 09:25:15 +00:00
|
|
|
|