-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 949 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
SOURCES := $(shell find src/ -type f | grep -E '\.(h|c)(pp)?$$')
.PHONY: help
help:
@echo -e "Try one of these make targets:\n"
@grep "^\.PHONY: " Makefile | cut -d" " -f2- | sed -e "s/ /\n/g" | grep -v "^_"
.PHONY: run run-with-music
run: build
cd build && ./glowbox
run-with-music: build
cd build && ./glowbox --enable-music
.PHONY: build
build: build/glowbox
build/glowbox: ${SOURCES} | build/Makefile has-make
make -C build
build/Makefile: | build/ _submodules has-cmake
cd build && cmake ..
.PHONY: _submodules
_submodules: | has-git
@git submodule update --init
.PHONY: clean
clean:
# TODO: submodules
@rm -rfv build/*
# === helpers: ===
# make folders, use as order-only prerequisite
%/:
mkdir -p $*
# check if program is available in PATH, use as order-only prerequisite
has-%:
@command -v $* >/dev/null || ( \
echo "ERROR: Command '$*' not found! Make sure it is installed and available in PATH"; \
false; \
) >&2