-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 751 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (25 loc) · 751 Bytes
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
VERSION = 1.3.2
CC = gcc
CFLAGS = -O2 -Wall -Wextra -pedantic -std=gnu99 -DVERSION=\"$(VERSION)\"
LDFLAGS = -lm
# Cross-platform
ifeq ($(OS),Windows_NT)
TARGET = bin/chal.exe
RM = powershell -Command "Remove-Item -Path $(TARGET) -ErrorAction SilentlyContinue"
MKDIR = powershell -Command "if(-not(Test-Path bin)){New-Item -ItemType Directory -Path bin}"
else
TARGET = bin/chal
RM = rm -f
MKDIR = mkdir -p bin
endif
.PHONY: all debug clean perft
all: $(TARGET)
debug: CFLAGS = -g -O0 -Wall -Wextra -pedantic -std=gnu99 -DVERSION=\"$(VERSION)\"
debug: $(TARGET)
$(TARGET): src/chal.c
$(MKDIR)
$(CC) $(CFLAGS) src/chal.c -o $(TARGET) $(LDFLAGS)
perft: $(TARGET)
$(TARGET) perft 6
clean:
$(RM) $(TARGET)