Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
9.5KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla tests #
  3. # ------------------------ #
  4. # Created by falkTX
  5. #
  6. # --------------------------------------------------------------
  7. CLANG ?= clang
  8. CXXLANG ?= clang++
  9. MODULEDIR=../../build/modules/Debug
  10. WINECXX ?= wineg++
  11. # --------------------------------------------------------------
  12. BASE_FLAGS = -Wall -Wextra -Werror -pipe -DBUILDING_CARLA -DREAL_BUILD -DDEBUG -O0 -g
  13. BASE_FLAGS += -I. -I../backend -I../includes -I../modules -I../utils
  14. BASE_FLAGS += -Wcast-align -Wmissing-declarations
  15. # BASE_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wundef
  16. BASE_FLAGS += -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wwrite-strings
  17. BASE_FLAGS += -Wpointer-arith -Wabi -Winit-self -Wuninitialized -Wunused-parameter
  18. # -Wfloat-equal
  19. ifneq ($(CC),clang-3.4)
  20. BASE_FLAGS += -Wlogical-op -Wunsafe-loop-optimizations
  21. endif
  22. # --------------------------------------------------------------
  23. ANSI_FLAGS = $(BASE_FLAGS) -DBUILD_ANSI_TEST
  24. # ANSI_FLAGS += -ansi -pedantic -pedantic-errors -Waggregate-return
  25. # ANSI_FLAGS += -L../backend -lcarla_standalone2
  26. # --------------------------------------------------------------
  27. GNU_CXX_FLAGS = $(BASE_FLAGS)
  28. GNU_CXX_FLAGS += -std=c++11 -std=gnu++11 -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual
  29. ifneq ($(CC),clang-3.4)
  30. GNU_CXX_FLAGS += -Wzero-as-null-pointer-constant
  31. endif
  32. # --------------------------------------------------------------
  33. PEDANTIC_CXX_FLAGS = $(BASE_FLAGS)
  34. PEDANTIC_CXX_FLAGS += -std=c++11 -pedantic -pedantic-errors
  35. PEDANTIC_CXX_FLAGS += -isystem /opt/kxstudio/include
  36. # PEDANTIC_CXX_FLAGS += -Weffc++
  37. PEDANTIC_CXX_FLAGS += -Wnon-virtual-dtor -Woverloaded-virtual -Wno-vla
  38. ifeq ($(CC),clang-3.4)
  39. PEDANTIC_CXX_FLAGS += -Wno-vla-extension
  40. else
  41. PEDANTIC_CXX_FLAGS += -Wzero-as-null-pointer-constant
  42. endif
  43. # --------------------------------------------------------------
  44. # TARGETS = ansi-pedantic-test_c_ansi
  45. # TARGETS += ansi-pedantic-test_c89
  46. # TARGETS += ansi-pedantic-test_c99
  47. # TARGETS += ansi-pedantic-test_c11
  48. # TARGETS += ansi-pedantic-test_clang
  49. # TARGETS += ansi-pedantic-test_cxx_ansi
  50. # TARGETS += ansi-pedantic-test_cxx03
  51. # TARGETS += ansi-pedantic-test_cxx11
  52. # TARGETS += ansi-pedantic-test_cxxlang
  53. # TARGETS += CarlaPipeUtils
  54. # TARGETS += CarlaRingBuffer
  55. # TARGETS += CarlaString
  56. TARGETS += CarlaUtils1
  57. # ifneq ($(WIN32),true)
  58. # TARGETS += CarlaUtils2
  59. # endif
  60. # TARGETS += CarlaUtils3
  61. # TARGETS += CarlaUtils4
  62. # TARGETS += Exceptions
  63. # TARGETS += Print
  64. # TARGETS += RDF
  65. all: $(TARGETS)
  66. # --------------------------------------------------------------
  67. ansi-pedantic-test_c_ansi: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  68. $(CC) $< $(ANSI_FLAGS) -ansi -pedantic -pedantic-errors -Wc++-compat -L../../bin -lcarla_standalone2 -o $@
  69. ansi-pedantic-test_c89: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  70. $(CC) $< $(ANSI_FLAGS) -std=c89 -pedantic -pedantic-errors -Wc++-compat -L../../bin -lcarla_standalone2 -o $@
  71. ansi-pedantic-test_c99: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  72. $(CC) $< $(ANSI_FLAGS) -std=c99 -pedantic -pedantic-errors -Wc++-compat -L../../bin -lcarla_standalone2 -o $@
  73. ansi-pedantic-test_c11: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  74. $(CC) $< $(ANSI_FLAGS) -std=c11 -pedantic -pedantic-errors -Wc++-compat -L../../bin -lcarla_standalone2 -o $@
  75. ansi-pedantic-test_clang: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  76. $(CLANG) $< $(ANSI_FLAGS) -ansi -pedantic -pedantic-errors -Wc++-compat -Weverything -Wno-padded -Wno-unknown-warning-option -L../../bin -lcarla_standalone2 -o $@
  77. ansi-pedantic-test_cxx_ansi: ansi-pedantic-test.cpp ../backend/Carla*.h ../includes/*.h
  78. $(CXX) $< $(ANSI_FLAGS) -ansi -pedantic -pedantic-errors -L../../bin -lcarla_standalone2 -o $@
  79. ansi-pedantic-test_cxx03: ansi-pedantic-test.cpp ../backend/Carla*.h ../includes/*.h
  80. $(CXX) $< $(ANSI_FLAGS) -std=c++03 -pedantic -pedantic-errors -L../../bin -lcarla_standalone2 -o $@
  81. ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h ../includes/*.h
  82. $(CXX) $< $(ANSI_FLAGS) -std=c++11 -pedantic -pedantic-errors -L../../bin -lcarla_standalone2 -o $@
  83. ansi-pedantic-test_cxxlang: ansi-pedantic-test.cpp ../backend/Carla*.h ../includes/*.h
  84. $(CXXLANG) $< $(ANSI_FLAGS) -ansi -pedantic -pedantic-errors -Weverything -Wno-padded -Wno-unknown-warning-option -L../../bin -lcarla_standalone2 -o $@
  85. # --------------------------------------------------------------
  86. CachedPlugins: CachedPlugins.cpp
  87. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(MODULEDIR)/juce_core.a $(MODULEDIR)/lilv.a -ldl -lpthread
  88. ifneq ($(WIN32),true)
  89. set -e; ./$@ && valgrind --leak-check=full ./$@
  90. endif
  91. CarlaRingBuffer: CarlaRingBuffer.cpp ../utils/CarlaRingBuffer.hpp
  92. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  93. ifneq ($(WIN32),true)
  94. set -e; ./$@ && valgrind --leak-check=full ./$@
  95. endif
  96. CarlaString: CarlaString.cpp ../utils/CarlaString.hpp
  97. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  98. ifneq ($(WIN32),true)
  99. set -e; ./$@ && valgrind --leak-check=full ./$@
  100. endif
  101. CarlaPipeUtils: CarlaPipeUtils.cpp
  102. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(MODULEDIR)/juce_core.a -ldl -lpthread
  103. ifneq ($(WIN32),true)
  104. set -e; valgrind --leak-check=full ./$@
  105. # ./$@ &&
  106. endif
  107. CarlaPipeUtils.exe: CarlaPipeUtils.cpp ../utils/CarlaPipeUtils.cpp
  108. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ $(MODULEDIR)/juce_core.a -lole32 -lshlwapi -lversion -lwsock32 -lwininet -lwinmm -lws2_32 -lpthread
  109. CarlaUtils1: CarlaUtils1.cpp ../utils/*.hpp
  110. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  111. ifneq ($(WIN32),true)
  112. set -e; ./$@ && valgrind --leak-check=full ./$@
  113. endif
  114. CarlaUtils2: CarlaUtils2.cpp ../utils/*.hpp
  115. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  116. $(MODULEDIR)/juce_core.a $(MODULEDIR)/lilv.a -ldl -lpthread -lrt
  117. set -e; ./$@ && valgrind --leak-check=full ./$@
  118. CarlaUtils3: CarlaUtils3.cpp ../utils/*.hpp
  119. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ -ldl -lrt
  120. ifneq ($(WIN32),true)
  121. set -e; ./$@ && valgrind --leak-check=full ./$@
  122. endif
  123. CarlaUtils4: CarlaUtils4.cpp ../utils/CarlaStateUtils.cpp ../utils/*.hpp
  124. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  125. $(MODULEDIR)/juce_core.a -ldl -lpthread -lrt
  126. ifneq ($(WIN32),true)
  127. set -e; ./$@ && valgrind --leak-check=full ./$@
  128. endif
  129. Exceptions: Exceptions.cpp
  130. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  131. ifneq ($(WIN32),true)
  132. set -e; ./$@ && valgrind --leak-check=full ./$@
  133. endif
  134. Print: Print.cpp ../utils/CarlaUtils.hpp
  135. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  136. ifneq ($(WIN32),true)
  137. set -e; ./$@ && valgrind --leak-check=full ./$@
  138. endif
  139. RDF: RDF.cpp ../modules/ladspa_rdf.hpp ../modules/lv2_rdf.hpp
  140. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  141. ifneq ($(WIN32),true)
  142. set -e; ./$@ && valgrind --leak-check=full ./$@
  143. endif
  144. WineJack: WineJack.cpp
  145. $(WINECXX) $< $(BASE_FLAGS) -m32 -ljack -lpthread -o $@
  146. set -e; ./$@.exe
  147. # --------------------------------------------------------------
  148. carla-uhe-test: carla-uhe-test.c
  149. $(CC) $< -Wall -Wextra -O0 -g -I../backend -I../includes -DREAL_BUILD -ldl -o $@
  150. ./$@
  151. sem: sem.cpp $(MODULEDIR)/jackbridge/*
  152. $(CXX) $< -Wall -Wextra -O0 -g -I../utils -I../includes -DREAL_BUILD -o $@
  153. ./$@
  154. # --------------------------------------------------------------
  155. ChildProcess: ChildProcess.cpp
  156. $(CXX) $< $(PEDANTIC_CXX_FLAGS) $(MODULEDIR)/juce_core.a -ldl -lpthread -lrt -o $@
  157. valgrind --leak-check=full ./$@
  158. CarlaMutex: CarlaMutex.cpp ../utils/CarlaMutex.hpp
  159. $(CXX) $< -lpthread -o $@
  160. valgrind --leak-check=full ./$@
  161. # ifneq ($(MACOS_OR_WIN32),true)
  162. # $(MODULEDIR)/rtaudio.a $(MODULEDIR)/rtmidi.a \
  163. # endif
  164. Engine: Engine.cpp
  165. $(CXX) $< \
  166. ../backend/standalone/CarlaStandalone.cpp.o \
  167. -Wl,--start-group \
  168. ../backend/carla_engine.a ../backend/carla_plugin.a $(MODULEDIR)/native-plugins.a \
  169. $(MODULEDIR)/dgl.a $(MODULEDIR)/jackbridge.a $(MODULEDIR)/lilv.a $(MODULEDIR)/rtmempool.a \
  170. -Wl,--end-group \
  171. $(PEDANTIC_CXX_FLAGS) $(shell pkg-config --libs alsa libpulse-simple liblo QtCore QtXml fluidsynth linuxsampler x11 gl smf fftw3 mxml zlib ntk_images ntk) -o $@
  172. env LD_LIBRARY_PATH=../backend valgrind --leak-check=full ./$@
  173. # $(MODULEDIR)/juce_audio_basics.a $(MODULEDIR)/juce_core.a \
  174. EngineEvents: EngineEvents.cpp
  175. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -L../backend -lcarla_standalone2 -o $@
  176. env LD_LIBRARY_PATH=../backend valgrind ./$@
  177. PipeServer: PipeServer.cpp ../utils/CarlaPipeUtils.hpp
  178. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  179. valgrind --leak-check=full ./$@
  180. RtLinkedList: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp $(MODULEDIR)/rtmempool.a
  181. $(CXX) $< $(MODULEDIR)/rtmempool.a $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  182. valgrind --leak-check=full ./$@
  183. RtLinkedListGnu: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp $(MODULEDIR)/rtmempool.a
  184. $(CXX) $< $(MODULEDIR)/rtmempool.a $(GNU_CXX_FLAGS) -lpthread -o $@
  185. valgrind --leak-check=full ./$@
  186. # --------------------------------------------------------------
  187. clean:
  188. rm -f *.o $(TARGETS)
  189. debug:
  190. $(MAKE) DEBUG=true
  191. # --------------------------------------------------------------
  192. DISTRHO: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  193. $(CXX) $< ../modules/dgl.a $(PEDANTIC_CXX_FLAGS) -I../modules/distrho -I../modules/native-plugins/nekobi $(LINK_FLAGS) $(DGL_LIBS) -lpthread -o $@
  194. ./DISTRHO
  195. DISTRHO.so: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  196. $(CXX) $< ../modules/dgl.a $(PEDANTIC_CXX_FLAGS) -I../modules/distrho -I../modules/native-plugins/nekobi -DSHARED_DLL $(LINK_FLAGS) $(DGL_LIBS) -lpthread -shared -Wl,--no-undefined -o $@
  197. DGL: DGL.cpp ../modules/distrho/dgl/src/Window.cpp
  198. $(CXX) $< $(PEDANTIC_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) -o $@
  199. # ./DGL
  200. # valgrind ./DGL
  201. # --------------------------------------------------------------