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.

215 lines
7.6KB

  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. CarlaPipeUtils: CarlaPipeUtils.cpp
  77. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ ../modules/juce_core.a -ldl -lpthread
  78. CarlaPipeUtils.exe: CarlaPipeUtils.cpp
  79. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ ../modules/juce_core.a -lole32 -lshlwapi -lversion -lwsock32 -lwininet -lwinmm -lws2_32 -lpthread
  80. CarlaUtils1: CarlaUtils1.cpp ../utils/*.hpp
  81. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  82. ifneq ($(WIN32),true)
  83. ./$@ && valgrind --leak-check=full ./$@
  84. endif
  85. CarlaUtils2: CarlaUtils2.cpp ../utils/*.hpp
  86. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  87. ../modules/juce_core.a ../modules/lilv.a -ldl -lpthread -lrt
  88. ./$@ && valgrind --leak-check=full ./$@
  89. CarlaUtils3: CarlaUtils3.cpp ../utils/*.hpp
  90. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ -ldl -lrt
  91. ifneq ($(WIN32),true)
  92. ./$@ && valgrind --leak-check=full ./$@
  93. endif
  94. CarlaUtils4: CarlaUtils4.cpp ../utils/CarlaStateUtils.cpp ../utils/*.hpp
  95. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  96. ../modules/juce_core.a -ldl -lpthread -lrt
  97. ifneq ($(WIN32),true)
  98. ./$@ && valgrind --leak-check=full ./$@
  99. endif
  100. Exceptions: Exceptions.cpp
  101. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  102. ifneq ($(WIN32),true)
  103. ./$@ && valgrind --leak-check=full ./$@
  104. endif
  105. Print: Print.cpp ../utils/CarlaUtils.hpp
  106. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  107. ifneq ($(WIN32),true)
  108. ./$@ && valgrind --leak-check=full ./$@
  109. endif
  110. RDF: RDF.cpp ../modules/ladspa_rdf.hpp ../modules/lv2_rdf.hpp
  111. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  112. ifneq ($(WIN32),true)
  113. ./$@ && valgrind --leak-check=full ./$@
  114. endif
  115. # --------------------------------------------------------------
  116. sem: sem.cpp ../modules/jackbridge/*
  117. $(CXX) $< -Wall -Wextra -O0 -g -I../utils -I../includes -DREAL_BUILD -o $@
  118. ./$@
  119. # --------------------------------------------------------------
  120. ChildProcess: ChildProcess.cpp
  121. $(CXX) $< $(PEDANTIC_CXX_FLAGS) ../modules/juce_core.a -ldl -lpthread -lrt -o $@
  122. valgrind --leak-check=full ./$@
  123. CarlaMutex: CarlaMutex.cpp ../utils/CarlaMutex.hpp
  124. $(CXX) $< -lpthread -o $@
  125. valgrind --leak-check=full ./$@
  126. # ifneq ($(MACOS_OR_WIN32),true)
  127. # ../modules/rtaudio.a ../modules/rtmidi.a \
  128. # endif
  129. Engine: Engine.cpp
  130. $(CXX) $< \
  131. ../backend/standalone/CarlaStandalone.cpp.o \
  132. -Wl,--start-group \
  133. ../backend/carla_engine.a ../backend/carla_plugin.a ../modules/native-plugins.a \
  134. ../modules/dgl.a ../modules/jackbridge.a ../modules/lilv.a ../modules/rtmempool.a \
  135. -Wl,--end-group \
  136. $(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 $@
  137. env LD_LIBRARY_PATH=../backend valgrind --leak-check=full ./$@
  138. # ../modules/juce_audio_basics.a ../modules/juce_core.a \
  139. EngineEvents: EngineEvents.cpp
  140. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -L../backend -lcarla_standalone2 -o $@
  141. env LD_LIBRARY_PATH=../backend valgrind ./$@
  142. PipeServer: PipeServer.cpp ../utils/CarlaPipeUtils.hpp
  143. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  144. valgrind --leak-check=full ./$@
  145. RtLinkedList: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp ../modules/rtmempool.a
  146. $(CXX) $< ../modules/rtmempool.a $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  147. valgrind --leak-check=full ./$@
  148. RtLinkedListGnu: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp ../modules/rtmempool.a
  149. $(CXX) $< ../modules/rtmempool.a $(GNU_CXX_FLAGS) -lpthread -o $@
  150. valgrind --leak-check=full ./$@
  151. # --------------------------------------------------------------
  152. clean:
  153. rm -f *.o $(TARGETS)
  154. debug:
  155. $(MAKE) DEBUG=true
  156. # --------------------------------------------------------------
  157. DISTRHO: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  158. $(CXX) $< ../modules/dgl.a $(PEDANTIC_CXX_FLAGS) -I../modules/distrho -I../modules/native-plugins/nekobi $(LINK_FLAGS) $(DGL_LIBS) -lpthread -o $@
  159. ./DISTRHO
  160. DISTRHO.so: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  161. $(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 $@
  162. DGL: DGL.cpp ../modules/distrho/dgl/src/Window.cpp
  163. $(CXX) $< $(PEDANTIC_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) -o $@
  164. # ./DGL
  165. # valgrind ./DGL
  166. # --------------------------------------------------------------