# =========================================================================
#     This makefile was generated by
#     Bakefile 0.2.9 (http://www.bakefile.org)
#     Do not modify, all changes will be overwritten!
# =========================================================================



# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------

# Compiler flags to link shared library 
LINK_DLL_FLAGS ?= -shared

# C++ compiler 
CXX = g++

# Standard flags for C++ 
CXXFLAGS ?= 

# Standard preprocessor flags (common for CC and CXX) 
CPPFLAGS ?= 

# Standard linker flags 
LDFLAGS ?= 

# Use DLL build of wx library? [0,1]
WX_SHARED ?= 0

# Use Unicode build of wxWidgets? [0,1]
WX_UNICODE ?= 1

# Use debug build of wxWidgets (linked with debug CRT)? [0,1]
WX_DEBUG ?= 1

# Version of the wx library to build against. 
WX_VERSION ?= 28

# Use monolithic build of wxWidgets? [0,1]
WX_MONOLITHIC ?= 0

# The directory where wxWidgets library is installed 
WX_DIR ?= $(WXWIN)

# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= 0

# If 1 then the SQLite library will be loaded dynamically at run time [1,0]
USE_DYNAMIC_SQLITE3_LOAD ?= 0

# If 1 then the SQLite library has to be compiled with meta data support [1,0]
HAVE_METADATA ?= 0

# If 1 then the SQLite library has to be compiled with codec support [1,0]
HAVE_CODEC ?= 0

# If 1 then the SQLite library has to be compiled with loadable extension support [1,0]
HAVE_LOAD_EXTENSION ?= 0

# Folder where the SQLite3 link library is located 
SQLITE3_DIR ?= ..\sqlite3



# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------

### Variables: ###

CPPDEPS = -MT$@ -MF$@.d -MD -MP
COMPILER_PREFIX = gcc
WXSQLITE3_LIB_CXXFLAGS = -DHAVE_W32API_H $(____WX_SHARED) \
	$(__WXUNICODE_DEFINE_p) $(__WXDEBUG_DEFINE_p) -D__WXMSW__ \
	-I$(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX) -I$(WX_DIR)\include $(VAR) \
	$(VAR_1) -W -Wall -I..\include $(__SQLITE3_DYNAMICLOAD_DEF_p) \
	$(__SQLITE3_HAVE_METADATA_DEF_p) $(__SQLITE3_HAVE_CODEC_DEF_p) \
	$(__SQLITE3_HAVE_LOAD_EXTENSION_DEF_p) -I$(SQLITE3_DIR)\include \
	$(CPPFLAGS) $(CXXFLAGS)
WXSQLITE3_LIB_OBJECTS =  \
	gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\wxsqlite3_lib_wxsqlite3.o
WXSQLITE3_DLL_CXXFLAGS = -DHAVE_W32API_H $(____WX_SHARED) \
	$(__WXUNICODE_DEFINE_p) $(__WXDEBUG_DEFINE_p) -D__WXMSW__ \
	-I$(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX) -I$(WX_DIR)\include $(VAR) \
	$(VAR_1) -W -Wall -I..\include -DWXMAKINGDLL_WXSQLITE3 \
	$(__SQLITE3_DYNAMICLOAD_DEF_p) $(__SQLITE3_HAVE_METADATA_DEF_p) \
	$(__SQLITE3_HAVE_CODEC_DEF_p) $(__SQLITE3_HAVE_LOAD_EXTENSION_DEF_p) \
	-I$(SQLITE3_DIR)\include $(CPPFLAGS) $(CXXFLAGS)
WXSQLITE3_DLL_OBJECTS =  \
	gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\wxsqlite3_dll_wxsqlite3.o
MINIMAL_CXXFLAGS = -DHAVE_W32API_H $(____WX_SHARED) $(__WXUNICODE_DEFINE_p) \
	$(__WXDEBUG_DEFINE_p) -D__WXMSW__ \
	-I$(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX) -I$(WX_DIR)\include $(VAR) \
	$(VAR_1) -W -Wall -I..\include -I..\samples -I$(SQLITE3_DIR)\include \
	$(CPPFLAGS) $(CXXFLAGS)
MINIMAL_OBJECTS =  \
	gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\minimal_minimal.o \
	gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\minimal_minimal_rc.o

### Conditionally set variables: ###

ifeq ($(WX_DEBUG),1)
WX3RDPARTYLIBPOSTFIX = d
endif
ifeq ($(SHARED),0)
_BUILDDIR_SHARED_SUFFIX = 
endif
ifeq ($(SHARED),1)
_BUILDDIR_SHARED_SUFFIX = _dll
endif
ifeq ($(SHARED),0)
__wxsqlite3_lib___depname = \
	..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a
endif
ifeq ($(SHARED),1)
__wxsqlite3_dll___depname = \
	..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\wxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.dll
endif
ifeq ($(WX_SHARED),0)
____WX_SHARED_11_p_1 = 
endif
ifeq ($(WX_SHARED),1)
____WX_SHARED_11_p_1 = --define WXUSINGDLL
endif
ifeq ($(WX_UNICODE),1)
__WXUNICODE_DEFINE_p_4 = --define _UNICODE
endif
ifeq ($(WX_DEBUG),1)
__WXDEBUG_DEFINE_p_4 = --define __WXDEBUG__
endif
ifeq ($(SHARED),0)
__COMPONENT_LIB_DEP = $(__wxsqlite3_lib___depname)
endif
ifeq ($(SHARED),1)
__COMPONENT_LIB_DEP = $(__wxsqlite3_dll___depname)
endif
ifeq ($(SHARED),0)
__COMPONENT_LIB_LIBR = \
	..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a
endif
ifeq ($(SHARED),1)
__COMPONENT_LIB_LIBR = \
	..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a
endif
ifeq ($(SHARED),0)
____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES = lib
endif
ifeq ($(SHARED),1)
____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES = dll
endif
ifeq ($(USE_DYNAMIC_SQLITE3_LOAD),0)
__SQLITE3_DYNAMICLOAD_DEF_p = -DwxUSE_DYNAMIC_SQLITE3_LOAD=0
endif
ifeq ($(USE_DYNAMIC_SQLITE3_LOAD),1)
__SQLITE3_DYNAMICLOAD_DEF_p = -DwxUSE_DYNAMIC_SQLITE3_LOAD=1
endif
ifeq ($(HAVE_METADATA),0)
__SQLITE3_HAVE_METADATA_DEF_p = -DWXSQLITE3_HAVE_METADATA=0
endif
ifeq ($(HAVE_METADATA),1)
__SQLITE3_HAVE_METADATA_DEF_p = -DWXSQLITE3_HAVE_METADATA=1
endif
ifeq ($(HAVE_CODEC),0)
__SQLITE3_HAVE_CODEC_DEF_p = -DWXSQLITE3_HAVE_CODEC=0
endif
ifeq ($(HAVE_CODEC),1)
__SQLITE3_HAVE_CODEC_DEF_p = -DWXSQLITE3_HAVE_CODEC=1
endif
ifeq ($(HAVE_LOAD_EXTENSION),0)
__SQLITE3_HAVE_LOAD_EXTENSION_DEF_p = -DWXSQLITE3_HAVE_LOAD_EXTENSION=0
endif
ifeq ($(HAVE_LOAD_EXTENSION),1)
__SQLITE3_HAVE_LOAD_EXTENSION_DEF_p = -DWXSQLITE3_HAVE_LOAD_EXTENSION=1
endif
ifeq ($(WX_SHARED),0)
____WX_SHARED = 
endif
ifeq ($(WX_SHARED),1)
____WX_SHARED = -DWXUSINGDLL
endif
ifeq ($(WX_UNICODE),1)
__WXUNICODE_DEFINE_p = -D_UNICODE
endif
ifeq ($(WX_DEBUG),1)
__WXDEBUG_DEFINE_p = -D__WXDEBUG__
endif
ifeq ($(WX_DEBUG),0)
ifeq ($(WX_UNICODE),1)
WXLIBPOSTFIX = u
endif
endif
ifeq ($(WX_DEBUG),1)
ifeq ($(WX_UNICODE),0)
WXLIBPOSTFIX = d
endif
endif
ifeq ($(WX_DEBUG),1)
ifeq ($(WX_UNICODE),1)
WXLIBPOSTFIX = ud
endif
endif
ifeq ($(WX_DEBUG),0)
VAR = -O2
endif
ifeq ($(WX_DEBUG),1)
VAR = -O0
endif
ifeq ($(WX_SHARED),0)
____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES = lib
endif
ifeq ($(WX_SHARED),1)
____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES = dll
endif
ifeq ($(USE_DYNAMIC_SQLITE3_LOAD),0)
__SQLITE3_DEP_p = -lsqlite3
endif
ifeq ($(WX_MONOLITHIC),0)
__WXLIB_CORE_NAME_p = -lwxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_core
endif
ifeq ($(WX_MONOLITHIC),0)
__WXLIB_BASE_NAME_p = -lwxbase$(WX_VERSION)$(WXLIBPOSTFIX)
endif
ifeq ($(WX_MONOLITHIC),1)
__WXLIB_BASE_NAME_p = -lwxmsw$(WX_VERSION)$(WXLIBPOSTFIX)
endif
ifeq ($(WX_SHARED),0)
WXLIBPATH = \lib\$(COMPILER_PREFIX)_lib
endif
ifeq ($(WX_SHARED),1)
WXLIBPATH = \lib\$(COMPILER_PREFIX)_dll
endif
ifeq ($(WX_DEBUG),0)
VAR_1 = 
endif
ifeq ($(WX_DEBUG),1)
VAR_1 = -g
endif


all: gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)
gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX):
	-if not exist gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX) mkdir gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)

### Targets: ###

all: test_for_selected_wxbuild $(__wxsqlite3_lib___depname) $(__wxsqlite3_dll___depname) ..\samples\minimal.exe

clean: 
	-if exist gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\*.o del gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\*.o
	-if exist gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\*.d del gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\*.d
	-if exist ..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a del ..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a
	-if exist ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\wxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.dll del ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\wxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.dll
	-if exist ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a del ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a
	-if exist ..\samples\minimal.exe del ..\samples\minimal.exe

test_for_selected_wxbuild: 
	@if not exist $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX)\wx\setup.h \
	echo ----------------------------------------------------------------------------
	@if not exist $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX)\wx\setup.h \
	echo The selected wxWidgets build is not available!
	@if not exist $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX)\wx\setup.h \
	echo Please use the options prefixed with WX_ to select another wxWidgets build.
	@if not exist $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX)\wx\setup.h \
	echo ----------------------------------------------------------------------------
	@if not exist $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX)\wx\setup.h \
	exit 1

ifeq ($(SHARED),0)
..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a: make_dir_wxsqlite3_lib  $(WXSQLITE3_LIB_OBJECTS)
	if exist $@ del $@
	ar rcu $@ $(WXSQLITE3_LIB_OBJECTS)
	ranlib $@
endif

make_dir_wxsqlite3_lib: 
	if not exist ..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES) mkdir ..\lib\gcc_$(____wxsqlite3_lib__DIRNAME_SHARED_SUFFIX_FILENAMES)

ifeq ($(SHARED),1)
..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\wxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.dll: make_dir_wxsqlite3_dll  $(WXSQLITE3_DLL_OBJECTS)
	$(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(WXSQLITE3_DLL_OBJECTS)  -mthreads -L$(WX_DIR)$(WXLIBPATH) $(VAR_1) -L..$(WXLIBPATH) -Wl,--out-implib=..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)\libwxcode_msw$(WX_VERSION)$(WXLIBPOSTFIX)_wxsqlite3.a -L$(SQLITE3_DIR)\lib $(LDFLAGS)  $(__SQLITE3_DEP_p) $(__WXLIB_CORE_NAME_p) $(__WXLIB_BASE_NAME_p) -lwxtiff$(WX3RDPARTYLIBPOSTFIX) -lwxjpeg$(WX3RDPARTYLIBPOSTFIX) -lwxpng$(WX3RDPARTYLIBPOSTFIX) -lwxzlib$(WX3RDPARTYLIBPOSTFIX) -lwxregex$(WXLIBPOSTFIX) -lwxexpat$(WX3RDPARTYLIBPOSTFIX) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
endif

make_dir_wxsqlite3_dll: 
	if not exist ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES) mkdir ..\lib\$(COMPILER_PREFIX)_$(____wxsqlite3_dll__DIRNAME_SHARED_SUFFIX_FILENAMES)

..\samples\minimal.exe: $(MINIMAL_OBJECTS) $(__COMPONENT_LIB_DEP) gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\minimal_minimal_rc.o
	$(CXX) -o $@ $(MINIMAL_OBJECTS)  -mthreads -L$(WX_DIR)$(WXLIBPATH) $(VAR_1) -L..$(WXLIBPATH)  -L$(SQLITE3_DIR)\lib $(LDFLAGS)  $(__COMPONENT_LIB_LIBR) $(__SQLITE3_DEP_p) $(__WXLIB_CORE_NAME_p) $(__WXLIB_BASE_NAME_p) -lwxtiff$(WX3RDPARTYLIBPOSTFIX) -lwxjpeg$(WX3RDPARTYLIBPOSTFIX) -lwxpng$(WX3RDPARTYLIBPOSTFIX) -lwxzlib$(WX3RDPARTYLIBPOSTFIX) -lwxregex$(WXLIBPOSTFIX) -lwxexpat$(WX3RDPARTYLIBPOSTFIX) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32

gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\wxsqlite3_lib_wxsqlite3.o: ../src/wxsqlite3.cpp
	$(CXX) -c -o $@ $(WXSQLITE3_LIB_CXXFLAGS) $(CPPDEPS) $<

gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\wxsqlite3_dll_wxsqlite3.o: ../src/wxsqlite3.cpp
	$(CXX) -c -o $@ $(WXSQLITE3_DLL_CXXFLAGS) $(CPPDEPS) $<

gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\minimal_minimal.o: ../samples/minimal.cpp
	$(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $<

gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\minimal_minimal_rc.o: ../samples/minimal.rc
	windres --use-temp-file -i$< -o$@  --define HAVE_W32API_H $(____WX_SHARED_11_p_1) $(__WXUNICODE_DEFINE_p_4) $(__WXDEBUG_DEFINE_p_4) --define __WXMSW__ --include-dir $(WX_DIR)$(WXLIBPATH)\msw$(WXLIBPOSTFIX) --include-dir $(WX_DIR)/include --include-dir ../include --include-dir ../samples --include-dir $(SQLITE3_DIR)\include

.PHONY: all clean


SHELL := $(COMSPEC)

# Dependencies tracking:
-include gccmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)/*.d
