-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (28 loc) · 857 Bytes
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CFLAGS = -Wall -Werror -std=c99
OBJ = gcc -c $< -o $@ $(CFLAGS)
.PHONY: all clean
all:folder folder2 bin/test bin/chess.exe
folder:
mkdir build
folder2:
mkdir bin
bin/chess.exe: build/main.o build/board_print_plain.o build/board.o
gcc $^ -o $@ $(CFLAGS)
build/main.o: src/main.c
$(OBJ)
build/board_print_plain.o: src/board_print_plain.c
$(OBJ)
build/board.o: src/board.c src/board.h
$(OBJ)
build/test.o: test/test.c
gcc -Wall -c test/test.c -o build/test.o -Ithirdparty -Isrc
build/first_test.o: test/first_test.c
gcc -Wall -c test/first_test.c -o build/first_test.o -Ithirdparty
bin/test: build/board.o build/test.o build/board_print_plain.o build/first_test.o
gcc -Wall build/board.o build/test.o build/board_print_plain.o build/first_test.o -o bin/test
clean:
rm build/*.o
rm bin/*.exe
rm bin/test
rm -R build
rm -R bin