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.

245 lines
9.0KB

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