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.

209 lines
7.3KB

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