summaryrefslogtreecommitdiff
path: root/Makefile
blob: 78ba0112be5fa5d2c7128bed0860938ba122a14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SHELL=/bin/sh
CFLAGS=-Wall -g -std=c99
objects=cell.o world.o
test_objects=world_test.o
exe=./bin/game_of_life
test_exe=./bin/game_of_life_test

all: $(objects) main.o
	$(CC) $(CFLAGS) -o $(exe) $(objects) main.o
	$(exe)

clean:
	rm -fr $(exe) $(test_exe) $(objects) $(test_objects)

test: $(objects) $(test_objects)
	$(CC) $(CFLAGS) -o $(test_exe) $(objects) $(test_objects)
	$(test_exe)

main.o: src/main.c src/world.h
	$(CC) $(CFLAGS) -c src/main.c

cell.o: src/cell.c src/cell.h
	$(CC) $(CFLAGS) -c src/cell.c

world.o: src/world.c src/world.h
	$(CC) $(CFLAGS) -c src/world.c

world_test.o: src/world_test.c src/world.h
	$(CC) $(CFLAGS) -c src/world_test.c