Correctly ignores not changed files

This commit is contained in:
Kranklyboy 2018-04-15 16:25:22 +02:00
parent 822429a947
commit 1b63c17fd7

View File

@ -1,16 +1,16 @@
CC = gcc
CFLAGS = -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L -g -c
.PHONY all: server client
all: server client
server: server.o
$(CC) -o $@ $<
$(CC) $^ -o $@
client: client.o
$(CC) -o $@ $<
$(CC) $^ -o $@
%.o: %.c common.h
$(CC) $(CFLAGS) $^
.PHONY clean:
rm -f client.o server.o client server
rm -f common.h.ghc client.o server.o client server