-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
51 lines (41 loc) · 964 Bytes
/
makefile
File metadata and controls
51 lines (41 loc) · 964 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# C++ Compiler
CC = g++
CFLAGS = -g -Wall
OPENCV = opencv4
LDFLAGS = `pkg-config --libs --cflags $(OPENCV)`
# Folders
BINDIR = bin
OBJDIR = obj
SRCDIR = cpp
# Files
SRC = $(wildcard $(SRCDIR)/*.cpp)
OBJECTS = $(SRC:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
TARGET = $(BINDIR)/wfc
.PHONY: all
all: build
.PHONY: clean
clean:
@echo "Cleaning ..."
@rm -rf $(OBJDIR)
@rm -rf $(BINDIR)
@rm -rf results
.PHONY: dirs
dirs:
@mkdir -p $(OBJDIR)
@mkdir -p $(BINDIR)
@mkdir -p results
.PHONY: build
build: dirs $(TARGET)
.PHONY: test
test:
bin/wfc tiles/red/ 2 1 1 64 64 red.png 0
bin/wfc tiles/spirals/ 3 1 1 64 64 spirals.png 0
bin/wfc tiles/bricks/ 3 0 1 64 64 bricks.png 0
bin/wfc tiles/dungeons/ 3 0 1 64 64 dungeons.png 0
bin/wfc tiles/paths/ 3 0 1 64 64 paths.png 0
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@echo "Compiling objects: $@"
$(CC) $(CFLAGS) -MP -MMD -c $< -o $@ $(LDFLAGS)
$(TARGET): $(OBJECTS)
@echo "Linking: $@"
$(CC) $(OBJECTS) -o $@ $(LDFLAGS)