##### # # TOra - An Oracle Toolkit for DBA's and developers # Copyright (C) 2003-2005 Quest Software, Inc # Portions Copyright (C) 2005 Other Contributors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; only version 2 of # the License is valid for this program. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception, you have permission to link this program # with the Oracle Client libraries and distribute executables, as long # as you follow the requirements of the GNU GPL in regard to all of the # software in the executable aside from Oracle client libraries. # # Specifically you are not permitted to link this program with the # Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech. # And you are not permitted to distribute binaries compiled against # these libraries without written consent from Quest Software, Inc. # Observe that this does not disallow linking to the Qt Free Edition. # # You may link this product with any GPL'd Qt library such as Qt/Free # # All trademarks belong to their respective owners. # ##### # Sample Makefile for static MacOS X builds # Mac application directory MAC_APP_DIR = tora.app # Mac application contents directory CONTENTS_DIR = $(MAC_APP_DIR)/Contents # Mac binary location DESTDIR = $(CONTENTS_DIR)/MacOS # Mac resources location RSCSDIR = $(CONTENTS_DIR)/Resources # Directory for Qt-based help (as opposed to native MacOS help) HELPDIR = $(RSCSDIR)/help # Additional includes needed to compile program INCLUDES="-I$(QTDIR)/mkspecs/macx-g++" "-I$(ORACLE_HOME)/rdbms/demo" "-I$(ORACLE_HOME)/plsql/public" "-I$(ORACLE_HOME)/rdbms/public" "-I$(ORACLE_HOME)/network/public" "-I$(QTDIR)/include" # C++ Compiler to use GCC="/usr/bin/g++3" # Additional libraries to link with LIBS_GLOB=-framework Carbon -framework QuickTime -lz -framework OpenGL -framework AGL # Standard C++ library STDCPP_SHARED= # Static version of C++ library (Only needed when linking statically STDCPP_STATIC= # Qt library QT_SHARED= # Static Qt library QT_STATIC= -lqt-mt # Path to Qt meta compiler MOC="$(QTDIR)/bin/moc" # Path to Qt interface compiler UIC="$(QTDIR)/bin/uic" # Path to Qt translation compiler LRELEASE="$(QTDIR)/bin/lrelease" # Path to Qt translation update LUPDATE="$(QTDIR)/bin/lupdate" # Additional paths to find libraries LFLAGS="-L$(ORACLE_HOME)/rdbms/lib" "-L$(QTDIR)/lib" # Oracle library ORACLE_SHARED= # Static Oracle libraries ORACLE_STATIC=-lclntst9 # Oracle home path #ORACLE_HOME= # What to compile, can be tora for plugin version, tora-mono for monolithic, tora-static for static version TARGET=tora-static MAC_TARGET = $(DESTDIR)/$(TARGET) # MySQL found MYSQL_FOUND=0 # MySQL library MYSQL_SHARED= # Static MySQL libraries MYSQL_STATIC= # Base directory of KDE installation KDE_BASE= # Additional defines to use while compiling, except for the normal these are available # OTL_ORA9I - Compile for Oracle 9.x # OTL_ORA8I - Compile for Oracle 8.1.x # OTL_ORA8 - Compile for Oracle 8.0.x # OTL_ORA_TIMESTAMP - Include support for timestamps # TO_NEW_CHECK - Disable new version check globally # TO_KDE - Compile as KDE application DEFINES+=-DOTL_ORA9I -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP DEFINES+=-D_REENTRANT -DDEFAULT_PLUGIN_DIR=\"$(INSTALLLIB)/tora\" DEFINES+=-DTOMONOLITHIC DEFINES+=-DQT_THREAD_SUPPORT DEFINES+=-DQT_NO_DEBUG # Where to find perl on your system PERL=/usr/bin/perl # Comment out this line if you want more output from compile .SILENT: # Additional flags set when using only the precompiler. CPPFLAGS_GLOB= # Additional flags to set when linking. LFLAGS_GLOB=-O3 # Additional flags set when compiling. CFLAGS_GLOB=-g -O3 -W -Wall ############################################################################ # # End of configuration part of Makefile # ############################################################################ TITLE=TOra API= \ tochangeconnection.h \ tobackground.h \ tobarchart.h \ toconf.h \ toconnection.h \ todefaultkeywords.h \ toeditwidget.h \ toextract.h \ tofilesize.h \ tohelp.h \ tohelpbrowser.h \ tohighlightedtext.h \ tohtml.h \ tolegendchart.h \ tolinechart.h \ tomain.h \ tomainwindow.kde.h \ tomarkedtext.2.h \ tomarkedtext.h \ tomemoeditor.h \ tonoblockquery.h \ toparamget.h \ topiechart.h \ toqvalue.h \ toreport.h \ toresult.h \ toresultbar.h \ toresultcols.h \ toresultcombo.h \ toresultconstraint.h \ toresultcontent.h \ toresultdepend.h \ toresultfield.h \ toresultindexes.h \ toresultitem.h \ toresultlabel.h \ toresultline.h \ toresultlong.h \ toresultpie.h \ toresultplan.h \ toresultreferences.h \ toresultresources.h \ toresultstats.h \ toresultview.h \ tosgastatement.h \ tosmtp.h \ tosql.h \ tosqlparse.h \ totabwidget.h \ totemplate.h \ totextview.h \ tothread.h \ totool.h \ tovisualize.h \ utils.h SOURCES=\ toabout.cpp \ toaboutui.cpp \ toalert.cpp \ toanalyze.cpp \ tobackground.cpp \ tobackup.cpp \ tobarchart.cpp \ tobrowser.cpp \ tobrowserconstraintui.cpp \ tobrowserfilterui.cpp \ tobrowserindexui.cpp \ tobrowsertableui.cpp \ tochangeconnection.cpp \ tochartalarmui.cpp \ tochartmanager.cpp \ tochartsetupui.cpp \ toconnection.cpp \ tocurrent.cpp \ todatabasesettingui.cpp \ todebug.cpp \ todebugchangeui.cpp \ todebugtext.cpp \ todebugwatch.cpp \ toeditextensiongotoui.cpp \ toeditextensions.cpp \ toeditextensionsetupui.cpp \ toeditwidget.cpp \ toextract.cpp \ tofilesize.cpp \ toglobalsetting.cpp \ toglobalsettingui.cpp \ tohelp.cpp \ tohelpaddfileui.cpp \ tohelpsetupui.cpp \ tohighlightedtext.cpp \ tohtml.cpp \ toinvalid.cpp \ tolegendchart.cpp \ tolinechart.cpp \ tolinechartsetupui.cpp \ tomain.cpp \ tomarkedtext.cpp \ tomemoeditor.cpp \ tomessageui.cpp \ tonewconnection.cpp \ tonewconnectionui.cpp \ tonoblockquery.cpp \ tooracleconnection.cpp \ tooracleextract.cpp \ tooraclepreload.cpp \ tooraclesettingui.cpp \ tooutput.cpp \ toparamget.cpp \ topassword.cpp \ topiechart.cpp \ topreferences.cpp \ topreferencesui.cpp \ toprofiler.cpp \ toproject.cpp \ toqsqlconnection.cpp \ toreport.cpp \ toresult.cpp \ toresultbar.cpp \ toresultcols.cpp \ toresultcombo.cpp \ toresultconstraint.cpp \ toresultcontent.cpp \ toresultcontentfilterui.cpp \ toresultdepend.cpp \ toresultextract.cpp \ toresultfield.cpp \ toresultindexes.cpp \ toresultitem.cpp \ toresultlabel.cpp \ toresultline.cpp \ toresultlistformatui.cpp \ toresultlock.cpp \ toresultlong.cpp \ toresultparam.cpp \ toresultpie.cpp \ toresultplan.cpp \ toresultreferences.cpp \ toresultstats.cpp \ toresultstorage.cpp \ toresultview.cpp \ torollback.cpp \ torollbackdialogui.cpp \ toscript.cpp \ toscriptui.cpp \ tosearchreplace.cpp \ tosearchreplaceui.cpp \ tosecurity.cpp \ tosecurityquotaui.cpp \ tosecurityroleui.cpp \ tosecurityuserui.cpp \ tosession.cpp \ tosgastatement.cpp \ tosgatrace.cpp \ tosmtp.cpp \ tosql.cpp \ tosqledit.cpp \ tosqlparse.cpp \ tostorage.cpp \ tostoragedatafileui.cpp \ tostoragedefinition.cpp \ tostoragedefinitionui.cpp \ tostoragedialogui.cpp \ tostorageprefsui.cpp \ tostoragetablespaceui.cpp \ tosyntaxsetup.cpp \ tosyntaxsetupui.cpp \ totabwidget.cpp \ totemplate.cpp \ totemplateaddfileui.cpp \ totemplateeditui.cpp \ totemplateprovider.cpp \ totemplatesetupui.cpp \ totemporary.cpp \ totextview.cpp \ tothread.cpp \ totool.cpp \ totoolsettingui.cpp \ totuning.cpp \ totuningoverviewui.cpp \ totuningsettingui.cpp \ tovisualize.cpp \ towaitevents.cpp \ toworksheet.cpp \ toworksheetsetupui.cpp \ toworksheetstatistic.cpp \ utils.cpp default: all include $(ORACLE_HOME)/rdbms/lib/env_rdbms.mk TRANSLATIONS=\ tora_se.ts\ tora_fr.ts\ tora_it.ts\ CPPFLAGS=$(CPPFLAGS_GLOB) $(DEFINES) $(INCLUDES) CFLAGS=$(CFLAGS_GLOB) $(INCLUDES) $(DEFINES) OBJECTS=$(filter %.o,$(SOURCES:%.cpp=objs/%.o)) TRANSOBJ=$(filter %.qm,$(TRANSLATIONS:%.ts=%.qm)) DEPENDS=$(filter %.d,$(SOURCES:%.cpp=.depends/%.d)) .depends/main.d vpath %.h $(INCLUDE) .PHONY: all clean fixmod install distclean all: $(MAC_TARGET) lrelease #$(OBJECTS): Makefile Makefile.common .depends/%.d: %.cpp @echo Making dependencies for $< if [ ! -d .depends ] ; then mkdir -p .depends ; fi $(GCC) -MM $(CPPFLAGS) $< > $@.tmp && \ ( sed "s/^\(.*\.\)o\([ :]*\)/objs\/\1o \ $(subst /,\\/,$@)\2/g" < $@.tmp > $@ ; rm -f $@.tmp ) include $(DEPENDS) %.moc: %.h @echo Metacompiling $< $(MOC) -o $@ $< %.cpp %.h: %.ui echo Generating $(<:%.ui=%.cpp) \& $(<:%.ui=%.h) $(UIC) -o $(<:%.ui=%.h) $< $(UIC) -i $(<:%.ui=%.h) -o $(<:%.ui=%.cpp) $< objs/%.o: %.cpp @echo Compiling $< if [ ! -d objs ] ; then mkdir -p objs ; fi $(GCC) $(CFLAGS) -o $@ -c $< %.o : objs/%.o @echo Faulty dependency, forgot the objs/ part $(MAC_TARGET): $(TARGET) \ $(CONTENTS_DIR)/Info.plist \ $(CONTENTS_DIR)/PkgInfo \ $(HELPDIR) \ install-common test -d $(DESTDIR)/ || mkdir -p $(DESTDIR)/ -cp -p $(TARGET) $(DESTDIR)/tora $(CONTENTS_DIR)/PkgInfo: @test -d $(CONTENTS_DIR)/ || mkdir -p $(CONTENTS_DIR)/ -rm -fr $(CONTENTS_DIR)/PkgInfo >/dev/null 2>&1 @echo "APPL????" > $(CONTENTS_DIR)/PkgInfo $(CONTENTS_DIR)/Info.plist: @test -d $(CONTENTS_DIR)/ || mkdir -p $(CONTENTS_DIR)/ -rm -fr $(CONTENTS_DIR)/Info.plist >/dev/null 2>&1 @sed -e "s,@ICON@,application.icns,g" -e "s,@EXECUTABLE@,tora,g" $(QTDIR)/mkspecs/macx-g++/Info.plist.app > $(CONTENTS_DIR)/Info.plist $(HELPDIR): @test -d $(RSCSDIR)/ || mkdir -p $(RSCSDIR)/ -cp -pr help $(RSCSDIR)/ install-common: lrelease @test -d $(RSCSDIR)/ || mkdir -p $(RSCSDIR)/ -cp icons/tora.xpm $(RSCSDIR)/ >/dev/null 2>&1 -cp templates/*.tpl $(RSCSDIR)/ >/dev/null 2>&1 -cp *.qm $(RSCSDIR)/ >/dev/null 2>&1 clean: @echo Cleaning $(TITLE) -rm -rf objs tora tora-static tora-mono >/dev/null 2>&1 -rm -f *~ >/dev/null 2>&1 -rm -f *~ */*~ >/dev/null 2>&1 -rm -f *.bak >/dev/null 2>&1 -rm -rf plugins >/dev/null 2>&1 -rm -rf $(MAC_APP_DIR) -for a in *.ui ; \ do rm -f `$(PERL) -e '$$_=shift(@ARGV); s/\.[^\.]*$$//; print "$$_.h\n$$_.cpp";' $$a`; \ done distclean: clean -rm -rf .depends >/dev/null 2>&1 -rm -rf .xvpics >/dev/null 2>&1 -rm -rf icons/.xvpics >/dev/null 2>&1 -rm -f *.moc qtlegacy/*.moc >/dev/null 2>&1 -rm -f rpmcommon rpmoracle rpmmysql >/dev/null 2>&1 -rm -f \#*\# >/dev/null 2>&1 -rm -f configure.setup >/dev/null 2>&1 # Keyboard shortcuts main.cpp: tora_toad.h tora_toad.h: tora_toad.qm $(PERL) chex.pl < $< > $@ tora_toad.qm: tora_toad.ts $(LRELEASE) $< # Static target, easier to distribute tora-static: $(OBJECTS) main.cpp @echo Linking $@ $(GCC) $(LFLAGS) $(CFLAGS) $(LFLAGS_GLOB) -DTOMONOLITHIC -o $@ \ $(OBJECTS) main.cpp $(QT_STATIC) $(STDCPP_STATIC) \ $(ORACLE_STATIC) $(LIBS_GLOB) $(MYSQL_STATIC) tora.pro: Makefile echo "# Not indended to be used for anything except lupdate" > tora.pro echo 'SOURCES= \' >> tora.pro echo ' main.cpp\' >> tora.pro echo ' toextratranslations.cpp\' >> tora.pro echo " $(SOURCES)" >> tora.pro echo 'TRANSLATIONS=$(TRANSLATIONS)' >> tora.pro lupdate: tora.pro $(LUPDATE) tora.pro lrelease: tora.pro $(TRANSLATIONS) $(LRELEASE) tora.pro