2 # Makefile for carla tests #
3 # ------------------------ #
7 # ---------------------------------------------------------------------------------------------------------------------
12 MODULEDIR
=..
/..
/build
/modules
/Debug
13 MODULEDIR
=..
/..
/build
/modules
/Release
17 # ---------------------------------------------------------------------------------------------------------------------
19 BASE_FLAGS
= -Wall
-Wextra
-Werror
-pipe
-DBUILDING_CARLA
-DREAL_BUILD
20 BASE_FLAGS
+= -I.
-I..
/backend
-I..
/includes
-I..
/modules
-I..
/utils
21 BASE_FLAGS
+= -Wcast-align
-Wmissing-declarations
22 # BASE_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wundef
23 BASE_FLAGS
+= -Wformat
-Wformat-security
-Wredundant-decls
-Wshadow
-Wstrict-overflow
-fstrict-overflow
-Wwrite-strings
24 BASE_FLAGS
+= -Wpointer-arith
-Wabi
=2 -Winit-self
-Wuninitialized
-Wunused-parameter
30 BASE_FLAGS
+= -Wlogical-op
-Wunsafe-loop-optimizations
34 BASE_FLAGS
+= -DDEBUG
-O0
-g
36 BASE_FLAGS
+= -O3
-ffast-math
-mtune
=generic
-msse
-msse2
-mfpmath
=sse
-fdata-sections
-ffunction-sections
37 LINK_FLAGS
+= -fdata-sections
-ffunction-sections
-Wl
,--gc-sections
-Wl
,-O1
-Wl
,--as-needed
-Wl
,--strip-all
40 # ---------------------------------------------------------------------------------------------------------------------
42 ANSI_FLAGS
= $(BASE_FLAGS
) -DBUILD_ANSI_TEST
43 # ANSI_FLAGS += -ansi -pedantic -pedantic-errors -Waggregate-return
44 # ANSI_FLAGS += -L../backend -lcarla_standalone2
46 # ---------------------------------------------------------------------------------------------------------------------
48 GNU_CXX_FLAGS
= $(BASE_FLAGS
)
49 GNU_CXX_FLAGS
+= -std
=c
++11 -std
=gnu
++11 -Weffc
++ -Wnon-virtual-dtor
-Woverloaded-virtual
50 ifneq ($(CC
),clang-3.4
)
51 GNU_CXX_FLAGS
+= -Wzero-as-null-pointer-constant
54 # ---------------------------------------------------------------------------------------------------------------------
56 PEDANTIC_CXX_FLAGS
= $(BASE_FLAGS
)
57 PEDANTIC_CXX_FLAGS
+= -std
=c
++11 -pedantic
-pedantic-errors
58 PEDANTIC_CXX_FLAGS
+= -isystem
/opt
/kxstudio
/include
59 # PEDANTIC_CXX_FLAGS += -Weffc++
60 PEDANTIC_CXX_FLAGS
+= -Wnon-virtual-dtor
-Woverloaded-virtual
-Wno-vla
61 ifeq ($(CC
),clang-3.4
)
62 PEDANTIC_CXX_FLAGS
+= -Wno-vla-extension
64 PEDANTIC_CXX_FLAGS
+= -Wzero-as-null-pointer-constant
67 # ---------------------------------------------------------------------------------------------------------------------
69 # TARGETS = ansi-pedantic-test_c_ansi
70 # TARGETS += ansi-pedantic-test_c89
71 # TARGETS += ansi-pedantic-test_c99
72 # TARGETS += ansi-pedantic-test_c11
73 # TARGETS += ansi-pedantic-test_clang
74 # TARGETS += ansi-pedantic-test_cxx_ansi
75 # TARGETS += ansi-pedantic-test_cxx03
76 # TARGETS += ansi-pedantic-test_cxx11
77 # TARGETS += ansi-pedantic-test_cxxlang
78 # TARGETS += CarlaPipeUtils
79 # TARGETS += CarlaRingBuffer
80 # TARGETS += CarlaString
81 TARGETS
+= CarlaUtils1
82 # ifneq ($(WIN32),true)
83 # TARGETS += CarlaUtils2
85 # TARGETS += CarlaUtils3
86 # TARGETS += CarlaUtils4
87 # TARGETS += Exceptions
93 # ---------------------------------------------------------------------------------------------------------------------
95 ansi-pedantic-test_c_ansi
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
96 $(CC
) $< $(ANSI_FLAGS
) -ansi
-pedantic
-pedantic-errors
-Wc
++-compat
-L..
/..
/bin
-lcarla_standalone2
-o
$@
98 ansi-pedantic-test_c89
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
99 $(CC
) $< $(ANSI_FLAGS
) -std
=c89
-pedantic
-pedantic-errors
-Wc
++-compat
-L..
/..
/bin
-lcarla_standalone2
-o
$@
101 ansi-pedantic-test_c99
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
102 $(CC
) $< $(ANSI_FLAGS
) -std
=c99
-pedantic
-pedantic-errors
-Wc
++-compat
-L..
/..
/bin
-lcarla_standalone2
-o
$@
104 ansi-pedantic-test_c11
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
105 $(CC
) $< $(ANSI_FLAGS
) -std
=c11
-pedantic
-pedantic-errors
-Wc
++-compat
-L..
/..
/bin
-lcarla_standalone2
-o
$@
107 ansi-pedantic-test_clang
: ansi-pedantic-test.c ..
/backend
/Carla
*.h ..
/includes
/*.h
108 $(CLANG
) $< $(ANSI_FLAGS
) -ansi
-pedantic
-pedantic-errors
-Wc
++-compat
-Weverything
-Wno-padded
-Wno-unknown-warning-option
-L..
/..
/bin
-lcarla_standalone2
-o
$@
110 ansi-pedantic-test_cxx_ansi
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/includes
/*.h
111 $(CXX
) $< $(ANSI_FLAGS
) -ansi
-pedantic
-pedantic-errors
-L..
/..
/bin
-lcarla_standalone2
-o
$@
113 ansi-pedantic-test_cxx03
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/includes
/*.h
114 $(CXX
) $< $(ANSI_FLAGS
) -std
=c
++03 -pedantic
-pedantic-errors
-L..
/..
/bin
-lcarla_standalone2
-o
$@
116 ansi-pedantic-test_cxx11
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/includes
/*.h
117 $(CXX
) $< $(ANSI_FLAGS
) -std
=c
++11 -pedantic
-pedantic-errors
-L..
/..
/bin
-lcarla_standalone2
-o
$@
119 ansi-pedantic-test_cxxlang
: ansi-pedantic-test.
cpp ..
/backend
/Carla
*.h ..
/includes
/*.h
120 $(CXXLANG
) $< $(ANSI_FLAGS
) -ansi
-pedantic
-pedantic-errors
-Weverything
-Wno-padded
-Wno-unknown-warning-option
-L..
/..
/bin
-lcarla_standalone2
-o
$@
122 # ---------------------------------------------------------------------------------------------------------------------
124 ctypes-test.so
: ctypes-test.c .FORCED
125 $(CC
) $< $(BASE_FLAGS
) -fPIC
-shared
-o
$@
126 set
-e
; .
/ctypes-test.py
128 # ---------------------------------------------------------------------------------------------------------------------
130 CachedPlugins
: CachedPlugins.
cpp
131 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
$(MODULEDIR
)/juce_core.a
$(MODULEDIR
)/lilv.a
-ldl
-pthread
132 ifneq ($(WIN32
),true
)
133 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
136 CarlaRingBuffer
: CarlaRingBuffer.
cpp ..
/utils
/CarlaRingBuffer.hpp
137 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
138 ifneq ($(WIN32
),true
)
139 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
142 CarlaString
: CarlaString.
cpp ..
/utils
/CarlaString.hpp
143 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
144 ifneq ($(WIN32
),true
)
145 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
148 CarlaPipeUtils
: CarlaPipeUtils.
cpp
149 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
$(MODULEDIR
)/juce_core.a
-ldl
-pthread
150 ifneq ($(WIN32
),true
)
151 set
-e
; valgrind
--leak-check
=full .
/$@
155 CarlaPipeUtils.exe
: CarlaPipeUtils.
cpp ..
/utils
/CarlaPipeUtils.
cpp
156 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
$(MODULEDIR
)/water.a
-lole32
-lshlwapi
-lversion
-lwsock32
-lwininet
-lwinmm
-lws2_32
-pthread
-static
158 CarlaUtils1
: CarlaUtils1.
cpp ..
/utils
/*.hpp
159 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
160 ifneq ($(WIN32
),true
)
161 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
164 CarlaUtils2
: CarlaUtils2.
cpp ..
/utils
/*.hpp
165 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@ \
166 $(MODULEDIR
)/juce_core.a
$(MODULEDIR
)/lilv.a
-ldl
-pthread
-lrt
167 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
169 CarlaUtils3
: CarlaUtils3.
cpp ..
/utils
/*.hpp
170 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
-ldl
-lrt
171 ifneq ($(WIN32
),true
)
172 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
175 CarlaUtils4
: CarlaUtils4.
cpp ..
/utils
/CarlaStateUtils.
cpp ..
/utils
/*.hpp
176 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@ \
177 $(MODULEDIR
)/juce_core.a
-ldl
-pthread
-lrt
178 ifneq ($(WIN32
),true
)
179 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
182 Exceptions
: Exceptions.
cpp
183 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
184 ifneq ($(WIN32
),true
)
185 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
188 Print
: Print.
cpp ..
/utils
/CarlaUtils.hpp
189 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
190 ifneq ($(WIN32
),true
)
191 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
194 RDF
: RDF.
cpp ..
/modules
/ladspa_rdf.hpp ..
/modules
/lv2_rdf.hpp
195 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -o
$@
196 ifneq ($(WIN32
),true
)
197 set
-e
; .
/$@
&& valgrind
--leak-check
=full .
/$@
200 WineJack
: WineJack.
cpp
201 $(WINECXX
) $< $(BASE_FLAGS
) -m32
-ljack
-pthread
-o
$@
204 # ---------------------------------------------------------------------------------------------------------------------
206 carla-uhe-test
: carla-uhe-test.c
207 $(CC
) $< -Wall
-Wextra
-O0
-g
-I..
/backend
-I..
/includes
-DREAL_BUILD
-ldl
-o
$@
210 sem
: sem.
cpp $(MODULEDIR
)/jackbridge
/*
211 $(CXX
) $< -Wall
-Wextra
-O0
-g
-I..
/utils
-I..
/includes
-DREAL_BUILD
-o
$@
214 # ---------------------------------------------------------------------------------------------------------------------
216 ChildProcess
: ChildProcess.
cpp
217 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) $(MODULEDIR
)/juce_core.a
-ldl
-pthread
-lrt
-o
$@
218 valgrind
--leak-check
=full .
/$@
220 CarlaMutex
: CarlaMutex.
cpp ..
/utils
/CarlaMutex.hpp
221 $(CXX
) $< -pthread
-o
$@
222 valgrind
--leak-check
=full .
/$@
224 # ifneq ($(MACOS_OR_WIN32),true)
225 # $(MODULEDIR)/rtaudio.a $(MODULEDIR)/rtmidi.a \
230 ..
/backend
/standalone
/CarlaStandalone.
cpp.o \
232 ..
/backend
/carla_engine.a ..
/backend
/carla_plugin.a
$(MODULEDIR
)/native-plugins.a \
233 $(MODULEDIR
)/dgl.a
$(MODULEDIR
)/jackbridge.a
$(MODULEDIR
)/lilv.a
$(MODULEDIR
)/rtmempool.a \
235 $(PEDANTIC_CXX_FLAGS
) $(shell pkg-config
--libs alsa libpulse-simple liblo QtCore QtXml fluidsynth x11 gl smf fftw3 mxml zlib ntk_images ntk
) -o
$@
236 env LD_LIBRARY_PATH
=..
/backend valgrind
--leak-check
=full .
/$@
237 # $(MODULEDIR)/juce_audio_basics.a $(MODULEDIR)/juce_core.a \
239 EngineEvents
: EngineEvents.
cpp
240 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -L..
/backend
-lcarla_standalone2
-o
$@
241 env LD_LIBRARY_PATH
=..
/backend valgrind .
/$@
243 PipeServer
: PipeServer.
cpp ..
/utils
/CarlaPipeUtils.hpp
244 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) -pthread
-o
$@
245 valgrind
--leak-check
=full .
/$@
247 RtLinkedList
: RtLinkedList.
cpp ..
/utils
/LinkedList.hpp ..
/utils
/RtLinkedList.hpp
$(MODULEDIR
)/rtmempool.a
248 $(CXX
) $< $(MODULEDIR
)/rtmempool.a
$(PEDANTIC_CXX_FLAGS
) -pthread
-o
$@
249 valgrind
--leak-check
=full .
/$@
251 RtLinkedListGnu
: RtLinkedList.
cpp ..
/utils
/LinkedList.hpp ..
/utils
/RtLinkedList.hpp
$(MODULEDIR
)/rtmempool.a
252 $(CXX
) $< $(MODULEDIR
)/rtmempool.a
$(GNU_CXX_FLAGS
) -pthread
-o
$@
253 valgrind
--leak-check
=full .
/$@
255 # ---------------------------------------------------------------------------------------------------------------------
263 # ---------------------------------------------------------------------------------------------------------------------
265 DISTRHO
: DISTRHO.
cpp ..
/modules
/distrho
/*.hpp ..
/modules
/distrho
/src
/*.
cpp
266 $(CXX
) $< ..
/modules
/dgl.a
$(PEDANTIC_CXX_FLAGS
) -I..
/modules
/distrho
-I..
/modules
/native-plugins
/nekobi
$(LINK_FLAGS
) $(DGL_LIBS
) -pthread
-o
$@
269 DISTRHO.so
: DISTRHO.
cpp ..
/modules
/distrho
/*.hpp ..
/modules
/distrho
/src
/*.
cpp
270 $(CXX
) $< ..
/modules
/dgl.a
$(PEDANTIC_CXX_FLAGS
) -I..
/modules
/distrho
-I..
/modules
/native-plugins
/nekobi
-DSHARED_DLL
$(LINK_FLAGS
) $(DGL_LIBS
) -pthread
-shared
-Wl
,--no-undefined
-o
$@
272 DGL
: DGL.
cpp ..
/modules
/distrho
/dgl
/src
/Window.
cpp
273 $(CXX
) $< $(PEDANTIC_CXX_FLAGS
) $(LINK_FLAGS
) $(DGL_LIBS
) -o
$@
277 # ---------------------------------------------------------------------------------------------------------------------