1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
|
#####
#
# 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.
#
#####
# Perl executable - needed for key transalations generation
PERL=/c/Perl/bin/perl
# Where to create installation bundle
INSTALLDIR=/c/TOra
# What to compile, can be tora for tora-mono for monolithic, tora-static for static version
# (for Windows build these targets seems to have no difference so they better left default)
TARGET=tora
# Additional includes needed to compile program
INCLUDES="-I$(ORACLE_HOME)/oci/include" \
"-I$(QTDIR)/include"
# C++ Compiler to use
GCC=g++
# Additional libraries to link with
LIBS_GLOB=-lwsock32
# Standard C++ library
STDCPP_SHARED=-lstdc++
# Static version of C++ library (Only needed when linking statically
STDCPP_STATIC=
# Qt library
QT_SHARED=-lqt-mt
# Static Qt library
QT_STATIC=
# 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$(QTDIR)/lib" "-Llib"
# Oracle OCI DLL and appropriate export library
OCI_DLL=$(ORACLE_HOME)/bin/oci.dll
OCI_LIB=lib/liboci.a
# Oracle library
ORACLE_SHARED=-loci
# Static Oracle libraries
ORACLE_STATIC=$(STATIC_ORACLETTLIBS)
# MySQL found
MYSQL_FOUND=0
# MySQL library
MYSQL_SHARED=
# Static MySQL libraries
MYSQL_STATIC=
# 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
DEFINES+=-DOTL_ORA8I -DOTL_ORA_TIMESTAMP -DOTL_ANSI_CPP
DEFINES+=-D_REENTRANT
DEFINES+=-DQT_THREAD_SUPPORT
DEFINES+=-DTOMONOLITHIC
DEFINES+=-DWIN32 -D_WIN32
# 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=-O3 -W -Wall -c -mthreads -w
############################################################################
#
# End of configuration part of Makefile
#
############################################################################
TITLE=TOra
API= \
tochangeconnection.h \
tobackground.h \
tobarchart.h \
toconf.h \
toconnection.h \
todatatype.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 \
tobrowserconstraint.cpp \
tobrowserconstraintui.cpp \
tobrowserfilterui.cpp \
tobrowserindex.cpp \
tobrowserindexui.cpp \
tobrowsertable.cpp \
tobrowsertableui.cpp \
tochangeconnection.cpp \
tochartalarmui.cpp \
tochartmanager.cpp \
tochartsetupui.cpp \
toconnection.cpp \
tocurrent.cpp \
todatabasesettingui.cpp \
todatatype.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 \
totableselect.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
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)) objs/main.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 oraclelib
all: $(TARGET)
%.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) $<
plugins/%.tso:
@echo Linking plugin $@
if [ ! -d plugins ] ; then mkdir -p plugins ; fi
$(GCC) -shared $(LFLAGS) $(LFLAGS_GLOB) $(CFLAGS) $(QT_SHARED) -o $@ $^
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
$(OCI_LIB): $(OCI_DLL)
@echo Preparing OCI library $@
if [ ! -d lib ] ; then mkdir -p lib ; fi
pexports -o $< > lib/oci.def
dlltool --def lib/oci.def --output-lib $@
-rm -f lib/oci.def
.depends/%.d: %.cpp
@echo Making dependencies for $<
if [ ! -d .depends ] ; then mkdir -p .depends ; fi
$(GCC) -MM -MG $(CPPFLAGS) $< > $@.tmp && \
( sed "s/^\(.*\.\)o\([ :]*\)/objs\/\1o \
$(subst /,\\/,$@)\2/g" < $@.tmp > $@ ; rm -f $@.tmp )
include $(DEPENDS)
windows/%.o:
@echo Making $<
$(MAKE) -C windows
install-common:
if [ \! -f $(TARGET) ] ; then cp tora $(TARGET) ; fi
mkdir -p $(INSTALLDIR)
mkdir -p $(INSTALLDIR)/help
-cp templates/*.tpl $(INSTALLDIR) >/dev/null 2>&1
-cp -r help/* $(INSTALLDIR)/help >/dev/null 2>&1
-cp *.qm $(INSTALLDIR) >/dev/null 2>&1
install: $(TARGET) install-common
@echo Install $(TARGET) to $(INSTALLDIR)
cp $(TARGET).exe $(INSTALLDIR)
-strip -s $(INSTALLDIR)/$(TARGET).exe >/dev/null 2>&1
install-debug: tora install-common
@echo Install tora with debugging symbols to $(INSTALLDIR)
cp tora.exe $(INSTALLDIR)
uninstall:
@echo Uninstalling from $(INSTALLDIR)
-rm -rf $(INSTALLDIR)
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 lib >/dev/null 2>&1
-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 Makefile >/dev/null 2>&1
-rm -f LICENSE.h >/dev/null 2>&1
-rm -f configure.setup >/dev/null 2>&1
# Specific rule for generation of LICENSE.h file
LICENSE.h: LICENSE.txt
@echo Generating LICENSE.h
@echo 'static char *LicenseText="<PRE>"' > LICENSE.h
$(PERL) -e 'while(<>) { chomp; s/\\/\\\\/; s/\"/\\\"/g; print "\"$$_\\n\"\n"; }' < $< >> $@
@echo '"</PRE>";' >> LICENSE.h
# 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 (oracle is always shared on Windows)
tora-static: $(OCI_LIB) $(OBJECTS) windows/tora.o windows/cregistry.o
@echo Linking $@
$(GCC) $(LFLAGS) $(LFLAGS_GLOB) -mwindows -o $@ $(OBJECTS) windows/tora.o windows/cregistry.o \
$(LIBS_GLOB) $(QT_STATIC) $(ORACLE_SHARED) $(STDCPP_STATIC) $(MYSQL_STATIC)
# The binary for the tora
tora: $(OCI_LIB) $(OBJECTS) windows/tora.o windows/cregistry.o
@echo Linking $@
$(GCC) $(LFLAGS) $(LFLAGS_GLOB) -mwindows -o $@ $(OBJECTS) windows/tora.o windows/cregistry.o \
$(LIBS_GLOB) $(QT_SHARED) $(ORACLE_SHARED) $(STDCPP_SHARED)
|