You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
552 B
Makefile

EXEC_FILE=main
TARGETS=$(EXEC_FILE).o message.o user.o message_helpers.o file_helpers.o
CFLAGS=
all: $(EXEC_FILE)
$(EXEC_FILE): $(TARGETS)
gcc $(CFLAGS) -o $(EXEC_FILE) $^ -leasysock
$(EXEC_FILE).o: $(EXEC_FILE).c
message.o: message.c
user.o: user.c
message_helpers.o: message_helpers.c
file_helpers.o: file_helpers.c
$(TARGETS):
gcc $(CFLAGS) -c -o $@ $^
.PHONY: debug
debug: CFLAGS+=-g
debug: $(EXEC_FILE)
.PHONY: allwarn
allwarn: CFLAGS+=-Wall -Wextra -pedantic
allwarn: $(EXEC_FILE)
.PHONY: clean
clean:
rm $(TARGETS)
rm $(EXEC_FILE)