| 1 |
# This library is free software; you can redistribute it and/or |
| 2 |
# modify it under the terms of the GNU Lesser General Public |
| 3 |
# License as published by the Free Software Foundation; either |
| 4 |
# version 2.1 of the License, or (at your option) any later version. |
| 5 |
# You may obtain a copy of the Licence at |
| 6 |
# http://www.gnu.org/licences/lgpl.html |
| 7 |
# |
| 8 |
# As a special exception this file can also be included in modules |
| 9 |
# with other source code as long as that source code has been |
| 10 |
# released under an Open Source Initiative certificed licence. |
| 11 |
# More information about OSI certification can be found at: |
| 12 |
# http://www.opensource.org |
| 13 |
# |
| 14 |
# This module is distributed in the hope that it will be useful, |
| 15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
# GNU Lesser General Public Licence for more details. |
| 18 |
# |
| 19 |
# This module was created by members of the firebird development |
| 20 |
# team. All individual contributions remain the Copyright (C) of |
| 21 |
# those individuals and all rights are reserved. Contributors to |
| 22 |
# this file are either listed below or can be obtained from a CVS |
| 23 |
# history command. |
| 24 |
# |
| 25 |
# Created by: Mark O'Donohue <[email protected]> |
| 26 |
# |
| 27 |
# Contributor(s): |
| 28 |
# |
| 29 |
ROOT=.. |
| 30 |
|
| 31 |
include $(ROOT)/gen/make.defaults |
| 32 |
include $(ROOT)/gen/make.platform |
| 33 |
include $(ROOT)/gen/make.rules |
| 34 |
include $(ROOT)/gen/make.shared.variables |
| 35 |
|
| 36 |
|
| 37 |
FirebirdInstallPrefix=@prefix@ |
| 38 |
|
| 39 |
@SET_MAKE@ |
| 40 |
|
| 41 |
FIREBIRD=$(FirebirdInstallPrefix) |
| 42 |
|
| 43 |
export -n FIREBIRD |
| 44 |
export -n INTERBASE |
| 45 |
|
| 46 |
.PHONY: install install-embedded dist packages depotfile tarfile |
| 47 |
.PHONY: buildDepot buildTarDir buildImageDir buildRoot buildDebugInfo |
| 48 |
|
| 49 |
# Some of these targets are run from the root tree of the build. |
| 50 |
# those need to know where the install subdirectory is kept. |
| 51 |
# Others are run locally these need to know the path back to the |
| 52 |
# root of the build tree. |
| 53 |
|
| 54 |
BuildRoot=$(GEN_ROOT) |
| 55 |
InstallRoot=. |
| 56 |
FirebirdBuildPrefix=$(GEN_ROOT) |
| 57 |
|
| 58 |
#export FirebirdBuildPrefix |
| 59 |
#export FirebirdInstallPrefix |
| 60 |
#export PackageVersion |
| 61 |
|
| 62 |
BuildVersion=$(FirebirdVersion).$(BuildNum) |
| 63 |
Version=$(BuildVersion)-$(PackageVersion) |
| 64 |
|
| 65 |
# This means something like: FirebirdCS-2.0.0-1.i386.tar |
| 66 |
TarDir= Firebird-$(Version).$(CpuType) |
| 67 |
TarFile=Firebird-$(Version).$(CpuType).tar |
| 68 |
DepotFile=Firebird-$(Version).$(CpuType).depot |
| 69 |
RPMFile=Firebird-$(Version).$(CpuType).rpm |
| 70 |
DebugDir=Firebird-debuginfo-$(Version).$(CpuType) |
| 71 |
DebugFile=Firebird-debuginfo-$(Version).$(CpuType).tar |
| 72 |
|
| 73 |
PkgSrcDir=$(InstallRoot)/$(ArchType) |
| 74 |
ScriptDir=$(GEN_ROOT)/install/scripts/ |
| 75 |
RPMSrcDir=$(GEN_ROOT)/install/scripts |
| 76 |
|
| 77 |
TarInstallDir=$(GEN_ROOT)/install |
| 78 |
|
| 79 |
dist : packages |
| 80 |
|
| 81 |
packages: depotfile tarfile debugfile |
| 82 |
depotfile: $(DepotFile) |
| 83 |
|
| 84 |
tarfile: $(TarFile) |
| 85 |
|
| 86 |
$(TarFile) : buildTarDir |
| 87 |
(cd $(GEN_ROOT); tar -cvf $(TarFile) $(TarDir)) |
| 88 |
|
| 89 |
debugfile: $(DebugFile) |
| 90 |
|
| 91 |
$(DebugFile) : buildImageDir |
| 92 |
(cd $(GEN_ROOT)/$(DebugDir); tar -cvf ../$(DebugFile) *) |
| 93 |
|
| 94 |
# objcopy --add-gnu-debuglink fails with binutils 2.14 or older |
| 95 |
# its failure affects only GDB ability to pick up external debug |
| 96 |
# symbols automatically. We may use eu-strip command from elfutils |
| 97 |
# instead, but it doesn't work or compile with such distros |
| 98 |
# as Mandrake 9.0 not saying about older ones. New binutils |
| 99 |
# seem to compile and work everywhere I tried, but we try to |
| 100 |
# use eu-strip first since it is a part of default Red Hat 9 |
| 101 |
# install and is available in binary form for Mandrake 9.1 and newer. |
| 102 |
# |
| 103 |
# 28-Dec-2003. Nickolay Samofatov |
| 104 |
# |
| 105 |
# Do not use eu-strip any longer because version 0.89/AMD64 shipped with |
| 106 |
# Mandrake 9.2 produces broken debuginfo packages and there is no easy way to |
| 107 |
# detect the breakage. Binutils seem to be more reliable alternative to me. |
| 108 |
# |
| 109 |
# 05-Apr-2004. Nickolay Samofatov |
| 110 |
# |
| 111 |
|
| 112 |
buildRoot: |
| 113 |
(cd $(GEN_ROOT); ./install/makeInstallImage.aix.sh $(MAKECMDGOALS)) |
| 114 |
|
| 115 |
buildDebugInfo: buildRoot |
| 116 |
mkdir -p $(GEN_ROOT)/$(DebugDir) |
| 117 |
for x in `(cd $(GEN_ROOT)/buildroot; find)`; do \ |
| 118 |
FIL=$(GEN_ROOT)/buildroot/$$x; \ |
| 119 |
D_FIL=$(GEN_ROOT)/$(DebugDir)/`dirname $${x}`/.debug/`basename $${x}`.debug; \ |
| 120 |
if [ ! -h $$FIL ] && readelf -h $$FIL > /dev/null 2> /dev/null; then \ |
| 121 |
mkdir -p $(GEN_ROOT)/$(DebugDir)/`dirname $$x`/.debug; \ |
| 122 |
echo Generating external debug info for $$x; \ |
| 123 |
cp $${FIL} $${D_FIL}; \ |
| 124 |
if objcopy --add-gnu-debuglink $${D_FIL} $${FIL}; > /dev/null 2> /dev/null; then \ |
| 125 |
echo Succeeded using objcopy from binutils; \ |
| 126 |
else \ |
| 127 |
echo Failed to set debug link for $${x}; \ |
| 128 |
fi; \ |
| 129 |
echo Stripping unneeded symbols from $${x}; \ |
| 130 |
objcopy --strip-debug --strip-unneeded $${FIL}; \ |
| 131 |
fi; \ |
| 132 |
done |
| 133 |
# Work around GDB 6.0 bug |
| 134 |
mkdir -p $(GEN_ROOT)/$(DebugDir)@libdir@/.debug |
| 135 |
for x in `ls $(GEN_ROOT)/$(DebugDir)@prefix@/lib/.debug`; do \ |
| 136 |
ln -f -s @prefix@/lib/.debug/`basename $$x` $(GEN_ROOT)/$(DebugDir)@libdir@/.debug; \ |
| 137 |
done |
| 138 |
|
| 139 |
# Use this line if you don't want to use separate debug info |
| 140 |
buildImageDir: buildRoot |
| 141 |
#buildImageDir: buildDebugInfo |
| 142 |
|
| 143 |
|
| 144 |
buildTarDir: buildImageDir |
| 145 |
mkdir -p $(GEN_ROOT)/$(TarDir) |
| 146 |
cp -r $(GEN_ROOT)/install/scripts $(GEN_ROOT)/$(TarDir) |
| 147 |
cp -r $(GEN_ROOT)/install/scripts/tarmaininstall.aix.sh $(GEN_ROOT)/$(TarDir)/install.sh |
| 148 |
chmod a+x $(GEN_ROOT)/$(TarDir)/install.sh $(GEN_ROOT)/$(TarDir)/scripts/*sh |
| 149 |
(cd $(GEN_ROOT)/buildroot; rm -f buildroot.tar; tar -cvf buildroot.tar * ) |
| 150 |
(cd $(GEN_ROOT)/buildroot; tar -tvf buildroot.tar > manifest.txt ) |
| 151 |
(cd $(GEN_ROOT)/buildroot; cp buildroot.tar ../$(TarDir)/buildroot.tar ) |
| 152 |
(cd $(GEN_ROOT)/buildroot; cp manifest.txt ../$(TarDir)/manifest.txt ) |
| 153 |
|
| 154 |
install install-embedded: buildTarDir |
| 155 |
# pass command-line goal, e.g. "install-embedded", to shell process |
| 156 |
# "install-embedded" installs without a server process, i.e. embedded mode |
| 157 |
(cd $(GEN_ROOT)/$(TarDir); ./install.sh $(MAKECMDGOALS)) |