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.

147 lines
6.2KB

  1. #!/usr/bin/make -f
  2. # Makefile for tests #
  3. # ------------------ #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. BINDIR := $(CWD)/../bin
  10. ifeq ($(DEBUG),true)
  11. OBJDIR := $(CWD)/../build/tests/Debug
  12. MODULEDIR := $(CWD)/../build/modules/Debug
  13. else
  14. OBJDIR := $(CWD)/../build/tests/Release
  15. MODULEDIR := $(CWD)/../build/modules/Release
  16. endif
  17. # ---------------------------------------------------------------------------------------------------------------------
  18. BUILD_C_FLAGS += -I..
  19. BUILD_CXX_FLAGS += -I.. -I$(CWD)/modules
  20. # ---------------------------------------------------------------------------------------------------------------------
  21. PEDANTIC_FLAGS = -pedantic -pedantic-errors
  22. PEDANTIC_FLAGS += -Wall -Wextra -Werror -pipe -DBUILDING_CARLA -DREAL_BUILD
  23. PEDANTIC_FLAGS += -I. -I../backend -I../includes -I../modules -I../utils
  24. PEDANTIC_FLAGS += -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization
  25. PEDANTIC_FLAGS += -Wcast-align -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization
  26. PEDANTIC_FLAGS += -Wdouble-promotion -Wfloat-equal -Wlogical-op -Wpointer-arith -Wsign-conversion
  27. PEDANTIC_FLAGS += -Wformat=2 -Woverlength-strings
  28. PEDANTIC_FLAGS += -Wformat-truncation=2 -Wformat-overflow=2
  29. PEDANTIC_FLAGS += -Wstringop-overflow=4
  30. PEDANTIC_FLAGS += -Wmissing-declarations -Wredundant-decls
  31. PEDANTIC_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused
  32. PEDANTIC_FLAGS += -Wstrict-aliasing -fstrict-aliasing
  33. PEDANTIC_FLAGS += -Wstrict-overflow -fstrict-overflow
  34. PEDANTIC_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference
  35. # -Wstringop-truncation
  36. PEDANTIC_CFLAGS = $(PEDANTIC_FLAGS)
  37. PEDANTIC_CFLAGS += -Wc++-compat
  38. PEDANTIC_CFLAGS += -Winit-self -Wjump-misses-init -Wnested-externs -Wwrite-strings
  39. PEDANTIC_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
  40. PEDANTIC_CXXFLAGS = $(PEDANTIC_FLAGS)
  41. PEDANTIC_CXXFLAGS += -Wc++0x-compat -Wc++11-compat
  42. PEDANTIC_CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
  43. PEDANTIC_CXXFLAGS += -Wold-style-cast -Wuseless-cast
  44. PEDANTIC_CXXFLAGS += -Wzero-as-null-pointer-constant
  45. PEDANTIC_CXXFLAGS += -Weffc++
  46. PEDANTIC_CXX03_SKIPS = -Wno-pedantic
  47. PEDANTIC_CXX03_SKIPS += -Wno-zero-as-null-pointer-constant
  48. PEDANTIC_CXX98_SKIPS = $(PEDANTIC_CXX03_SKIPS)
  49. PEDANTIC_CXX98_SKIPS += -Wno-variadic-macros
  50. PEDANTIC_LDFLAGS = -Wl,-rpath,$(BINDIR) -L$(BINDIR)
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. # Set targets
  53. TARGETS = \
  54. ansi-pedantic-test_c_ansi_run \
  55. ansi-pedantic-test_c89_run \
  56. ansi-pedantic-test_c99_run \
  57. ansi-pedantic-test_c11_run \
  58. ansi-pedantic-test_cxx_ansi_run \
  59. ansi-pedantic-test_cxx98_run \
  60. ansi-pedantic-test_cxx03_run \
  61. ansi-pedantic-test_cxx11_run \
  62. carla-host-plugin_run
  63. # ---------------------------------------------------------------------------------------------------------------------
  64. all: $(TARGETS)
  65. # ---------------------------------------------------------------------------------------------------------------------
  66. ansi-%_run: $(BINDIR)/ansi-%
  67. $(BINDIR)/ansi-$*
  68. carla-%_run: $(BINDIR)/carla-%
  69. # valgrind $(BINDIR)/carla-$*
  70. valgrind --leak-check=full --show-leak-kinds=all --suppressions=valgrind.supp $(BINDIR)/carla-$*
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. $(BINDIR)/ansi-pedantic-test_c_ansi: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  73. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -o $@
  74. $(BINDIR)/ansi-pedantic-test_c89: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  75. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c89 -o $@
  76. $(BINDIR)/ansi-pedantic-test_c99: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  77. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c99 -o $@
  78. $(BINDIR)/ansi-pedantic-test_c11: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  79. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c11 -o $@
  80. # ---------------------------------------------------------------------------------------------------------------------
  81. $(BINDIR)/ansi-pedantic-test_cxx_ansi: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  82. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_CXX98_SKIPS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -Wno-effc++ -o $@
  83. $(BINDIR)/ansi-pedantic-test_cxx98: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  84. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_CXX98_SKIPS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++98 -Wno-effc++ -o $@
  85. $(BINDIR)/ansi-pedantic-test_cxx03: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  86. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_CXX03_SKIPS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++03 -Wno-effc++ -o $@
  87. $(BINDIR)/ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  88. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++11 -o $@
  89. # ---------------------------------------------------------------------------------------------------------------------
  90. $(BINDIR)/carla-host-plugin: carla-host-plugin.c
  91. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -g -O0 -Wno-declaration-after-statement -Wno-pedantic -lcarla_host-plugin -std=c99 -o $@
  92. # ---------------------------------------------------------------------------------------------------------------------
  93. clean:
  94. rm -f $(BINDIR)/ansi-pedantic-test_* $(BINDIR)/carla-host-plugin
  95. debug:
  96. $(MAKE) DEBUG=true
  97. # ---------------------------------------------------------------------------------------------------------------------
  98. $(OBJDIR)/%.c.o: %.c
  99. -@mkdir -p $(OBJDIR)
  100. @echo "Compiling $<"
  101. @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  102. $(OBJDIR)/%.cpp.o: %.cpp
  103. -@mkdir -p $(OBJDIR)
  104. @echo "Compiling $<"
  105. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  106. # ---------------------------------------------------------------------------------------------------------------------