# =========================================================================
#     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:
# -------------------------------------------------------------------------

# 'install' program location 
INSTALL ?= install

# Location where the package is installed by 'make install' 
prefix ?= /usr/local

# Destination root (/ is used if empty) 
DESTDIR ?= 

#  
AR ?= ar

#  
RANLIB ?= ranlib

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

# C++ compiler 
CXX = `$(WX_CONFIG) --cxx`

# Standard flags for C++ 
CXXFLAGS ?= 

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

# Standard linker flags 
LDFLAGS ?= 

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

# Location and arguments of wx-config script 
WX_CONFIG ?= wx-config

# Port of the wx library to build against [gtk1,gtk2,msw,x11,motif,mgl,osx_cocoa,osx_carbon,dfb]
WX_PORT ?= $(shell $(WX_CONFIG) --query-toolkit)

# Use DLL build of wx library to use? [0,1]
WX_SHARED ?= $(shell if test -z `$(WX_CONFIG) --query-linkage`; then echo 1; else echo 0; fi)

# Compile Unicode build of wxWidgets? [0,1]
WX_UNICODE ?= $(shell $(WX_CONFIG) --query-chartype | sed 's/unicode/1/;s/ansi/0/')

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

# Build this wxCode component as DLL or as static library? [0,1]
SHARED ?= $(shell if test -z `$(WX_CONFIG) --query-linkage`; then echo 1; else echo 0; fi)

# 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

#  
SQLITE3_DIR ?= 



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

### Variables: ###

CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD -MP
COMPILER_PREFIX = gcc
WX_VERSION_MAJOR = $(shell echo $(WX_VERSION) | cut -c1,1)
WX_VERSION_MINOR = $(shell echo $(WX_VERSION) | cut -c2,2)
WX_CONFIG_FLAGS = $(WX_CONFIG_UNICODE_FLAG) $(WX_CONFIG_SHARED_FLAG) \
	--toolkit=$(WX_PORT) --version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
WXSQLITE3_LIB_CXXFLAGS = $(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 `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` \
	$(CPPFLAGS) $(CXXFLAGS)
WXSQLITE3_LIB_OBJECTS =  \
	gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/wxsqlite3_lib_wxsqlite3.o
WXSQLITE3_LIB_HEADERS =  \
	include/wx/wxsqlite3def.h \
	include/wx/wxsqlite3.h \
	include/wx/wxsqlite3dyn.h \
	include/wx/wxsqlite3opt.h
WXSQLITE3_DLL_CXXFLAGS = $(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 -fPIC -DPIC \
	`$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` $(CPPFLAGS) $(CXXFLAGS)
WXSQLITE3_DLL_OBJECTS =  \
	gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/wxsqlite3_dll_wxsqlite3.o
WXSQLITE3_DLL_HEADERS =  \
	include/wx/wxsqlite3def.h \
	include/wx/wxsqlite3.h \
	include/wx/wxsqlite3dyn.h \
	include/wx/wxsqlite3opt.h
MINIMAL_CXXFLAGS = $(VAR) $(VAR_1) -W -Wall -I../include -I../samples \
	-I$(SQLITE3_DIR)/include `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` \
	$(CPPFLAGS) $(CXXFLAGS)
MINIMAL_OBJECTS =  \
	gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/minimal_minimal.o

### Conditionally set variables: ###

ifeq ($(WX_UNICODE),0)
WX_CONFIG_UNICODE_FLAG = --unicode=no
endif
ifeq ($(WX_UNICODE),1)
WX_CONFIG_UNICODE_FLAG = --unicode=yes
endif
ifeq ($(WX_SHARED),0)
WX_CONFIG_SHARED_FLAG = --static=yes
endif
ifeq ($(WX_SHARED),1)
WX_CONFIG_SHARED_FLAG = --static=no
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)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a
endif
ifeq ($(SHARED),0)
__install_wxsqlite3_lib___depname = install_wxsqlite3_lib
endif
ifeq ($(SHARED),0)
__uninstall_wxsqlite3_lib___depname = uninstall_wxsqlite3_lib
endif
ifeq ($(SHARED),0)
__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX = lib
endif
ifeq ($(SHARED),1)
__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX = dll
endif
ifeq ($(SHARED),0)
__install_wxsqlite3_lib_headers___depname = install_wxsqlite3_lib_headers
endif
ifeq ($(SHARED),0)
__uninstall_wxsqlite3_lib_headers___depname = \
	uninstall_wxsqlite3_lib_headers
endif
ifeq ($(SHARED),1)
__wxsqlite3_dll___depname = \
	../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
endif
ifeq ($(SHARED),1)
__install_wxsqlite3_dll___depname = install_wxsqlite3_dll
endif
ifeq ($(SHARED),1)
__uninstall_wxsqlite3_dll___depname = uninstall_wxsqlite3_dll
endif
ifeq ($(WX_SHARED),0)
__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX = lib
endif
ifeq ($(WX_SHARED),1)
__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX = dll
endif
ifeq ($(SHARED),1)
__install_wxsqlite3_dll_headers___depname = install_wxsqlite3_dll_headers
endif
ifeq ($(SHARED),1)
__uninstall_wxsqlite3_dll_headers___depname = \
	uninstall_wxsqlite3_dll_headers
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)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a
endif
ifeq ($(SHARED),1)
__COMPONENT_LIB_LIBR = \
	../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
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_DEBUG),0)
VAR = -O2
endif
ifeq ($(WX_DEBUG),1)
VAR = -O0
endif
ifeq ($(USE_DYNAMIC_SQLITE3_LOAD),0)
__SQLITE3_DEP_p = -lsqlite3
endif
ifeq ($(WX_DEBUG),0)
VAR_1 = 
endif
ifeq ($(WX_DEBUG),1)
VAR_1 = -g
endif


all: gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)
gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX):
	@mkdir -p gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)

### Targets: ###

all: test_for_selected_wxbuild $(__wxsqlite3_lib___depname) $(__wxsqlite3_dll___depname) ../samples/minimal

install: $(__install_wxsqlite3_lib___depname) $(__install_wxsqlite3_lib_headers___depname) $(__install_wxsqlite3_dll___depname) $(__install_wxsqlite3_dll_headers___depname)

uninstall: $(__uninstall_wxsqlite3_lib___depname) $(__uninstall_wxsqlite3_lib_headers___depname) $(__uninstall_wxsqlite3_dll___depname) $(__uninstall_wxsqlite3_dll_headers___depname)

clean: 
	rm -f gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/*.o
	rm -f gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/*.d
	rm -f ../lib/gcc_$(__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a
	rm -f ../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
	rm -f ../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
	rm -f ../samples/minimal

test_for_selected_wxbuild: 
	@$(WX_CONFIG) $(WX_CONFIG_FLAGS)

ifeq ($(SHARED),0)
../lib/gcc_$(__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a: make_dir_wxsqlite3_lib  $(WXSQLITE3_LIB_OBJECTS)
	rm -f $@
	$(AR) rcu $@ $(WXSQLITE3_LIB_OBJECTS)
	$(RANLIB) $@
endif

ifeq ($(SHARED),0)
install_wxsqlite3_lib: $(__wxsqlite3_lib___depname)
	$(INSTALL) -d $(DESTDIR)$(prefix)/lib
	$(INSTALL) -m 644 ../lib/gcc_$(__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a $(DESTDIR)$(prefix)/lib
endif

ifeq ($(SHARED),0)
uninstall_wxsqlite3_lib: 
	rm -f $(DESTDIR)$(prefix)/lib/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).a
endif

make_dir_wxsqlite3_lib: 
	@mkdir -p ../lib/gcc_$(__wxsqlite3_lib__DIRNAME_SHARED_SUFFIX)

ifeq ($(SHARED),0)
install_wxsqlite3_lib_headers: 
	$(INSTALL) -d $(DESTDIR)$(prefix)
	for f in $(WXSQLITE3_LIB_HEADERS); do \
	if test ! -d $(DESTDIR)$(prefix)/`dirname $$f` ; then \
	$(INSTALL) -d $(DESTDIR)$(prefix)/`dirname $$f`; \
	fi; \
	$(INSTALL) -m 644 ../$$f $(DESTDIR)$(prefix)/$$f; \
	done
endif

ifeq ($(SHARED),0)
uninstall_wxsqlite3_lib_headers: 
	for f in $(WXSQLITE3_LIB_HEADERS); do \
	rm -f $(DESTDIR)$(prefix)/$$f; \
	done
endif

ifeq ($(SHARED),1)
../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so: make_dir_wxsqlite3_dll  $(WXSQLITE3_DLL_OBJECTS)
	$(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(WXSQLITE3_DLL_OBJECTS)  $(VAR_1) -L../lib -L$(SQLITE3_DIR)/lib $(LDFLAGS)  $(__SQLITE3_DEP_p) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs core,base`
endif

ifeq ($(SHARED),1)
install_wxsqlite3_dll: $(__wxsqlite3_dll___depname)
	$(INSTALL) -d $(DESTDIR)$(prefix)/lib
	$(INSTALL) -m 644 ../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so $(DESTDIR)$(prefix)/lib
	install -c ../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so $(DESTDIR)$(prefix)/lib
endif

ifeq ($(SHARED),1)
uninstall_wxsqlite3_dll: 
	rm -f $(DESTDIR)$(prefix)/lib/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
	rm -f $(DESTDIR)$(prefix)/lib/libwxcode_$(WX_PORT)_wxsqlite3-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR).so
endif

make_dir_wxsqlite3_dll: 
	@mkdir -p ../lib/$(COMPILER_PREFIX)_$(__wxsqlite3_dll__DIRNAME_SHARED_SUFFIX)

ifeq ($(SHARED),1)
install_wxsqlite3_dll_headers: 
	$(INSTALL) -d $(DESTDIR)$(prefix)
	for f in $(WXSQLITE3_DLL_HEADERS); do \
	if test ! -d $(DESTDIR)$(prefix)/`dirname $$f` ; then \
	$(INSTALL) -d $(DESTDIR)$(prefix)/`dirname $$f`; \
	fi; \
	$(INSTALL) -m 644 ../$$f $(DESTDIR)$(prefix)/$$f; \
	done
endif

ifeq ($(SHARED),1)
uninstall_wxsqlite3_dll_headers: 
	for f in $(WXSQLITE3_DLL_HEADERS); do \
	rm -f $(DESTDIR)$(prefix)/$$f; \
	done
endif

../samples/minimal: $(MINIMAL_OBJECTS) $(__COMPONENT_LIB_DEP)
	$(CXX) -o $@ $(MINIMAL_OBJECTS)  $(VAR_1) -L../lib  -L$(SQLITE3_DIR)/lib $(LDFLAGS)  $(__COMPONENT_LIB_LIBR) $(__SQLITE3_DEP_p) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs core,base`

gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/wxsqlite3_lib_wxsqlite3.o: ../src/wxsqlite3.cpp
	$(CXX) -c -o $@ $(WXSQLITE3_LIB_CXXFLAGS) $(CPPDEPS) $<

gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/wxsqlite3_dll_wxsqlite3.o: ../src/wxsqlite3.cpp
	$(CXX) -c -o $@ $(WXSQLITE3_DLL_CXXFLAGS) $(CPPDEPS) $<

gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/minimal_minimal.o: ../samples/minimal.cpp
	$(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $<

.PHONY: all install uninstall clean install_wxsqlite3_lib \
	uninstall_wxsqlite3_lib install_wxsqlite3_lib_headers \
	uninstall_wxsqlite3_lib_headers install_wxsqlite3_dll \
	uninstall_wxsqlite3_dll install_wxsqlite3_dll_headers \
	uninstall_wxsqlite3_dll_headers


# Dependencies tracking:
-include gcc$(WX_PORT)$(_BUILDDIR_SHARED_SUFFIX)/*.d
