1CXX=g++ 2GDB=gdb 3 4# Adjust and uncomment to enable the corresponding tests 5# STLPORT46_ROOT_DIR=/usr/local/stlport-4.6.2 6# STLPORT50_ROOT_DIR=/usr/local/stlport-5.0.3 7# STLPORT51_ROOT_DIR=/usr/local/stlport-5.1.7 8# STLPORT52_ROOT_DIR=/usr/local/stlport-5.2.1 9 10# To enable Boost support you might need to patch 11# $(STLPORT52_ROOT_DIR)/include/stlport/stl/type_traits.h 12# to include <boost/type_traits/remove_const.hpp>. 13# STLPORT52_USE_BOOST_SUPPORT=1 14 15 16 17# Common flags for STLport 4.6.x tests 18STLPORT46_FLAGS = \ 19 $(CXXFLAGS) $(LDFLAGS) \ 20 -I$(STLPORT46_ROOT_DIR)/include/stlport \ 21 -L$(STLPORT46_ROOT_DIR)/lib \ 22 -Wl,-R$(STLPORT46_ROOT_DIR)/lib \ 23 -pthread 24 25# Common flags for STLport 5.0.x tests 26STLPORT50_FLAGS = \ 27 $(CXXFLAGS) $(LDFLAGS) \ 28 -I$(STLPORT50_ROOT_DIR)/include/stlport \ 29 -L$(STLPORT50_ROOT_DIR)/lib \ 30 -Wl,-R$(STLPORT50_ROOT_DIR)/lib \ 31 -pthread 32 33# Common flags for STLport 5.1.x tests 34STLPORT51_FLAGS = \ 35 $(CXXFLAGS) $(LDFLAGS) \ 36 -I$(STLPORT51_ROOT_DIR)/include/stlport \ 37 -L$(STLPORT51_ROOT_DIR)/lib \ 38 -Wl,-R$(STLPORT51_ROOT_DIR)/lib \ 39 -pthread 40 41# Common flags for STLport 5.2.x tests 42STLPORT52_FLAGS = \ 43 $(CXXFLAGS) $(LDFLAGS) \ 44 -I$(STLPORT52_ROOT_DIR)/include/stlport \ 45 -L$(STLPORT52_ROOT_DIR)/lib \ 46 -Wl,-R$(STLPORT52_ROOT_DIR)/lib \ 47 -pthread 48 49ifneq ($(STLPORT52_USE_BOOST_SUPPORT),) 50STLPORT52_FLAGS += -D_STLP_USE_BOOST_SUPPORT 51endif 52 53 54 55# Add STLport 4.6.x tests to $(TARGETS) (if enabled) 56ifneq ($(STLPORT46_ROOT_DIR),) 57TARGETS += test_stlport46 test_stlport46d 58endif 59 60# Add STLport 5.0.x tests to $(TARGETS) (if enabled) 61ifneq ($(STLPORT50_ROOT_DIR),) 62TARGETS += test_stlport50 test_stlport50d 63endif 64 65# Add STLport 5.1.x tests to $(TARGETS) (if enabled) 66ifneq ($(STLPORT51_ROOT_DIR),) 67TARGETS += test_stlport51 test_stlport51d 68endif 69 70# Add STLport 5.2.x tests to $(TARGETS) (if enabled) 71ifneq ($(STLPORT52_ROOT_DIR),) 72TARGETS += test_stlport52 test_stlport52d 73endif 74 75 76 77default: run 78ifeq ($(TARGETS),) 79 @echo "You need to configure the STLport directory at the start of the Makefile." 80endif 81 82run: build 83ifneq ($(TARGETS),) 84 for TARGET in $(TARGETS); do \ 85 echo "Running test for $$TARGET"; \ 86 $(GDB) -batch -x script ./$$TARGET; \ 87 done 88endif 89 90build: $(TARGETS) 91 92test_stlport46: test.cpp Makefile 93 $(CXX) -o $@ $< -g $(STLPORT46_FLAGS) -lstlport_gcc 94 95test_stlport46d: test.cpp Makefile 96 $(CXX) -o $@ $< -g $(STLPORT46_FLAGS) -lstlport_gcc_stldebug -D_STLP_DEBUG 97 98test_stlport50: test.cpp Makefile 99 $(CXX) -o $@ $< -g $(STLPORT50_FLAGS) -lstlport 100 101test_stlport50d: test.cpp Makefile 102 $(CXX) -o $@ $< -g $(STLPORT50_FLAGS) -lstlportstlg -D_STLP_DEBUG 103 104test_stlport51: test.cpp Makefile 105 $(CXX) -o $@ $< -g $(STLPORT51_FLAGS) -lstlport 106 107test_stlport51d: test.cpp Makefile 108 $(CXX) -o $@ $< -g $(STLPORT51_FLAGS) -lstlportstlg -D_STLP_DEBUG 109 110test_stlport52: test.cpp Makefile 111 $(CXX) -o $@ $< -g $(STLPORT52_FLAGS) -lstlport 112 113test_stlport52d: test.cpp Makefile 114 $(CXX) -o $@ $< -g $(STLPORT52_FLAGS) -lstlportstlg -D_STLP_DEBUG 115 116clean: 117 rm -f test_stlport* 118