### Variables: ###
+WX_RELEASE_NODOT = 25
OBJS = \
gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
SETUPHDIR = \
$(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
-TEST_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(GCCFLAGS) -DHAVE_W32API_H \
+TEST_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H \
-D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) \
-I.\..\include -I$(SETUPHDIR) -Wall -I. $(__DLLFLAG_p) $(CPPUNIT_CFLAGS) \
- $(__EXCEPTIONSFLAG_4) $(__EXCEPTIONSFLAG_5) $(CPPFLAGS) $(CXXFLAGS)
+ $(__EXCEPTIONSFLAG) $(__EXCEPTIONSFLAG_0) $(CPPFLAGS) $(CXXFLAGS)
TEST_OBJECTS = \
+ $(OBJS)\test_dummy.o \
$(OBJS)\test_test.o \
- $(OBJS)\test_main.o \
- $(OBJS)\test_formatconverter.o \
- $(OBJS)\test_regex.o \
- $(OBJS)\test_wxregex.o \
- $(OBJS)\test_filesys.o \
+ $(OBJS)\test_archivetest.o \
$(OBJS)\test_arrays.o \
+ $(OBJS)\test_datetimetest.o \
+ $(OBJS)\test_fileconftest.o \
+ $(OBJS)\test_filenametest.o \
+ $(OBJS)\test_filesystest.o \
+ $(OBJS)\test_fontmaptest.o \
+ $(OBJS)\test_formatconvertertest.o \
$(OBJS)\test_hashes.o \
- $(OBJS)\test_longlong.o \
+ $(OBJS)\test_lists.o \
+ $(OBJS)\test_longlongtest.o \
+ $(OBJS)\test_mbconvtest.o \
+ $(OBJS)\test_regextest.o \
+ $(OBJS)\test_wxregextest.o \
$(OBJS)\test_strings.o \
$(OBJS)\test_stdstrings.o \
$(OBJS)\test_unicode.o \
$(OBJS)\test_crt.o \
$(OBJS)\test_bstream.o \
+ $(OBJS)\test_datastreamtest.o \
$(OBJS)\test_ffilestream.o \
$(OBJS)\test_filestream.o \
$(OBJS)\test_memstream.o \
- $(OBJS)\test_zlibstream.o
+ $(OBJS)\test_sstream.o \
+ $(OBJS)\test_textstreamtest.o \
+ $(OBJS)\test_zlibstream.o \
+ $(OBJS)\test_uris.o
+TEST_GUI_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(GCCFLAGS) \
+ -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \
+ $(__UNICODE_DEFINE_p) -I.\..\include -I$(SETUPHDIR) -Wall -I. $(__DLLFLAG_p) \
+ -I.\..\samples -DNOPCH $(CPPUNIT_CFLAGS) $(__EXCEPTIONSFLAG) \
+ $(__EXCEPTIONSFLAG_0) $(CPPFLAGS) $(CXXFLAGS)
+TEST_GUI_OBJECTS = \
+ $(OBJS)\test_gui_sample_rc.o \
+ $(OBJS)\test_gui_dummy.o \
+ $(OBJS)\test_gui_test.o \
+ $(OBJS)\test_gui_rect.o
### Conditionally set variables: ###
ifeq ($(SHARED),1)
WXDLLFLAG = dll
endif
+ifeq ($(MONOLITHIC),0)
+EXTRALIBS_FOR_BASE =
+endif
+ifeq ($(MONOLITHIC),1)
+EXTRALIBS_FOR_BASE =
+endif
+ifeq ($(MONOLITHIC),0)
+__WXLIB_NET_p = \
+ -lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net
+endif
+ifeq ($(USE_GUI),1)
+__test_gui___depname = $(OBJS)\test_gui.exe
+endif
+ifeq ($(WXUNIV),1)
+__WXUNIV_DEFINE_p_3 = --define __WXUNIVERSAL__
+endif
ifeq ($(BUILD),debug)
-__OPTIMIZEFLAG_2 = -O0
+ifeq ($(DEBUG_FLAG),default)
+__DEBUG_DEFINE_p_3 = --define __WXDEBUG__
+endif
+endif
+ifeq ($(DEBUG_FLAG),1)
+__DEBUG_DEFINE_p_3 = --define __WXDEBUG__
+endif
+ifeq ($(UNICODE),1)
+__UNICODE_DEFINE_p_3 = --define _UNICODE
+endif
+ifeq ($(SHARED),1)
+__DLLFLAG_p_3 = --define WXUSINGDLL
+endif
+ifeq ($(MONOLITHIC),0)
+__WXLIB_CORE_p = \
+ -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core
+endif
+ifeq ($(BUILD),debug)
+__OPTIMIZEFLAG = -O0
endif
ifeq ($(BUILD),release)
-__OPTIMIZEFLAG_2 = -O2
+__OPTIMIZEFLAG = -O2
endif
ifeq ($(USE_EXCEPTIONS),0)
-__EXCEPTIONSFLAG_4 = -fno-rtti
+__EXCEPTIONSFLAG = -fno-rtti
endif
ifeq ($(USE_EXCEPTIONS),1)
-__EXCEPTIONSFLAG_4 =
+__EXCEPTIONSFLAG =
endif
ifeq ($(USE_EXCEPTIONS),0)
-__EXCEPTIONSFLAG_5 = -fno-exceptions
+__EXCEPTIONSFLAG_0 = -fno-exceptions
endif
ifeq ($(USE_EXCEPTIONS),1)
-__EXCEPTIONSFLAG_5 =
+__EXCEPTIONSFLAG_0 =
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p = -D_UNICODE
endif
+ifeq ($(SHARED),0)
+LIBDIRNAME = .\..\lib\gcc_lib$(CFG)
+endif
+ifeq ($(SHARED),1)
+LIBDIRNAME = .\..\lib\gcc_dll$(CFG)
+endif
ifeq ($(SHARED),1)
__DLLFLAG_p = -DWXUSINGDLL
endif
ifeq ($(MONOLITHIC),0)
-__WXLIB_BASE_p = -lwxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG)
+__WXLIB_BASE_p = \
+ -lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(MONOLITHIC),1)
__WXLIB_MONO_p = \
- -lwx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG)
+ -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(USE_GUI),1)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
ifeq ($(MSLU),1)
__UNICOWS_LIB_p = -lunicows
endif
-ifeq ($(SHARED),0)
-LIBDIRNAME = .\..\lib\gcc_lib$(CFG)
-endif
-ifeq ($(SHARED),1)
-LIBDIRNAME = .\..\lib\gcc_dll$(CFG)
-endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO = -g
### Targets: ###
-all: $(OBJS)\test.exe data
+all: $(OBJS)\test.exe $(__test_gui___depname) data
clean:
-if exist $(OBJS)\*.o del $(OBJS)\*.o
-if exist $(OBJS)\test.exe del $(OBJS)\test.exe
+ -if exist $(OBJS)\test_gui.exe del $(OBJS)\test_gui.exe
$(OBJS)\test.exe: $(TEST_OBJECTS)
- $(CXX) -o $@ $(TEST_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) -mthreads -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
+ $(CXX) -o $@ $(TEST_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) -mthreads -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
+
+ifeq ($(USE_GUI),1)
+$(OBJS)\test_gui.exe: $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample_rc.o
+ $(CXX) -o $@ $(TEST_GUI_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) -mthreads -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
+endif
data:
if not exist $(OBJS) mkdir $(OBJS)
for %%f in (testdata.fc) do if not exist $(OBJS)\%%f copy .\%%f $(OBJS)
+$(OBJS)\test_dummy.o: ./dummy.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_test.o: ./test.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_main.o: ./mbconv/main.cpp
+$(OBJS)\test_archivetest.o: ./archive/archivetest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_formatconverter.o: ./formatconverter/formatconverter.cpp
+$(OBJS)\test_arrays.o: ./arrays/arrays.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_regex.o: ./regex/regex.cpp
+$(OBJS)\test_datetimetest.o: ./datetime/datetimetest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_wxregex.o: ./regex/wxregex.cpp
+$(OBJS)\test_fileconftest.o: ./fileconf/fileconftest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_filesys.o: ./filesys/filesys.cpp
+$(OBJS)\test_filenametest.o: ./filename/filenametest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_arrays.o: ./arrays/arrays.cpp
+$(OBJS)\test_filesystest.o: ./filesys/filesystest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_fontmaptest.o: ./fontmap/fontmaptest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_formatconvertertest.o: ./formatconverter/formatconvertertest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_hashes.o: ./hashes/hashes.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
-$(OBJS)\test_longlong.o: ./longlong/longlong.cpp
+$(OBJS)\test_lists.o: ./lists/lists.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_longlongtest.o: ./longlong/longlongtest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_mbconvtest.o: ./mbconv/mbconvtest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_regextest.o: ./regex/regextest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_wxregextest.o: ./regex/wxregextest.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_strings.o: ./strings/strings.cpp
$(OBJS)\test_bstream.o: ./streams/bstream.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_datastreamtest.o: ./streams/datastreamtest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_ffilestream.o: ./streams/ffilestream.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_memstream.o: ./streams/memstream.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_sstream.o: ./streams/sstream.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_textstreamtest.o: ./streams/textstreamtest.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
$(OBJS)\test_zlibstream.o: ./streams/zlibstream.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+$(OBJS)\test_uris.o: ./uris/uris.cpp
+ $(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
+
+$(OBJS)\test_gui_sample_rc.o: ./../samples/sample.rc
+ windres --use-temp-file -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_3) $(__DEBUG_DEFINE_p_3) $(__UNICODE_DEFINE_p_3) --include-dir ./../include --include-dir $(SETUPHDIR) --include-dir . $(__DLLFLAG_p_3) --include-dir ./../samples
+
+$(OBJS)\test_gui_dummy.o: ./dummy.cpp
+ $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $<
+
+$(OBJS)\test_gui_test.o: ./test.cpp
+ $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $<
+
+$(OBJS)\test_gui_rect.o: ./geometry/rect.cpp
+ $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $<
+
.PHONY: all clean data