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.

181 lines
6.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 -fPIC -DPIC -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_c ansi-pedantic-test_c99
  38. TARGETS += CarlaRingBuffer CarlaString
  39. TARGETS += CarlaUtils1 CarlaUtils2 CarlaUtils3 CarlaUtils4
  40. TARGETS += Exceptions Print RDF
  41. # ansi-pedantic-test_cxx ansi-pedantic-test_cxx11
  42. # TARGETS += EngineEvents PipeServer RtLinkedList RtLinkedListGnu
  43. all: $(TARGETS)
  44. # --------------------------------------------------------------
  45. ansi-pedantic-test_c: ansi-pedantic-test.c ../backend/Carla*.h
  46. $(CC) $< $(ANSI_FLAGS) -Wc++-compat -o $@
  47. ansi-pedantic-test_c99: ansi-pedantic-test.c ../backend/Carla*.h
  48. $(CC) $< $(ANSI_FLAGS) -std=c99 -pedantic -pedantic-errors -Wc++-compat -o $@
  49. ansi-pedantic-test_cxx: ansi-pedantic-test.cpp ../backend/Carla*.h
  50. $(CXX) $< $(ANSI_FLAGS) -o $@
  51. ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h
  52. $(CXX) $< $(ANSI_FLAGS) -std=c++11 -pedantic -pedantic-errors -o $@
  53. # --------------------------------------------------------------
  54. CarlaRingBuffer: CarlaRingBuffer.cpp ../utils/CarlaRingBuffer.hpp
  55. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  56. ./$@ && valgrind --leak-check=full ./$@
  57. CarlaString: CarlaString.cpp ../utils/CarlaString.hpp
  58. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  59. ./$@ && valgrind --leak-check=full ./$@
  60. CarlaUtils1: CarlaUtils1.cpp ../utils/*.hpp
  61. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  62. ./$@ && valgrind --leak-check=full ./$@
  63. CarlaUtils2: CarlaUtils2.cpp ../utils/*.hpp
  64. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  65. ../modules/juce_core.a ../modules/lilv.a -ldl -lpthread -lrt
  66. ./$@ && valgrind --leak-check=full ./$@
  67. CarlaUtils3: CarlaUtils3.cpp ../utils/*.hpp
  68. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ -ldl -lrt
  69. ./$@ && valgrind --leak-check=full ./$@
  70. CarlaUtils4: CarlaUtils4.cpp ../utils/CarlaStateUtils.cpp ../utils/*.hpp
  71. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@ \
  72. ../modules/juce_core.a -ldl -lpthread -lrt
  73. ./$@ && valgrind --leak-check=full ./$@
  74. Exceptions: Exceptions.cpp
  75. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  76. ./$@ && valgrind --leak-check=full ./$@
  77. Print: Print.cpp ../utils/CarlaUtils.hpp
  78. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  79. ./$@ && valgrind --leak-check=full ./$@
  80. RDF: RDF.cpp ../modules/ladspa_rdf.hpp ../modules/lv2_rdf.hpp
  81. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -o $@
  82. ./$@ && valgrind --leak-check=full ./$@
  83. # --------------------------------------------------------------
  84. sem: sem.cpp ../modules/jackbridge/*
  85. $(CXX) $< -Wall -Wextra -O0 -g -I../utils -I../includes -DREAL_BUILD -o $@
  86. ./$@
  87. # --------------------------------------------------------------
  88. ChildProcess: ChildProcess.cpp
  89. $(CXX) $< $(PEDANTIC_CXX_FLAGS) ../modules/juce_core.a -ldl -lpthread -lrt -o $@
  90. valgrind --leak-check=full ./$@
  91. CarlaMutex: CarlaMutex.cpp ../utils/CarlaMutex.hpp
  92. $(CXX) $< -lpthread -o $@
  93. valgrind --leak-check=full ./$@
  94. # ifneq ($(MACOS_OR_WIN32),true)
  95. # ../modules/rtaudio.a ../modules/rtmidi.a \
  96. # endif
  97. Engine: Engine.cpp
  98. $(CXX) $< \
  99. ../backend/standalone/CarlaStandalone.cpp.o \
  100. -Wl,--start-group \
  101. ../backend/carla_engine.a ../backend/carla_plugin.a ../modules/native-plugins.a \
  102. ../modules/dgl.a ../modules/jackbridge.a ../modules/lilv.a ../modules/rtmempool.a \
  103. -Wl,--end-group \
  104. $(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 $@
  105. env LD_LIBRARY_PATH=../backend valgrind --leak-check=full ./$@
  106. # ../modules/juce_audio_basics.a ../modules/juce_core.a \
  107. EngineEvents: EngineEvents.cpp
  108. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -L../backend -lcarla_standalone2 -o $@
  109. env LD_LIBRARY_PATH=../backend valgrind ./$@
  110. PipeServer: PipeServer.cpp ../utils/CarlaPipeUtils.hpp
  111. $(CXX) $< $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  112. valgrind --leak-check=full ./$@
  113. RtLinkedList: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp ../modules/rtmempool.a
  114. $(CXX) $< ../modules/rtmempool.a $(PEDANTIC_CXX_FLAGS) -lpthread -o $@
  115. valgrind --leak-check=full ./$@
  116. RtLinkedListGnu: RtLinkedList.cpp ../utils/LinkedList.hpp ../utils/RtLinkedList.hpp ../modules/rtmempool.a
  117. $(CXX) $< ../modules/rtmempool.a $(GNU_CXX_FLAGS) -lpthread -o $@
  118. valgrind --leak-check=full ./$@
  119. # --------------------------------------------------------------
  120. clean:
  121. rm -f *.o $(TARGETS)
  122. debug:
  123. $(MAKE) DEBUG=true
  124. # --------------------------------------------------------------
  125. DISTRHO: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  126. $(CXX) $< ../modules/dgl.a $(PEDANTIC_CXX_FLAGS) -I../modules/distrho -I../modules/native-plugins/nekobi $(LINK_FLAGS) $(DGL_LIBS) -lpthread -o $@
  127. ./DISTRHO
  128. DISTRHO.so: DISTRHO.cpp ../modules/distrho/*.hpp ../modules/distrho/src/*.cpp
  129. $(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 $@
  130. DGL: DGL.cpp ../modules/distrho/dgl/src/Window.cpp
  131. $(CXX) $< $(PEDANTIC_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) -o $@
  132. # ./DGL
  133. # valgrind ./DGL
  134. # --------------------------------------------------------------