make.defaults 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. #
  2. # The contents of this file are subject to the Mozilla Public
  3. # License Version 1.1 (the "License"); you may not use this file
  4. # except in compliance with the License. You may obtain a copy of
  5. # the License at http://www.mozilla.org/MPL/
  6. # Alternatively, the contents of this file may be used under the
  7. # terms of the GNU General Public License Version 2 or later (the
  8. # "GPL"), in which case the provisions of the GPL are applicable
  9. # instead of those above. You may obtain a copy of the Licence at
  10. # http://www.gnu.org/copyleft/gpl.html
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # Relevant for more details.
  16. #
  17. # This file was created by members of the firebird development team.
  18. # All individual contributions remain the Copyright (C) of those
  19. # individuals. Contributors to this file are either listed here or
  20. # can be obtained from a CVS history command.
  21. #
  22. # All rights reserved.
  23. #
  24. # Created by: Mark O'Donohue <[email protected]>
  25. #
  26. # Contributor(s):
  27. #
  28. #
  29. #
  30. #_____________________________________________________________________________
  31. # This file contains default values that are used by the build process do not
  32. # change these here, but override them in the platform specific file
  33. # prefix.xxx where xxx is the platform name using the form SH := bash
  34. # see the readme file with the Makefile.in files for more details.
  35. #_____________________________________________________________________________
  36. TMP_ROOT=$(ROOT)/temp/$(TARGET)
  37. GEN_ROOT=$(ROOT)/gen
  38. SRC_ROOT=$(ROOT)/src
  39. BLD_ROOT=$(ROOT)/builds
  40. LNG_ROOT=$(ROOT)/lang_helpers
  41. EXA_ROOT=$(ROOT)/examples
  42. IsCross=@IS_CROSS@
  43. TOMMATH_BUILD_FLG=@TOMMATH_BUILD@
  44. TOMCRYPT_BUILD_FLG=@TOMCRYPT_BUILD@
  45. FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird
  46. ifeq ($(IsCross), Y)
  47. FIREBIRD=$(GEN_ROOT)/Native/firebird
  48. else
  49. FIREBIRD=$(FB_BUILD)
  50. endif
  51. FIREBIRD_LOCK=$(FIREBIRD)
  52. export FIREBIRD
  53. export FIREBIRD_LOCK
  54. # Set firebird to boot build mode
  55. FIREBIRD_BOOT_BUILD=1
  56. export FIREBIRD_BOOT_BUILD
  57. LIB=$(FB_BUILD)/lib
  58. BIN=$(FB_BUILD)/bin
  59. PLUGINS=$(FB_BUILD)/plugins
  60. RBIN=$(FIREBIRD)/bin
  61. # This picks up the current directory and maps it to the equivalent module
  62. # in the src and gen area.
  63. RealSrcRootPath = $(shell cd $(SRC_ROOT); pwd)
  64. #ModuleName:=$(notdir $(CURDIR))
  65. ModuleName:=$(subst $(RealSrcRootPath)/,,$(CURDIR))
  66. OBJ=$(TMP_ROOT)
  67. GEN_SRC=$(OBJ)
  68. # avoid generated cpp files deletion
  69. .SECONDARY:
  70. # This one is not so widely used at the momement.
  71. # but I would like it to become so.
  72. RealFirebirdPath = @NEW_FIREBIRD_DIR@
  73. #____________________________________________________________________________
  74. # From here we may set some global options to both compiler and linker.
  75. # Use empty default global options for all compilers and linkers
  76. GLOB_OPTIONS:=
  77. # Possible use - profiling.
  78. #GLOB_OPTIONS:= -pg
  79. #____________________________________________________________________________
  80. # Firebird needs no RTTI
  81. RTTI_FLAG:= -fno-rtti
  82. # If this is defined then we use special rules useful for developers only
  83. IsDeveloper = @DEVEL_FLG@
  84. CpuType=@CPU_TYPE@
  85. PLATFORM=@PLATFORM@
  86. SFIO_EXAMPLES=@SFIO_EXAMPLES@
  87. # link with readline libraries - set by configure
  88. EDITLINE_FLG=@EDITLINE_FLG@
  89. STD_EDITLINE=@STD_EDITLINE@
  90. READLINE=@READLINE@
  91. # threading options - set by configure
  92. THR_FLAGS=@PTHREAD_CFLAGS@
  93. THR_LIBS=@PTHREAD_LIBS@
  94. # thread local storage options - set by configure
  95. TLS_OPTIONS=@TLS_OPTIONS@
  96. # atomic options - set by configure
  97. ATOMIC_OPTIONS=@ATOMIC_OPTIONS@
  98. # compare and swap options - set by configure
  99. # needed at least for solaris inline assembly routines
  100. CAS_OPTIONS=@CAS_OPTIONS@
  101. # multiple-precision integer library
  102. MATHLIB=@MATHLIB@
  103. DECLIB=-ldecFloat$(CROSS)
  104. # crypt library
  105. CRYPTLIB=@CRYPTLIB@
  106. LSB_FLG=@LSB_FLG@
  107. ifeq ($(LSB_FLG), Y)
  108. LSB_UNDEF=-Wl,--allow-shlib-undefined
  109. endif
  110. # switch to make sed edit files inplace
  111. INLINE_EDIT_SED:= -i
  112. # Default programs and tools to be used in the build process
  113. SH= sh -c
  114. RM= rm -f
  115. RM_R= rm -rf
  116. CHMOD= chmod
  117. CHMOD_6= chmod 666
  118. CHMOD_7= chmod 777
  119. CHMOD_S7= chmod 06777
  120. MV= mv -f
  121. TOUCH= touch
  122. CP= cp
  123. ECHO= echo
  124. QUIET_ECHO= @echo
  125. CD= cd
  126. CAT= cat
  127. AR= ar @AR_OPTIONS@
  128. LN= @LN_S@
  129. RANLIB= @RANLIB@
  130. BTYACC=$(ROOT)/extern/btyacc/btyacc
  131. CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
  132. CC = @CC@
  133. CXX = @CXX@
  134. LD = @CXX@
  135. CFLAGS = @CFLAGS@
  136. CXXFLAGS = @CXXFLAGS@
  137. # LINKER COMMANDS
  138. LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
  139. STATICLIB_LINK = $(AR) crus
  140. EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
  141. STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
  142. LINK_LIBS = @LIBS@ $(DECLIB)
  143. SO_LINK_LIBS = @LIBS@ $(DECLIB)
  144. # Default extensions
  145. ARCH_EXT= .a
  146. EXEC_EXT= @EXEEXT@
  147. SHRLIB_EXT=@SHRLIB_EXT@
  148. LIB_PREFIX= lib
  149. SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
  150. #_____________________________________________________________________________
  151. # Include file with version variable definitions
  152. include $(ROOT)/gen/Make.Version
  153. # Add windows dll to library patterns
  154. .LIBPATTERNS += %.dll lib%.dll
  155. # Search path for libraries
  156. vpath %.so $(LIB)
  157. vpath %.a $(LIB)
  158. vpath %.dll $(LIB)
  159. #_____________________________________________________________________________
  160. # From jrd
  161. # The firebird shared library name
  162. # SD: This name is also hard-coded in builds/install/.../linux/classic scripts.
  163. # Scold me, but I don't want library names to be in configure.in
  164. #
  165. #LibraryFileName=libfbclient
  166. LibraryFileName=libfbclient
  167. LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion}
  168. LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.2
  169. LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
  170. LIBFIREBIRD_FULLNAME = $(LIB)/$(LibraryFullName)
  171. LIBFIREBIRD_SONAME = $(LIB)/$(LibraryBaseName)
  172. LIBFIREBIRD_BASENAME = $(LIB)/$(LibrarySoName)
  173. # The firebird engine library name
  174. EngineFileName=libEngine${OdsVersion}
  175. EngineSoName=$(EngineFileName).${SHRLIB_EXT}
  176. ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
  177. # intl will load dynamically, and having the whole soname set with version
  178. # confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
  179. # MOD 28-July-2002
  180. LIBFBINTL_SO = $(FB_BUILD)/intl/$(LIB_PREFIX)fbintl.$(SHRLIB_EXT)
  181. ifeq ($(EDITLINE_FLG),Y)
  182. ifeq ($(STD_EDITLINE), true)
  183. LIBEDITLINE := -l$(READLINE)
  184. else
  185. LIBEDITLINE := $(LIB)/libedit.a
  186. endif
  187. endif
  188. # Shared library name for usage inside of the UDF
  189. IbUtilLibraryName = $(LIB_PREFIX)ib_util.$(SHRLIB_EXT)
  190. LIBIBUTIL_SO = $(LIB)/$(IbUtilLibraryName)
  191. # Own tommath support
  192. TOMMATH=$(ROOT)/extern/libtommath
  193. TOMMATH_INC=$(TOMMATH)
  194. TOMMATH_SO=$(TOMMATH)/.libs/libtommath.so
  195. TOMMATH_VER=0
  196. # Own tomcrypt support
  197. TOMCRYPT=$(ROOT)/extern/libtomcrypt
  198. TOMCRYPT_INC=$(TOMCRYPT)/src/headers
  199. TOMCRYPT_SO=$(TOMCRYPT)/.libs/libtomcrypt.so
  200. TOMCRYPT_VER=0
  201. # LINKER OPTIONS
  202. #
  203. UNDEF_PLATFORM = -Wl,--no-undefined
  204. ifeq ($(TARGET),Debug)
  205. UNDEF_FLAGS = $(UNDEF_PLATFORM)
  206. endif
  207. FIREBIRD_VERS = firebird.vers
  208. FBINTL_VERS = fbintl.vers
  209. IB_UTIL_VERS = ib_util.vers
  210. UDR_PLUGIN_VERS = udr_plugin.vers
  211. EMPTY_VERS = empty.vers
  212. PLUGIN_VERS = fbplugin.vers
  213. ALLVERS = $(FIREBIRD_VERS) $(FBINTL_VERS) $(IB_UTIL_VERS)
  214. ALLVERS += $(UDR_PLUGIN_VERS) $(EMPTY_VERS) $(PLUGIN_VERS)
  215. LINK_FIREBIRD_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FIREBIRD_VERS))
  216. LINK_FBINTL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(FBINTL_VERS))
  217. LINK_IBUTIL_SYMBOLS = $(call LIB_LINK_MAPFILE,$(IB_UTIL_VERS))
  218. LINK_UDR_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(UDR_PLUGIN_VERS))
  219. LINK_EMPTY_SYMBOLS = $(call LIB_LINK_MAPFILE,$(EMPTY_VERS))
  220. LINK_PLUGIN_SYMBOLS = $(call LIB_LINK_MAPFILE,$(PLUGIN_VERS))
  221. LINK_EXEC_EXPORT=-rdynamic
  222. UDR_SUPPORT_LIBS=
  223. LIB_PLATFORM_RPATH = -Wl,-rpath,$(1)
  224. ifeq (@USE_RPATH@,1)
  225. ifeq ($(strip @BINRELOC_CFLAGS@),)
  226. LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@))
  227. else
  228. LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$ORIGIN/../$(1)')
  229. endif
  230. else
  231. LIB_LINK_RPATH =
  232. endif
  233. LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
  234. LIB_LINK_SONAME= -Wl,-soname,$(1)
  235. LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
  236. FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB) $(CRYPTLIB)
  237. EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
  238. LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
  239. FB_DAEMON = $(BIN)/firebird$(EXEC_EXT)
  240. # Per-library link rules
  241. LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) $(UNDEF_FLAGS)\
  242. $(call LIB_LINK_RPATH,lib)
  243. LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util $(SO_LINK_LIBS)
  244. LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  245. $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib)
  246. LINK_IB_UTIL_LIBS = $(THR_LIBS)
  247. LINK_INTL = $(LIB_LINK) $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  248. $(call LIB_LINK_SONAME,libfbintl.$(SHRLIB_EXT).1) $(call LIB_LINK_RPATH,lib)
  249. LINK_INTL_LIBS = -L$(LIB) $(SO_LINK_LIBS) $(FIREBIRD_LIBRARY_LINK)
  250. LINK_TRACE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\
  251. $(call LIB_LINK_SONAME,$(LIB_PREFIX)fbtrace.$(SHRLIB_EXT).0) $(call LIB_LINK_RPATH,lib)
  252. LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS)
  253. LINK_FIREBIRD = $(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  254. $(call LIB_LINK_SONAME,$(LibrarySoName)) $(call LIB_LINK_RPATH,lib)
  255. LINK_FIREBIRD_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(MATHLIB) $(CRYPTLIB)
  256. LINK_ENGINE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\
  257. $(call LIB_LINK_SONAME,$(EngineSoName)) $(call LIB_LINK_RPATH,lib)
  258. LINK_ENGINE_LIBS = $(LINK_FIREBIRD_LIBS) $(FIREBIRD_LIBRARY_LINK)
  259. LINK_UDRENG = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)
  260. LINK_UDRENG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
  261. LINK_PLUGIN = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib) $(UNDEF_FLAGS)
  262. LINK_PLUG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
  263. # Pay attention - we place common library into obj, not lib dir
  264. # It's just a set of object files, prepared to be used by ld, not an output library
  265. COMMON_LIB = $(OBJ)/common.a
  266. # From utilities
  267. CREATE_DB = $(RBIN)/create_db$(EXEC_EXT)
  268. GDS_DROP = $(BIN)/gds_drop$(EXEC_EXT)
  269. FBSVCMGR = $(BIN)/fbsvcmgr$(EXEC_EXT)
  270. FBTRACEMGR = $(BIN)/fbtracemgr$(EXEC_EXT)
  271. GSTAT = $(BIN)/gstat$(EXEC_EXT)
  272. NBACKUP = $(BIN)/nbackup$(EXEC_EXT)
  273. LOCKPRINT = $(BIN)/fb_lock_print$(EXEC_EXT)
  274. GSEC = $(BIN)/gsec$(EXEC_EXT)
  275. GFIX = $(BIN)/gfix$(EXEC_EXT)
  276. RUN_GFIX = $(RBIN)/gfix$(EXEC_EXT)
  277. GDS_REBUILD = $(BIN)/gds_rebuild$(EXEC_EXT)
  278. GDS_INSTALL = $(BIN)/gds_install$(EXEC_EXT)
  279. GDS_INSTALL = $(BIN)/gds_install_service$(EXEC_EXT)
  280. FBGUARD = $(BIN)/fbguard$(EXEC_EXT)
  281. IBGUARD = $(BIN)/ibguard$(EXEC_EXT)
  282. FBMGR_BIN = $(BIN)/fbmgr.bin$(EXEC_EXT)
  283. INSTREG = $(BIN)/instreg$(EXEC_EXT)
  284. INSTSVC = $(BIN)/instsvc$(EXEC_EXT)
  285. SECURITY_FDB = $(FIREBIRD)/security4.fdb
  286. # From qli
  287. QLI = $(BIN)/qli$(EXEC_EXT)
  288. # From isql
  289. ISQL = $(BIN)/isql$(EXEC_EXT)
  290. RUN_ISQL = $(RBIN)/isql$(EXEC_EXT)
  291. # From burp
  292. GBAK = $(BIN)/gbak$(EXEC_EXT)
  293. RUN_GBAK = $(RBIN)/gbak$(EXEC_EXT)
  294. GSPLIT = $(BIN)/gsplit$(EXEC_EXT)
  295. # From gpre
  296. # (gpre current is a link to one of the others)
  297. GPRE_BOOT = $(RBIN)/gpre_boot$(EXEC_EXT)
  298. GPRE = $(BIN)/gpre$(EXEC_EXT)
  299. RUN_GPRE = $(RBIN)/gpre$(EXEC_EXT)
  300. GPRE_CURRENT = $(RBIN)/gpre_current$(EXEC_EXT)
  301. # From msgs
  302. CHECK_MESSAGES = $(BIN)/check_messages$(EXEC_EXT)
  303. BUILD_FILE = $(BIN)/build_file$(EXEC_EXT)
  304. FIREBIRD_MSG = $(FIREBIRD)/firebird.msg
  305. ENTER_MESSAGES = $(BIN)/enter_messages$(EXEC_EXT)
  306. MODIFY_MESSAGES = $(BIN)/modify_messages$(EXEC_EXT)
  307. CHANGE_MESSAGES = $(BIN)/change_messages$(EXEC_EXT)
  308. fr_FR_MSG = $(FIREBIRD)/fr_FR.msg
  309. de_DE_MSG = $(FIREBIRD)/de_DE.msg
  310. ja_JP_MSG = $(FIREBIRD)/ja_JP.msg
  311. #Platform Manager
  312. #For want of a better suggestion we may as well default to posix
  313. PLATFORM_PATH = os/posix
  314. TRACE_OS_Sources =