Home | History | Annotate | Download | only in test
      1 CXX=g++
      2 GDB=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
     18 STLPORT46_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
     26 STLPORT50_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
     34 STLPORT51_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
     42 STLPORT52_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 
     49 ifneq ($(STLPORT52_USE_BOOST_SUPPORT),)
     50 STLPORT52_FLAGS += -D_STLP_USE_BOOST_SUPPORT
     51 endif
     52 
     53 
     54 
     55 # Add STLport 4.6.x tests to $(TARGETS) (if enabled)
     56 ifneq ($(STLPORT46_ROOT_DIR),)
     57 TARGETS += test_stlport46 test_stlport46d
     58 endif
     59 
     60 # Add STLport 5.0.x tests to $(TARGETS) (if enabled)
     61 ifneq ($(STLPORT50_ROOT_DIR),)
     62 TARGETS += test_stlport50 test_stlport50d
     63 endif
     64 
     65 # Add STLport 5.1.x tests to $(TARGETS) (if enabled)
     66 ifneq ($(STLPORT51_ROOT_DIR),)
     67 TARGETS += test_stlport51 test_stlport51d
     68 endif
     69 
     70 # Add STLport 5.2.x tests to $(TARGETS) (if enabled)
     71 ifneq ($(STLPORT52_ROOT_DIR),)
     72 TARGETS += test_stlport52 test_stlport52d
     73 endif
     74 
     75 
     76 
     77 default: run
     78 ifeq ($(TARGETS),)
     79 	@echo "You need to configure the STLport directory at the start of the Makefile."
     80 endif
     81 
     82 run: build
     83 ifneq ($(TARGETS),)
     84 	for TARGET in $(TARGETS); do \
     85 	  echo "Running test for $$TARGET"; \
     86 	  $(GDB) -batch -x script ./$$TARGET; \
     87 	done
     88 endif
     89 
     90 build: $(TARGETS)
     91 
     92 test_stlport46: test.cpp Makefile
     93 	$(CXX) -o $@ $< -g $(STLPORT46_FLAGS) -lstlport_gcc
     94 
     95 test_stlport46d: test.cpp Makefile
     96 	$(CXX) -o $@ $< -g $(STLPORT46_FLAGS) -lstlport_gcc_stldebug -D_STLP_DEBUG
     97 
     98 test_stlport50: test.cpp Makefile
     99 	$(CXX) -o $@ $< -g $(STLPORT50_FLAGS) -lstlport
    100 
    101 test_stlport50d: test.cpp Makefile
    102 	$(CXX) -o $@ $< -g $(STLPORT50_FLAGS) -lstlportstlg -D_STLP_DEBUG
    103 
    104 test_stlport51: test.cpp Makefile
    105 	$(CXX) -o $@ $< -g $(STLPORT51_FLAGS) -lstlport
    106 
    107 test_stlport51d: test.cpp Makefile
    108 	$(CXX) -o $@ $< -g $(STLPORT51_FLAGS) -lstlportstlg -D_STLP_DEBUG
    109 
    110 test_stlport52: test.cpp Makefile
    111 	$(CXX) -o $@ $< -g $(STLPORT52_FLAGS) -lstlport
    112 
    113 test_stlport52d: test.cpp Makefile
    114 	$(CXX) -o $@ $< -g $(STLPORT52_FLAGS) -lstlportstlg -D_STLP_DEBUG
    115 
    116 clean:
    117 	rm -f test_stlport*
    118