Fixes a silly bug where only the left channel was used for depth estimation
[opus.git] / Makefile.draft
1 #################### COMPILE OPTIONS #######################
2
3 # Uncomment this for fixed-point build
4 #FIXED_POINT=1
5
6 # It is strongly recommended to uncomment one of these
7 # VAR_ARRAYS: Use C99 variable-length arrays for stack allocation
8 # USE_ALLOCA: Use alloca() for stack allocation
9 # If none is defined, then the fallback is a non-threadsafe global array
10 CFLAGS := -DUSE_ALLOCA $(CFLAGS)
11 #CFLAGS := -DVAR_ARRAYS $(CFLAGS)
12
13 # These options affect performance
14 # HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion
15 #      inline: Don't use the 'inline' keyword (for ANSI C compilers)
16 #    restrict: Don't use the 'restrict' keyword (for pre-C99 compilers)
17 #CFLAGS := -DHAVE_LRINTF $(CFLAGS)
18 #CFLAGS := -Dinline= $(CFLAGS)
19 CFLAGS := -Drestrict= $(CFLAGS)
20
21 ###################### END OF OPTIONS ######################
22
23 CFLAGS += -DOPUS_VERSION='"0.9.14"'
24 include silk_sources.mk
25 include celt_sources.mk
26 include opus_sources.mk
27
28 ifdef FIXED_POINT
29 SILK_SOURCES += $(SILK_SOURCES_FIXED)
30 else
31 SILK_SOURCES += $(SILK_SOURCES_FLOAT)
32 endif
33
34 EXESUFFIX =
35 LIBPREFIX = lib
36 LIBSUFFIX = .a
37 OBJSUFFIX = .o
38
39 CC     = $(TOOLCHAIN_PREFIX)cc$(TOOLCHAIN_SUFFIX)
40 AR     = $(TOOLCHAIN_PREFIX)ar
41 RANLIB = $(TOOLCHAIN_PREFIX)ranlib
42 CP     = $(TOOLCHAIN_PREFIX)cp
43
44 cppflags-from-defines   = $(addprefix -D,$(1))
45 cppflags-from-includes  = $(addprefix -I,$(1))
46 ldflags-from-ldlibdirs  = $(addprefix -L,$(1))
47 ldlibs-from-libs                = $(addprefix -l,$(1))
48
49 WARNINGS = -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow
50 CFLAGS  += -O2 -g $(WARNINGS) -DOPUS_BUILD
51 ifdef FIXED_POINT
52 CFLAGS += -DFIXED_POINT=1 -DDISABLE_FLOAT_API
53 endif
54
55 CINCLUDES += include/ \
56         silk/ \
57         silk/float/ \
58         silk/fixed/ \
59         celt/ \
60         src/
61
62 # VPATH e.g. VPATH = src:../headers
63 VPATH = ./ \
64         silk/interface \
65         silk/src_FIX \
66         silk/src_FLP \
67         silk/src_SigProc_FIX \
68         silk/src_SigProc_FLP \
69         test
70
71 LIBS = m
72
73 LDLIBDIRS = ./
74
75 CFLAGS  += $(call cppflags-from-defines,$(CDEFINES))
76 CFLAGS  += $(call cppflags-from-includes,$(CINCLUDES))
77 LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
78 LDLIBS  += $(call ldlibs-from-libs,$(LIBS))
79
80 COMPILE.c.cmdline   = $(CC) -c $(CFLAGS) -o $@ $<
81 LINK.o              = $(CC) $(LDPREFLAGS) $(LDFLAGS)
82 LINK.o.cmdline      = $(LINK.o) $^ $(LDLIBS) -o $@$(EXESUFFIX)
83
84 ARCHIVE.cmdline     = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
85
86 %$(OBJSUFFIX):%.c
87         $(COMPILE.c.cmdline)
88
89 %$(OBJSUFFIX):%.cpp
90         $(COMPILE.cpp.cmdline)
91
92 # Directives
93
94
95 # Variable definitions
96 LIB_NAME = opus
97 TARGET = $(LIBPREFIX)$(LIB_NAME)$(LIBSUFFIX)
98
99 SRCS_C = $(SILK_SOURCES) $(CELT_SOURCES) $(OPUS_SOURCES)
100
101 OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C))
102
103 OPUSDEMO_SRCS_C = src/opus_demo.c
104 OPUSDEMO_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSDEMO_SRCS_C))
105
106 OPUSCOMPARE_SRCS_C = src/opus_compare.c
107 OPUSCOMPARE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSCOMPARE_SRCS_C))
108
109 # Rules
110 default: all
111
112 all: $(TARGET) lib opus_demo opus_compare
113
114 lib: $(TARGET)
115
116 $(TARGET): $(OBJS)
117         $(ARCHIVE.cmdline)
118
119 opus_demo$(EXESUFFIX): $(OPUSDEMO_OBJS) $(TARGET)
120         $(LINK.o.cmdline)
121
122 opus_compare$(EXESUFFIX): $(OPUSCOMPARE_OBJS)
123         $(LINK.o.cmdline)
124
125 clean:
126         rm -f opus_demo$(EXESUFFIX) opus_compare$(EXESUFFIX) $(TARGET) $(OBJS) $(OPUSDEMO_OBJS)