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.

Makefile 9.2KB

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