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.

280 lines
11KB

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