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.8KB

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