Added Makefile rules for compiling, linking and deleting compiled files

master
Aadhavan Srinivasan 2 years ago
parent ba35b8acdd
commit eefe9fbf1b

@ -0,0 +1,28 @@
EXEC_FILE=main
TARGETS=$(EXEC_FILE).o message.o user.o message_helpers.o file_helpers.o
all: $(EXEC_FILE)
$(EXEC_FILE): $(TARGETS)
gcc -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 -c -o $@ $^
.PHONY: clean
clean:
rm $(TARGETS)
rm $(EXEC_FILE)
Loading…
Cancel
Save