# Makefile for mastermind by Danny Milosavljevic (0826039) CFLAGS += -std=c99 -pedantic -Wall -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -g -Isrc -Werror -O3 -DENDEBUG LDFLAGS += -lm all: objmk obj/client obj/server obj/test-Bitarray obj/test-Gamestate objmk: mkdir -p obj obj/server.o: src/server.c $(CC) $(CFLAGS) -o $@ -c $< obj/server: obj/server.o obj/Gamestate.o obj/Bitarray.o $(CC) $(LDFLAGS) -o $@ $^ obj/client.o: src/client.c src/Bitarray.h src/Gamestate.h $(CC) $(CFLAGS) -o $@ -c $< obj/Bitarray.o: src/Bitarray.c src/Bitarray.h $(CC) $(CFLAGS) -o $@ -c $< obj/Gamestate.o: src/Gamestate.c src/Gamestate.h src/Bitarray.h $(CC) $(CFLAGS) -o $@ -c $< obj/client: obj/client.o obj/Bitarray.o obj/Gamestate.o $(CC) $(LDFLAGS) -o $@ $^ obj/test-Bitarray: obj/test-Bitarray.o obj/Bitarray.o obj/Gamestate.o $(CC) $(LDFLAGS) -o $@ $^ obj/test-Bitarray.o: src/test-Bitarray.c src/Bitarray.h $(CC) $(CFLAGS) -o $@ -c $< obj/test-Gamestate.o: src/test-Gamestate.c src/Gamestate.h src/Bitarray.h $(CC) $(CFLAGS) -o $@ -c $< obj/test-Gamestate: obj/test-Gamestate.o obj/Bitarray.o obj/Gamestate.o $(CC) $(LDFLAGS) -o $@ $^ clean: rm -rf obj distclean: clean rm -rf latex html