Added 'allwarn' and 'debug' targerts

master
Aadhavan Srinivasan 2 years ago
parent 770c03cf76
commit d294a4411f

@ -1,13 +1,12 @@
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 -o $(EXEC_FILE) $^ -leasysock
gcc $(CFLAGS) -o $(EXEC_FILE) $^ -leasysock
$(EXEC_FILE).o: $(EXEC_FILE).c
@ -15,12 +14,18 @@ message.o: message.c
user.o: user.c
message_helpers.o: message_helpers.c
file_helpers.o: file_helpers.c
$(TARGETS):
gcc -c -o $@ $^
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:

Loading…
Cancel
Save