This commit is contained in:
2024-09-10 12:58:55 -04:00
parent 9cb47c4c83
commit f16cb153e1
6 changed files with 73 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# ----- Variables for customization -----
CC = gcc # Compiler (you can change to clang if desired)
CFLAGS = -g3 -Wall -Wextra -fsanitize=address,undefined # Standard flags + debugging & warnings
CFLAGS = -g2 -Wall -Wextra #-fsanitize=address # Standard flags + debugging & warnings
LDFLAGS = # Linker flags, if any
# ----- Automatic dependency tracking -----
@@ -9,14 +9,14 @@ OBJS := $(SRCS:.c=.o) # Corresponding object files (.o)
HDRS := $(SRCS:.c=.h)
# ----- Targets -----
server: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o server $(LDFLAGS)
server: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o server $(LDFLAGS)
# Create object files from source files
%.o: %.c %.h
$(CC) $(CFLAGS) -c $< -o $@
# Phony target for cleaning
# Phony target for cleaning
.PHONY: clean
clean:
rm -f $(OBJS) server
rm -f $(OBJS)