Makefile.inc revision 156
0N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs 98N/A# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A# Use subject to license terms. 0N/A# Permission is hereby granted, free of charge, to any person obtaining a 0N/A# copy of this software and associated documentation files (the 0N/A# "Software"), to deal in the Software without restriction, including 0N/A# without limitation the rights to use, copy, modify, merge, publish, 0N/A# distribute, and/or sell copies of the Software, and to permit persons 0N/A# to whom the Software is furnished to do so, provided that the above 0N/A# copyright notice(s) and this permission notice appear in all copies of 0N/A# the Software and that both the above copyright notice(s) and this 0N/A# permission notice appear in supporting documentation. 0N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 0N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 0N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 0N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 0N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 0N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 0N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 0N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 0N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 0N/A# Except as contained in this notice, the name of a copyright holder 0N/A# shall not be used in advertising or otherwise to promote the sale, use 0N/A# or other dealings in this Software without prior written authorization 0N/A# of the copyright holder. 156N/A# @(#)Makefile.inc 1.76 07/05/15 156N/A# Borrowed from Solaris OS/Net makefile.master: 156N/A# The declaration POUND_SIGN is always '#'. This is needed to get around the 156N/A# make feature that '#' is always a comment delimiter, even when escaped or 156N/A# quoted. The only way of generating this is the :sh macro mechanism. Note 156N/A# however that in general :sh macros should be avoided in makefiles that are 156N/A# widely included into other makefiles, as the resulting shell executions can 156N/A# cause a noticable slowdown in build times. 156N/APOUND_SIGN:sh= echo \\043 156N/A# BUILD_DATE:sh=date +'%e-%B-%Y' 156N/A# BUILD_ID = X11 for Solaris Nevada, built $(BUILD_DATE) 156N/A### Machine architecture macros 156N/A# MACH will be either "sparc" or "i386" 156N/A# ARCH will be either "sun4" or "i386" - mainly used in $(PROTODIR) 156N/AMACH32= $(MACH32_$(MACH)) 156N/AMACH64= $(MACH64_$(MACH)) 0N/A### Default compiler & options 90N/AGCC = /usr/sfw/bin/gcc 70N/ADEFAULT_OPT_CFLAGS = -xO4 -xbuiltin -xlibmil -xprefetch \ 0N/AOPT_CFLAGS = $(DEFAULT_OPT_CFLAGS) 0N/ACFLAGS = -v -mc $(OPT_CFLAGS) $(ARCH_FLAGS) 0N/ALDFLAGS = -z combreloc -z lazyload $(MAPFILES_FOR_ALL) 0N/A### Flags for libraries to meet various Solaris requirements 0N/A# REQUIRED_LDFLAGS are forced on via LD_OPTIONS to override libtool when 0N/A# building libraries. 0N/ALIB_CFLAGS = $(CFLAGS) -D_REENTRANT $(ARCH_LIB_FLAGS) 0N/ALIB_REQUIRED_LDFLAGS = -z text -z defs 0N/ALIB_LDFLAGS = $(LDFLAGS) $(LIB_REQUIRED_LDFLAGS) 47N/APROG_CFLAGS = $(CFLAGS) 17N/APROG_LDFLAGS = $(LDFLAGS) $(MAPFILES_FOR_PROGS) -B direct 0N/A# Linker mapfiles to link with for better performance & security 0N/A# SPARC archicteture requires PLT section in .data be executable, so 0N/A# we can only make .bss, not all of .data no-exec on SPARC 0N/AMAPFILE_DIR = $(TOP)/common/mapfiles/ 0N/AMAPFILE_NOEXBSS = $(MAPFILE_DIR)/map.noexbss 156N/AMAPFILE_NOEXDATA_sparc = $(MAPFILE_NOEXBSS) 156N/AMAPFILE_NOEXDATA_i386 = /usr/lib/ld/map.noexdata 156N/AMAPFILE_NOEXDATA = $(MAPFILE_NOEXDATA_$(MACH)) 0N/AMAPFILES_FOR_ALL = -M /usr/lib/ld/map.pagealign -M $(MAPFILE_NOEXDATA) 0N/AMAPFILES_FOR_PROGS = -M /usr/lib/ld/map.bssalign -M /usr/lib/ld/map.noexstk \ 0N/A### Architecture specific flags 156N/ADEFAULT_ARCH32_FLAGS_sparc = -xarch=v8plus 156N/ADEFAULT_ARCH64_FLAGS_sparc = -xarch=v9 156N/ADEFAULT_ARCH_LIB_FLAGS_sparc = -xregs=no%appl 0N/A# -xregs=no%frameptr is required on x86 when compiling at -xO4 or higher to 0N/A# avoid losing stack frame pointers so you can't get stack traces or debug 156N/ADEFAULT_ARCH32_FLAGS_i386 = -xpentium -xregs=no%frameptr 156N/ADEFAULT_ARCH64_FLAGS_i386 = -xarch=generic64 -xregs=no%frameptr 156N/ADEFAULT_ARCH_LIB_FLAGS_i386 = 156N/AARCH32_FLAGS = $(DEFAULT_ARCH32_FLAGS_$(MACH)) 156N/AARCH64_FLAGS = $(DEFAULT_ARCH64_FLAGS_$(MACH)) 156N/AARCH_LIB_FLAGS = $(DEFAULT_ARCH_LIB_FLAGS_$(MACH)) 90N/ADEFAULT_GCC_CFLAGS = -O3 -fno-omit-frame-pointer -Wall 156N/ADEFAULT_ARCH32_GCC_FLAGS_sparc = -mcpu=ultrasparc -m32 156N/ADEFAULT_ARCH64_GCC_FLAGS_sparc = -mcpu=ultrasparc -m64 156N/ADEFAULT_ARCH32_GCC_FLAGS_i386 = -march=i686 -m32 156N/ADEFAULT_ARCH64_GCC_FLAGS_i386 = -march=opteron -m64 156N/AARCH32_GCC_FLAGS=$(DEFAULT_ARCH32_GCC_FLAGS_$(MACH)) 156N/AARCH64_GCC_FLAGS=$(DEFAULT_ARCH64_GCC_FLAGS_$(MACH)) 90N/A# Need to use -Wl,.. to pass linker flags through gcc 90N/AGCC_LDFLAGS_CMD=echo $(LDFLAGS) | \ 90N/A sed -e
's/-M /-Wl,-M,/g' -e
's/-B /-Wl,-B,/g' 90N/AGCC_LDFLAGS=$(GCC_LDFLAGS_CMD:sh) 90N/AGCC_LIB_LDFLAGS_CMD=echo $(LIB_LDFLAGS) | \ 90N/A sed -e
's/-M /-Wl,-M,/g' -e
's/-B /-Wl,-B,/g' 90N/AGCC_LIB_LDFLAGS=$(GCC_LIB_LDFLAGS_CMD:sh) 90N/AGCC_PROG_LDFLAGS_CMD=echo $(PROG_LDFLAGS) | \ 90N/A sed -e
's/-M /-Wl,-M,/g' -e
's/-B /-Wl,-B,/g' 90N/AGCC_PROG_LDFLAGS=$(GCC_PROG_LDFLAGS_CMD:sh) 156N/ASUBDIR32_sparc = sparcv8 156N/ASUBDIR64_sparc = sparcv9 156N/ASUBDIR32 = $(SUBDIR32_$(MACH)) 156N/ASUBDIR64 = $(SUBDIR64_$(MACH)) 0N/A### Proto directory to install into for packaging 0N/APROTODIR=$(TOP)/../proto-$(ARCH)-svr4 0N/AOW_X11LIB_DIR=$(OW_DIR)/lib/X11 0N/AFONT_DIR=$(OW_X11LIB_DIR)/fonts 0N/ATRUETYPE_DIR=$(FONT_DIR)/TrueType 8N/AX11_INCLUDES_DIR=$(X11_DIR)/include 98N/AX11_DOC_DIR=$(X11_DIR)/share/doc 90N/AX11_LOCALE_DIR=$(X11_DIR)/share/locale 90N/AX11_LC_MESSAGES_DIR=$(X11_LOCALE_DIR)/C/LC_MESSAGES 90N/A# Subdirectory of /usr/X11/lib for X server private libraries 90N/AX11_SERVERLIBS_SUBDIR=/X11/xserver 98N/AX11_SERVERLIBS_DIR=$(X11_DIR)/lib$(X11_SERVERLIBS_SUBDIR) 98N/A# Subdirectory of /usr/X11/lib for X server loadable modules 98N/AX11_SERVERMODS_SUBDIR=/modules 98N/AX11_SERVERMODS_DIR=$(X11_DIR)/lib$(X11_SERVERMODS_SUBDIR) 156N/AMODULE_subdir_i386=$(ARCHLIBSUBDIR) 156N/AMODULE_subdir=$(MODULE_subdir_$(MACH)) 98N/A# Directory used for installing tools used during build but not 98N/A# delivered in packages 0N/ABUILD_DIR_32 = build_32 0N/ABUILD_DIR_64 = build_64 156N/A# Set default build type to 32-bit if not set in module makefile 156N/ABUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN)) 156N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES=32 0N/Aall: $(BUILD_TYPES:%=source_%) $(BUILD_TYPES:%=build_%) 0N/Ainstall: $(BUILD_TYPES:%=install_%) 0N/Aclean: $(BUILD_TYPES:%=clean_%) 0N/Abuild_gen: $(BUILD_TARGETS) 90N/Ainstall_32:: build_32 90N/Ainstall_64:: build_64 0N/A### Unpack source and apply patches 0N/Asource: $(BUILD_TYPES:%=source_%) 0N/Asource_32: $(BUILD_DIR_32)/.unpack_done 0N/Asource_64: $(BUILD_DIR_64)/.unpack_done 0N/AUNPACK_TARGET = $(BUILD_DIR)/.unpack_done 0N/A$(BUILD_DIR_32)/.unpack_done: 0N/A$(BUILD_DIR_64)/.unpack_done: 90N/A -e
's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;' \
90N/A -e
's|Requires.private: .*$$||;' 90N/A# -e 's|^prefix=@prefix@|prefix=\$$\{top_builddir\}@prefix@|' 98N/A @
if [
"x$(SOURCE_TARBALL_NAME)" != "xNONE" ] ; then \ 98N/A if [
"x$(SOURCE_UNCOMPRESS)" =
"x" ] ;
then \
98N/A echo "bzcat $(SOURCE_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )" ; \
98N/A echo "$(SOURCE_UNCOMPRESS) $(SOURCE_TARBALL) | (cd $(BUILD_DIR) ; tar -xf - )" ; \
0N/A @
if [
"x$(SOURCE_PATCHES)" != "x" ] ; then \ 0N/A if [
"$$p" != "x" ] ; then \ 90N/A PATCH_CMD=`
echo $$p |
awk -F,
'{if (NF > 1) FLAGS = $$2; else FLAGS="-p0" ; printf "gpatch -d $(SOURCE_DIR) %s < %s\n", FLAGS, $$1}'` ; \
40N/A @
if [
"x$(SUNTOUCHED_MANPAGES)" != "x" ] ; then \ 40N/A $(SUNTOUCH_MAN_FLAGS) $(SUNTOUCHED_MANPAGES)" ; \
70N/A @
if [
"x$(FIX_PC_FILES)" != "x" ] ; then \ 90N/A $(FIX_PC_OPS) $(FIX_PC_FILES)" ; \
0N/A### Source tarballs & downloading if necessary 0N/ATARBALLDIR=$(TOP)/tarballs 0N/AWGET=/usr/sfw/bin/wget 0N/ASOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME) 24N/AXORG_RELEASES_URL=http://xorg.freedesktop.org/releases/individual 156N/ASF_DOWNLOADS_URL=http://easynews.dl.sourceforge.net/sourceforge 156N/A# Set default download location if not set in module makefile 156N/ASOURCE_URL_DEFAULT = $(SOURCE_URL_SET:yes=$(POUND_SIGN)) 156N/A$(SOURCE_URL_DEFAULT) SOURCE_URL=$(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME) 0N/A if [
! -f $(SOURCE_TARBALL) ] ; then \ 40N/A### Generate mapfiles to limit/version exported symbols in libraries 40N/ASPEC2MAP= /usr/lib/abi/spec2map 40N/ASPECMAP= mapfile.vers.$(LIBNAME) 40N/ASPECFILE= spec/$(LIBNAME).spec 40N/AVERSFILE= spec/versions 40N/A$(BUILD_DIR_32)/$(SPECMAP): $(SPECFILE) $(VERSFILE) 40N/A$(BUILD_DIR_64)/$(SPECMAP): $(SPECFILE) $(VERSFILE) 0N/A### Other tools needed to build 0N/A# Some modules (such as FreeType 2) require GNU make 90N/A# Some modules use lndir to merge in sources from Sun specific directories 90N/ALNDIR=$(PROTODIR)/usr/X11/bin/lndir 98N/ADOCBOOKUTIL_BINDIR=$(PROTODIR)$(TOOLS_DIR)/bin 98N/ADOCBOOK2HTML=$(DOCBOOKUTIL_BINDIR)/dockbook2html 40N/A# Almost everything depends on the headers in xproto 40N/AXPROTO_DEP=$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig/xproto.pc 47N/A### Useful rules for maintaining patch sets 47N/A# regenerate patches against new baseline to reduce messages about hunks 47N/A# having fuzz or offsets when applying patches - new patches will be in new/ 47N/A /^diff -u/ {exit} \ 47N/A |
sed -e
's% \./prev$(SOURCE_DIR)/% %' -e
's% \./tmp-regen$(SOURCE_DIR)/% %' \