forked from nu774/qaac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (65 loc) · 1.61 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# TODO generate mp4v2/libplatform/config.h
# usually this is generated by configure
# prefer CC and CXX from env
#CC ?= clang
#CXX ?= clang++
# force clang
# clang gives better error messages than gcc
#CC = clang
#CXX = clang++
TARGET_EXEC ?= qaac
BUILD_DIR ?= build
# based on vcproject/qaac/qaac.vcxproj
SRCS := \
input/CoreAudioPacketDecoder.cpp \
input/ExtAFSource.cpp \
input/MP4Source.cpp \
input/MPAHeader.cpp \
input/InputFactory.cpp \
filters/CoreAudioResampler.cpp \
AudioConverterX.cpp \
AudioConverterXX.cpp \
cautil.cpp \
CoreAudioEncoder.cpp \
CoreAudioPaddedEncoder.cpp \
lpc.c \
main.cpp \
options.cpp \
version.cpp \
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
# -I. -Iinput -Ioutput -Imp4v2 -Imp4v2/include -ICoreAudio -Ifilters -Iinclude -Iinclude/opus -Ivcproject/mp4v2/include
INC_DIRS := \
. \
input \
output \
mp4v2 \
mp4v2/include \
CoreAudio \
filters \
include \
include/opus \
vcproject/mp4v2/include \
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
COMMON_FLAGS = -MMD -MP -Wfatal-errors -Werror -DQAAC=1 -DNO_COREAUDIO=1 -Wno-multichar
CFLAGS ?= $(INC_FLAGS) $(COMMON_FLAGS)
CXXFLAGS ?= $(INC_FLAGS) $(COMMON_FLAGS) -std=gnu++20
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
# assembly
$(BUILD_DIR)/%.s.o: %.s
$(MKDIR_P) $(dir $@)
$(AS) $(ASFLAGS) -c $< -o $@
# c source
$(BUILD_DIR)/%.c.o: %.c
$(MKDIR_P) $(dir $@)
$(CC) $(CFLAGS) $(CFLAGS) -c $< -o $@
# c++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
$(MKDIR_P) $(dir $@)
$(CXX) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY: clean
clean:
$(RM) -r $(BUILD_DIR)
-include $(DEPS)
MKDIR_P ?= mkdir -p