|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #!/usr/bin/make -f
- # Makefile for tests #
- # ------------------ #
- # Created by falkTX
- #
-
- CWD=..
- include $(CWD)/Makefile.mk
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- BINDIR := $(CWD)/../bin
-
- ifeq ($(DEBUG),true)
- OBJDIR := $(CWD)/../build/tests/Debug
- MODULEDIR := $(CWD)/../build/modules/Debug
- else
- OBJDIR := $(CWD)/../build/tests/Release
- MODULEDIR := $(CWD)/../build/modules/Release
- endif
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- BUILD_C_FLAGS += -I..
- BUILD_CXX_FLAGS += -I.. -I$(CWD)/modules
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- PEDANTIC_FLAGS = -pedantic -pedantic-errors
- PEDANTIC_FLAGS += -Wall -Wextra -Werror -pipe -DBUILDING_CARLA -DREAL_BUILD
- PEDANTIC_FLAGS += -I. -I../backend -I../includes -I../modules -I../utils
-
- PEDANTIC_FLAGS += -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization
- PEDANTIC_FLAGS += -Wcast-align -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization
- PEDANTIC_FLAGS += -Wdouble-promotion -Wfloat-equal -Wlogical-op -Wpointer-arith -Wsign-conversion
- PEDANTIC_FLAGS += -Wformat=2 -Woverlength-strings
- PEDANTIC_FLAGS += -Wformat-truncation=2 -Wformat-overflow=2
- PEDANTIC_FLAGS += -Wstringop-overflow=4 -Wstringop-truncation
- PEDANTIC_FLAGS += -Wmissing-declarations -Wredundant-decls
- PEDANTIC_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused
- PEDANTIC_FLAGS += -Wstrict-aliasing -fstrict-aliasing
- PEDANTIC_FLAGS += -Wstrict-overflow -fstrict-overflow
- PEDANTIC_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference
-
- PEDANTIC_CFLAGS = $(PEDANTIC_FLAGS)
- PEDANTIC_CFLAGS += -Wc++-compat
- PEDANTIC_CFLAGS += -Winit-self -Wjump-misses-init -Wnested-externs -Wwrite-strings
- PEDANTIC_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
-
- PEDANTIC_CXXFLAGS = $(PEDANTIC_FLAGS)
- PEDANTIC_CXXFLAGS += -Wc++0x-compat -Wc++11-compat
- PEDANTIC_CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
- PEDANTIC_CXXFLAGS += -Wold-style-cast -Wuseless-cast
- PEDANTIC_CXXFLAGS += -Wzero-as-null-pointer-constant
- PEDANTIC_CXXFLAGS += -Weffc++
-
- PEDANTIC_LDFLAGS = -Wl,-rpath,$(BINDIR) -L$(BINDIR)
-
- # ---------------------------------------------------------------------------------------------------------------------
- # Set targets
-
- TARGETS = \
- ansi-pedantic-test_c_ansi_run \
- ansi-pedantic-test_c89_run \
- ansi-pedantic-test_c99_run \
- ansi-pedantic-test_c11_run \
- ansi-pedantic-test_cxx_ansi_run \
- ansi-pedantic-test_cxx98_run \
- ansi-pedantic-test_cxx03_run \
- ansi-pedantic-test_cxx11_run
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- all: $(TARGETS)
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- %_run: $(BINDIR)/%
- $(BINDIR)/$*
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- $(BINDIR)/ansi-pedantic-test_c_ansi: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
- $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -o $@
-
- $(BINDIR)/ansi-pedantic-test_c89: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
- $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c89 -o $@
-
- $(BINDIR)/ansi-pedantic-test_c99: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
- $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c99 -o $@
-
- $(BINDIR)/ansi-pedantic-test_c11: ansi-pedantic-test.c ../backend/Carla*.h ../includes/*.h
- $(CC) $< $(PEDANTIC_CFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c11 -o $@
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- $(BINDIR)/ansi-pedantic-test_cxx_ansi: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
- $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -ansi -Wno-effc++ -o $@
-
- $(BINDIR)/ansi-pedantic-test_cxx98: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
- $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++98 -Wno-effc++ -o $@
-
- $(BINDIR)/ansi-pedantic-test_cxx03: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
- $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++03 -Wno-effc++ -o $@
-
- $(BINDIR)/ansi-pedantic-test_cxx11: ansi-pedantic-test.cpp ../backend/Carla*.h ../backend/Carla*.hpp ../includes/*.h
- $(CXX) $< $(PEDANTIC_CXXFLAGS) $(PEDANTIC_LDFLAGS) -lcarla_standalone2 -lcarla_utils -std=c++11 -o $@
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- clean:
- rm -f $(BINDIR)/ansi-pedantic-test_*
-
- debug:
- $(MAKE) DEBUG=true
-
- # ---------------------------------------------------------------------------------------------------------------------
-
- $(OBJDIR)/%.c.o: %.c
- -@mkdir -p $(OBJDIR)
- @echo "Compiling $<"
- @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
-
- $(OBJDIR)/%.cpp.o: %.cpp
- -@mkdir -p $(OBJDIR)
- @echo "Compiling $<"
- @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
-
- # ---------------------------------------------------------------------------------------------------------------------
|