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.

130 lines
5.4KB

  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 -Wstringop-truncation
  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. PEDANTIC_CFLAGS = $(PEDANTIC_FLAGS)
  36. PEDANTIC_CFLAGS += -Wc++-compat
  37. PEDANTIC_CFLAGS += -Winit-self -Wjump-misses-init -Wnested-externs -Wwrite-strings
  38. PEDANTIC_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
  39. PEDANTIC_CXXFLAGS = $(PEDANTIC_FLAGS)
  40. PEDANTIC_CXXFLAGS += -Wc++0x-compat -Wc++11-compat
  41. PEDANTIC_CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
  42. PEDANTIC_CXXFLAGS += -Wold-style-cast -Wuseless-cast
  43. PEDANTIC_CXXFLAGS += -Wzero-as-null-pointer-constant
  44. PEDANTIC_CXXFLAGS += -Weffc++
  45. PEDANTIC_LDFLAGS = -Wl,-rpath,$(BINDIR) -L$(BINDIR)
  46. # ---------------------------------------------------------------------------------------------------------------------
  47. # Set targets
  48. TARGETS = \
  49. ansi-pedantic-test_c_ansi_run \
  50. ansi-pedantic-test_c89_run \
  51. ansi-pedantic-test_c99_run \
  52. ansi-pedantic-test_c11_run \
  53. ansi-pedantic-test_cxx_ansi_run \
  54. ansi-pedantic-test_cxx98_run \
  55. ansi-pedantic-test_cxx03_run \
  56. ansi-pedantic-test_cxx11_run
  57. # ---------------------------------------------------------------------------------------------------------------------
  58. all: $(TARGETS)
  59. # ---------------------------------------------------------------------------------------------------------------------
  60. %_run: $(BINDIR)/%
  61. $(BINDIR)/$*
  62. # ---------------------------------------------------------------------------------------------------------------------
  63. $(BINDIR)/ansi-pedantic-test_c_ansi: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  64. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -o $@
  65. $(BINDIR)/ansi-pedantic-test_c89: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  66. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c89 -o $@
  67. $(BINDIR)/ansi-pedantic-test_c99: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  68. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c99 -o $@
  69. $(BINDIR)/ansi-pedantic-test_c11: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
  70. $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c11 -o $@
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. $(BINDIR)/ansi-pedantic-test_cxx_ansi: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  73. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -Wno-effc++ -o $@
  74. $(BINDIR)/ansi-pedantic-test_cxx98: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  75. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++98 -Wno-effc++ -o $@
  76. $(BINDIR)/ansi-pedantic-test_cxx03: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  77. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++03 -Wno-effc++ -o $@
  78. $(BINDIR)/ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
  79. $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++11 -o $@
  80. # ---------------------------------------------------------------------------------------------------------------------
  81. clean:
  82. rm -f $(BINDIR)/ansi-pedantic-test_*
  83. debug:
  84. $(MAKE) DEBUG=true
  85. # ---------------------------------------------------------------------------------------------------------------------
  86. $(OBJDIR)/%.c.o: %.c
  87. -@mkdir -p $(OBJDIR)
  88. @echo "Compiling $<"
  89. @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  90. $(OBJDIR)/%.cpp.o: %.cpp
  91. -@mkdir -p $(OBJDIR)
  92. @echo "Compiling $<"
  93. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  94. # ---------------------------------------------------------------------------------------------------------------------