-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (25 loc) · 903 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
ifndef OS
C = gcc
CFLAGS = -Wall -Wextra -O2 -lm -lSDL2 --std=c99 -no-pie
TCFLAGS = -Wall -Wextra -O2 -lm --std=c99 -no-pie
BUILD__ = $(C) digitus.c $(CFLAGS) -o digitus && chmod +x ./digitus
BUILD_TOOLS_TILEMAKER = $(C) ./tools/tilemaker.c $(TCFLAGS) -o ./tools/tilemaker && chmod +x ./tools/tilemaker
BUILD_TOOLS_MAPMAKER = $(C) ./tools/mapmaker.c $(TCFLAGS) -o ./tools/mapmaker && chmod +x ./tools/mapmaker
BUILD_TOOLS_MAPPACKER = $(C) ./tools/mappacker.c $(TCFLAGS) -o ./tools/mappacker && chmod +x ./tools/mappacker
.PHONY: tools
all: clean build run
build:
$(BUILD__)
build_tools: tools
tools:
mkdir -p tools/
$(BUILD_TOOLS_TILEMAKER); $(BUILD_TOOLS_MAPMAKER); $(BUILD_TOOLS_MAPPACKER)
run:
./digitus
clean_all: clean clean_tools
clean:
rm -f ./digitus
clean_tools:
rm -f ./tools/tilemaker ./tools/mapmaker ./tools/mappacker
else
endif