From 5a378a01dfa18f035fb85fe52a07af5405f257d8 Mon Sep 17 00:00:00 2001 From: Kranklyboy Date: Sun, 15 Apr 2018 16:13:31 +0200 Subject: [PATCH] Changed Makefile rules to be shorter and more concise --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4d23a95..f6d93da 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,14 @@ CFLAGS = -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE .PHONY all: server client -server: server.o common.h - $(CC) -o $@ $^ +server: server.o + $(CC) -o $@ $< -server.o: server.c - $(CC) $(CFLAGS) $< +client: client.o + $(CC) -o $@ $< -client: client.o common.h - $(CC) -o $@ $^ - -client.o: client.c - $(CC) $(CFLAGS) $< +%.o: %.c common.h + $(CC) $(CFLAGS) $^ .PHONY clean: rm -f client.o server.o client server