-#
-# File: makefile.unx
-# Author: Terry Tompkins
-# Created: 1998
-# Updated:
-# Copyright: (c) 1998, Remstar International
-#
-# Makefile for wxDB (UNIX).
+# =========================================================================
+# This makefile was generated by
+# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
+# Do not modify, all changes will be overwritten!
+# =========================================================================
-OBJDIR=database
-OBJSUFF=.o
-SRCSUFF=.cpp
-WXDIR = $(WXWIN)
-# All common UNIX compiler flags and options are now in
-# this central makefile.
-include $(WXDIR)/src/make.env
-PROGRAM=database
+# -------------------------------------------------------------------------
+# These are configurable options:
+# -------------------------------------------------------------------------
-OBJECTS = $(OBJDIR)/$(PROGRAM).$(OBJSUFF) $(OBJDIR)/table.$(OBJSUFF) $(OBJDIR)/db.$(OBJSUFF) $(OBJDIR)/listdb.$(OBJSUFF)
+# C++ compiler
+CXX = g++
-.SUFFIXES:
+# Standard flags for C++
+CXXFLAGS =
-all: $(OBJDIR) $(PROGRAM)$(GUISUFFIX)
+# Standard preprocessor flags (common for CC and CXX)
+CPPFLAGS =
-wx:
+# Standard linker flags
+LDFLAGS =
+# Location and arguments of wx-config script
+WX_CONFIG = wx-config
-motif:
- $(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' WXLIB=$(WXDIR)/lib/libwx_motif.a OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
+# Port of the wx library to build against [gtk1,gtk2,msw,x11,motif,mgl,mac,$(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 1)]
+WX_PORT = $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 1)
-xview:
- cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
- $(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)'
+# Use DLL build of wx library to use? [0,1,$(shell if test -z `$(WX_CONFIG) --selected-config | cut -d '-' -f 5`; then echo 1; else echo 0; fi)]
+WX_SHARED = $(shell if test -z `$(WX_CONFIG) --selected-config | cut -d '-' -f 5`; then echo 1; else echo 0; fi)
-hp:
- cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx hp
- $(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' WARN='-w' \
- XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)'
+# Compile Unicode build of wxWidgets? [0,1,$(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 2 | sed 's/unicode/1/;s/ansi/0/')]
+WX_UNICODE = $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 2 | sed 's/unicode/1/;s/ansi/0/')
-$(OBJDIR):
- mkdir $(OBJDIR)
+# Use debug build of wxWidgets (define __WXDEBUG__)? [0,1,$(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 3 | sed 's/debug/1/;s/release/0/')]
+WX_DEBUG = $(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 3 | sed 's/debug/1/;s/release/0/')
-$(PROGRAM)$(GUISUFFIX): $(DUMMYOBJ) $(DBLIBS) $(OBJECTS) $(WXLIB)
- $(CC) $(LDFLAGS) -o $(PROGRAM)$(GUISUFFIX) $(OBJECTS) $(XVIEW_LINK) $(LDLIBS)
+# Version of the wx library to build against.
+WX_VERSION = $(shell $(WX_CONFIG) --selected-config | sed -e 's/.*-\([0-9]*\)\.\([0-9]*\)$$/\1\2/')
-$(OBJDIR)/$(PROGRAM).$(OBJSUFF): $(PROGRAM).$(SRCSUFF)
- $(CC) -c $(CPPFLAGS) -o $@ $(PROGRAM).$(SRCSUFF)
-$(OBJDIR)/table.$(OBJSUFF): table.$(SRCSUFF)
- $(CC) -c $(CPPFLAGS) -o $@ table.$(SRCSUFF)
-$(OBJDIR)/db.$(OBJSUFF): db.$(SRCSUFF)
- $(CC) -c $(CPPFLAGS) -o $@ db.$(SRCSUFF)
+# -------------------------------------------------------------------------
+# Do not modify the rest of this file!
+# -------------------------------------------------------------------------
-$(OBJDIR)/listdb.$(OBJSUFF): listdb.$(SRCSUFF)
- $(CC) -c $(CPPFLAGS) -o $@ listdb.$(SRCSUFF)
+### Variables: ###
-clean_motif:
- $(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany
+CPPDEPS = -MT$@ -MF`echo $@ | sed -e 's,\.o$$,.d,'` -MD
+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_DEBUG_FLAG) $(WX_CONFIG_UNICODE_FLAG) \
+ $(WX_CONFIG_SHARED_FLAG) --toolkit=$(WX_PORT) \
+ --version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
+DBTEST_CXXFLAGS = -I. `$(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` $(CPPFLAGS) \
+ $(CXXFLAGS)
+DBTEST_OBJECTS = \
+ dbtest_dbtest.o \
+ dbtest_listdb.o
-clean_ol:
- $(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany
+### Conditionally set variables: ###
-clean_hp:
- $(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany
+ifeq ($(WX_DEBUG),0)
+WX_CONFIG_DEBUG_FLAG = --debug=no
+endif
+ifeq ($(WX_DEBUG),1)
+WX_CONFIG_DEBUG_FLAG = --debug=yes
+endif
+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
-cleanany:
- rm -f $(OBJECTS) $(PROGRAM)$(GUISUFFIX) core
+### Targets: ###
+
+all: test_for_selected_wxbuild dbtest
+
+install: all
+
+uninstall:
+
+clean:
+ rm -f ./*.o
+ rm -f ./*.d
+ rm -f dbtest
+
+test_for_selected_wxbuild:
+ @$(WX_CONFIG) $(WX_CONFIG_FLAGS)
+
+dbtest: $(DBTEST_OBJECTS)
+ $(CXX) -o $@ $(DBTEST_OBJECTS) $(LDFLAGS) `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs dbgrid,odbc,adv,html,xml,core,base`
+
+dbtest_dbtest.o: ./dbtest.cpp
+ $(CXX) -c -o $@ $(DBTEST_CXXFLAGS) $(CPPDEPS) $<
+
+dbtest_listdb.o: ./listdb.cpp
+ $(CXX) -c -o $@ $(DBTEST_CXXFLAGS) $(CPPDEPS) $<
+
+.PHONY: all install uninstall clean
+
+
+# Dependencies tracking:
+-include ./*.d