main
1SHELL=/bin/sh
2CFLAGS=-Wall -g -std=c99 -Isrc
3objects=cell.o world.o
4test_objects=world_test.o test_main.o
5exe=./bin/game_of_life
6test_exe=./bin/game_of_life_test
7
8all: $(objects) main.o
9 $(CC) $(CFLAGS) -o $(exe) $(objects) main.o
10 $(exe)
11
12clean:
13 rm -fr $(exe) $(test_exe) $(objects) main.o $(test_objects) test_main.o
14
15test: $(objects) $(test_objects)
16 $(CC) $(CFLAGS) -o $(test_exe) $(objects) $(test_objects)
17 $(test_exe)
18
19main.o: src/main.c src/world.h
20 $(CC) $(CFLAGS) -c src/main.c
21
22cell.o: src/cell.c src/cell.h
23 $(CC) $(CFLAGS) -c src/cell.c
24
25world.o: src/world.c src/world.h
26 $(CC) $(CFLAGS) -c src/world.c
27
28world_test.o: test/world_test.c src/world.h
29 $(CC) $(CFLAGS) -c test/world_test.c
30
31test_main.o: test/main.c test/main.h
32 $(CC) $(CFLAGS) -c test/main.c -o test_main.o