-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (35 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
45 lines (35 loc) · 1.35 KB
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
# Dependency-free build. Needs only the Xcode command-line tools.
# (CMakeLists.txt is provided as well, for cmake users.)
#
# make build the app and the test binary
# make test build and run the tests
# make clean
CXX ?= clang++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra -Wno-missing-field-initializers
INCLUDES = -Iinclude -Ithird_party
FRAMEWORKS = -framework CoreAudio -framework AudioToolbox \
-framework CoreFoundation -framework AudioUnit
BUILD = build
APP = $(BUILD)/turn-taker
TESTS = $(BUILD)/tests
LIB_HEADERS = $(shell find include -name '*.h')
TEST_SRC = $(wildcard tests/*.cpp)
all: $(APP) $(TESTS)
# miniaudio's implementation is one large third-party TU: compiled once, with
# warnings off (it is not our code to fix).
$(BUILD)/miniaudio.o: src/miniaudio_impl.cpp third_party/miniaudio/miniaudio.h
@mkdir -p $(BUILD)
$(CXX) -std=c++17 -O2 -w $(INCLUDES) -c $< -o $@
$(APP): apps/turn-taker/main.cpp apps/turn-taker/ui.h $(LIB_HEADERS) $(BUILD)/miniaudio.o
@mkdir -p $(BUILD)
$(CXX) $(CXXFLAGS) $(INCLUDES) -Iapps/turn-taker \
apps/turn-taker/main.cpp $(BUILD)/miniaudio.o -o $@ \
$(FRAMEWORKS) -lpthread
$(TESTS): $(TEST_SRC) tests/check.h $(LIB_HEADERS)
@mkdir -p $(BUILD)
$(CXX) $(CXXFLAGS) $(INCLUDES) -Itests $(TEST_SRC) -o $@
test: $(TESTS)
@$(TESTS)
clean:
rm -rf $(BUILD)
.PHONY: all test clean