Home | History | Annotate | Download | only in eh
      1 #
      2 # This requires GNU make.
      3 #
      4 
      5 srcdir = .
      6 VPATH = .
      7 SHELL = /bin/sh
      8 
      9 # point this to proper location
     10 STL_INCL = -I../../stlport
     11 
     12 AUX_LIST = TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
     13 
     14 TEST_LIST = test_algo.cpp  \
     15 	test_algobase.cpp test_list.cpp test_slist.cpp \
     16 	test_bit_vector.cpp test_vector.cpp \
     17 	test_deque.cpp test_set.cpp test_map.cpp \
     18 	test_hash_map.cpp  test_hash_set.cpp test_rope.cpp \
     19 	test_string.cpp test_bitset.cpp test_valarray.cpp
     20 
     21 LIST = ${AUX_LIST} ${TEST_LIST}
     22 
     23 OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
     24 D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
     25 NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
     26 
     27 EXECS = $(LIST:%.cpp=%)
     28 TESTS = $(LIST:%.cpp=%.out)
     29 TEST_EXE  = ./eh_test
     30 D_TEST_EXE = ./eh_test_d
     31 NOSGI_TEST_EXE = ./eh_test_nosgi
     32 
     33 TEST  = ./eh_test.out
     34 D_TEST = ./eh_test_d.out
     35 NOSGI_TEST = ./eh_test_nosgi.out
     36 
     37 CC = gcc
     38 CXX = g++
     39 
     40 CXXFLAGS = -s -noixemul -m68020 -Wall -O2 ${STL_INCL} -I. -DEH_VECTOR_OPERATOR_NEW
     41 D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
     42 NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
     43 
     44 check: $(TEST)
     45 
     46 LIBS = -lm
     47 D_LIBSTLPORT = -L../../lib -lstlport_gcc_stldebug
     48 LIBSTLPORT = -L../../lib -lstlport_gcc
     49 
     50 all: $(TEST_EXE)
     51 
     52 check_nosgi: $(NOSGI_TEST)
     53 check_d: $(D_TEST)
     54 
     55 
     56 OBJDIR=obj
     57 D_OBJDIR=d_obj
     58 NOSGI_OBJDIR=nosgi_obj
     59 
     60 $(OBJDIR):
     61 	mkdir obj
     62 $(D_OBJDIR):
     63 	mkdir d_obj
     64 $(NOSGI_OBJDIR):
     65 	mkdir nosgi_obj
     66 
     67 $(TEST_EXE) : $(OBJDIR) $(OBJECTS)
     68 	$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
     69 
     70 $(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
     71 	$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
     72 
     73 $(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
     74 	$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
     75 
     76 $(TEST) : $(TEST_EXE)
     77 	$(TEST_EXE) -s 100
     78 
     79 $(D_TEST) : $(D_TEST_EXE)
     80 	LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
     81 
     82 
     83 $(NOSGI_TEST) : $(NOSGI_TEST_EXE)
     84 	$(NOSGI_TEST_EXE)
     85 
     86 SUFFIXES: .cpp.o.exe.out.res
     87 
     88 nosgi_obj/%.o : %.cpp
     89 	$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
     90 
     91 d_obj/%.o : %.cpp
     92 	$(CXX) $(D_CXXFLAGS) $< -c -o $@
     93 
     94 obj/%.o : %.cpp
     95 	$(CXX) $(CXXFLAGS) $< -c -o $@
     96 
     97 nosgi_obj/%.i : %.cpp
     98 	$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
     99 
    100 d_obj/%.i : %.cpp
    101 	$(CXX) $(D_CXXFLAGS) $< -E -H > $@
    102 
    103 obj/%.i : %.cpp
    104 	$(CXX) $(CXXFLAGS) $< -E -H > $@
    105 
    106 %.out: %.cpp
    107 	$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
    108 	$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
    109 	./$* > $@
    110 	-rm -f $*
    111 
    112 %.s: %.cpp
    113 	$(CXX) $(CXXFLAGS) -O4 -S -pto $<  -o $@
    114 
    115 %.E: %.cpp
    116 	$(CXX) $(CXXFLAGS) -E $<  -o $@
    117 
    118 clean:
    119 	-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB
    120