open-src/common/Makefile.inc
author Niveditha Rau <Niveditha.Rau@Oracle.COM>
Sat, 27 Jun 2015 08:52:19 -0700
changeset 1549 4b5a9782609e
parent 1536 9169c528bff2
child 1551 73fac33fe172
permissions -rw-r--r--
21256857 Update Xorg to the latest community version 1.17.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     1
# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     2
#
1494
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1466
diff changeset
     3
# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     4
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     5
# Permission is hereby granted, free of charge, to any person obtaining a
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
     6
# copy of this software and associated documentation files (the "Software"),
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
     7
# to deal in the Software without restriction, including without limitation
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
     8
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
     9
# and/or sell copies of the Software, and to permit persons to whom the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    10
# Software is furnished to do so, subject to the following conditions:
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    11
#
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    12
# The above copyright notice and this permission notice (including the next
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    13
# paragraph) shall be included in all copies or substantial portions of the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    14
# Software.
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    15
#
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    17
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    18
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    19
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    21
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    22
# DEALINGS IN THE SOFTWARE.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    23
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    24
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    25
1494
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1466
diff changeset
    26
TOP:sh=hg root
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    27
1494
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1466
diff changeset
    28
### For compatibility, include Makefile.defs
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1466
diff changeset
    29
include $(TOP)/open-src/common/Makefile.defs
1418
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
    30
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    31
all: $(BUILD_TYPES:%=build_%)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    32
all_%: build_%
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
1097
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    34
# We always want to clean 32 & 64 bit subdirs, plus any special ones
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    35
# But if we just add clean_32 & clean_64, then make complains when they
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    36
# end up having multiple targets, so we remove them if they're in the list
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    37
# generated from $(BUILD_TYPES)
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    38
CLEAN_RULES_1 = $(BUILD_TYPES:%=clean_%)
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    39
CLEAN_RULES_2 = $(CLEAN_RULES_1:clean_32=)
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    40
CLEAN_RULES_3 = $(CLEAN_RULES_2:clean_64=)
243d7ed7a10c 6991718 Removal of 32-bit X servers [PSARC/2010/382]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1088
diff changeset
    41
CLEAN_RULES =  clean_32 clean_64 $(CLEAN_RULES_3)
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    42
clean: $(CLEAN_RULES)
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    43
.PARALLEL: $(CLEAN_RULES) clobber
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    44
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    45
# Remove directories with both styles of naming
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    46
$(CLEAN_RULES):
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
    47
	-rm -rf $(BUILD_DIR_$(@:clean_%=%)) $(@:clean_%=build_%) $(@:clean_%=build-%)
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    48
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    49
clobber: clean
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    50
	-rm -rf $(SOURCE_DIR)
822
2a89ea3c59be 6898535 Upgrade VNC from RealVNC 4.1.3 to TigerVNC 1.0 [PSARC/2009/592]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 810
diff changeset
    51
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    52
# Tell dmake not to remove and create source in parallel
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    53
.NOPARALLEL: clobber source
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    54
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    55
# Rules for steps repeated for each build type
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    56
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    57
CONFIGURE_RULES = $(BUILD_TYPES:%=configure_%)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    58
configure: $(CONFIGURE_RULES)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    59
.PARALLEL: $(CONFIGURE_RULES)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    60
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    61
configure-gen: source $(CONFIGURE_TARGETS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    62
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
    63
$(CONFIGURE_RULES): $(SOURCE_TARGETS)
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    64
	$(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:configure_%=%)" \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    65
	 $(BUILD_$(@:configure_%=%)_FLAGS) configure-gen
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    66
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    67
BUILD_RULES = $(BUILD_TYPES:%=build_%)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    68
build: $(BUILD_RULES)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    69
.PARALLEL: $(BUILD_RULES)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    70
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    71
build-gen: configure-gen $(BUILD_TARGETS)
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    72
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    73
$(BUILD_RULES):
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    74
	$(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:build_%=%)" \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    75
	 $(BUILD_$(@:build_%=%)_FLAGS) build-gen
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    76
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    77
INSTALL_RULES = $(BUILD_TYPES:%=install_%)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    78
install: $(INSTALL_RULES)
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
    79
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    80
install-gen: build-gen $(INSTALL_TARGETS) install_metadata 
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    81
install-gen: install_pkgconfig_uninstalled install_X11_compat_links
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    82
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    83
$(INSTALL_RULES):
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    84
	$(MAKE) $(MAKEFLAGS) BUILD_TYPE="$(@:install_%=%)" \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    85
	 $(BUILD_$(@:install_%=%)_FLAGS) install-gen
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    86
963
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
    87
$(PROTODIR)$(MODULE_DOC_DIR):
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
    88
	mkdir -p $@
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
    89
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    90
DEBUG_BUILD_FLAGS = BUILD_DEBUG=yes
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    91
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    92
# Allow adding "debug-" prefix to rules like build_32, install, etc.
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    93
debug-%:
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    94
	$(MAKE) $(MAKEFLAGS) $(@:debug-%=%) $(DEBUG_BUILD_FLAGS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    95
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    96
# Allow debug_XX to run "make all_XX" with debug flags (including without _XX)
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    97
debug%:
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
    98
	$(MAKE) $(MAKEFLAGS) $(@:debug%=all%) $(DEBUG_BUILD_FLAGS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
    99
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   100
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   101
### Source tarballs & downloading if necessary
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   102
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   103
SOURCE_TARBALL=$(TARBALLDIR)/$(SOURCE_TARBALL_NAME)
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   104
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   105
# Allow downloading from local archive/mirror
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   106
# TARBALL_ARCHIVE is now set in Makefile.options
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   107
ARCHIVE_URL=$(TARBALL_ARCHIVE)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   108
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   109
GIT_CLONE_DIR=$(MODULE_NAME)-git
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   110
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   111
# Download if SOURCE_TARBALL_NAME is not set to NONE and the file either
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   112
# doesn't exist or is empty
705
24ca414edbff 6826940 Xorg server 1.6.1, Mesa 7.4.1, and associated module upgrades [PSARC 2009/292]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 606
diff changeset
   113
# If MODULE_VERSION is git, checkout source from git repo instead of
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   114
# a tarball
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   115
download: $(SOURCE_TARBALL)
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   116
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   117
$(SOURCE_TARBALL): $(TARBALLDIR)
1061
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   118
	@case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   119
	if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   120
	    if [[ ! -d $(GIT_CLONE_DIR) ]] ; then \
1061
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   121
		$(START_CMD_ECHO) ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   122
		$(GIT) clone $(GIT_URL) $(GIT_CLONE_DIR) ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   123
		if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   124
		    cd $(GIT_CLONE_DIR) && $(GIT) checkout $(GIT_BRANCH) ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   125
		fi ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   126
	    fi ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   127
	else \
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   128
	    if [[ "$(SOURCE_TARBALL_NAME)" == "NONE" ]] ; then \
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   129
		touch "$(SOURCE_TARBALL)" ; \
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   130
	    else \
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   131
		if [[ ! -z "$(TARBALL_ARCHIVE)" ]] ; then \
1061
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   132
		    URL='$(ARCHIVE_URL)' ; \
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   133
		else \
1061
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   134
		    URL='$(SOURCE_URL)' ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   135
		fi ; \
1061
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   136
		$(START_CMD_ECHO) ; \
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   137
		$(WGET) -O '$(SOURCE_TARBALL)' "$${URL}" || \
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   138
		    ( status=$$? ; rm -f '$(SOURCE_TARBALL)' ; \
017c158a2f25 7010818 make download in the X gate should not leave empty files when it fails
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1056
diff changeset
   139
		      exit $${status} ) ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   140
	    fi ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   141
	fi
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   142
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   143
CHECKSUM_TARGET = .checksum_done.$(MODULE_VERSION)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   144
check-checksums: $(CHECKSUM_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   145
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   146
$(CHECKSUM_TARGET): $(SOURCE_TARBALL)
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   147
	@case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   148
	if [[ "$(MODULE_VERSION)" != "git" && \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   149
	      "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   150
	    ACTUAL_MD5="$$(digest -a md5 $(SOURCE_TARBALL))" ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   151
	    if [[ "$${ACTUAL_MD5}" != "${TARBALL_MD5}" ]] ; then \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   152
		print -u2 "ERROR: MD5 sum mismatch on ${SOURCE_TARBALL}\n" \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   153
			"$${ACTUAL_MD5} != ${TARBALL_MD5}" ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   154
		exit 1; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   155
	    fi ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   156
	    ACTUAL_SHA1="$$(digest -a sha1 ${SOURCE_TARBALL})" ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   157
	    if [[ "$${ACTUAL_SHA1}" != "${TARBALL_SHA1}" ]] ; then \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   158
		print -u2 "ERROR: SHA1 sum mismatch on ${SOURCE_TARBALL}\n" \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   159
			"$${ACTUAL_SHA1} != ${TARBALL_SHA1}" ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   160
		exit 1; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   161
	    fi ; \
1179
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   162
	    if [[ -n "${TARBALL_SHA256}" ]] ; then \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   163
		ACTUAL_SHA256="$$(digest -a sha256 ${SOURCE_TARBALL})" ; \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   164
	    	if [[ "$${ACTUAL_SHA256}" != "${TARBALL_SHA256}" ]] ; then \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   165
			print -u2 \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   166
			  "ERROR: SHA256 sum mismatch on ${SOURCE_TARBALL}\n" \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   167
			  "$${ACTUAL_SHA256} !=\n ${TARBALL_SHA256}" ; \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   168
			exit 1; \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   169
	 	fi ; \
4ad971e180c3 7073739 Mass minor bugfix update to X.Org upstream release [July 2011 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1176
diff changeset
   170
	    fi ; \
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   171
	fi
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   172
	touch $(CHECKSUM_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   173
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   174
clean: clean-checksums
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   175
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   176
clean-checksums:
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   177
	-rm -f .checksum_done.*
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   178
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   179
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   180
# Submit a tarball to the archive
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   181
ARCHIVE_SUBMIT=/ws/x11/tarballs/bin/archive-tarballs
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   182
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   183
archive-tarball:
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   184
	@case '$(MAKEFLAGS)' in *[ik]*) set +e;; esac; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   185
	if [[ "$(MODULE_VERSION)" != "git" && \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   186
	      "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   187
		$(ARCHIVE_SUBMIT) \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   188
		 --modtype='$(SOURCE_TARBALL_DIR)' \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   189
		 --tarball='$(SOURCE_TARBALL_NAME)' \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   190
		 --url='$(SOURCE_URL)' \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   191
		 --md5='$(TARBALL_MD5)' \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   192
		 --sha1='$(TARBALL_SHA1)' ; \
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   193
	fi
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 910
diff changeset
   194
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 837
diff changeset
   195
$(TARBALLDIR):
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 837
diff changeset
   196
	mkdir -p $(TARBALLDIR)
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 837
diff changeset
   197
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   198
# Update a git cloned repo
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   199
git-update:
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   200
	if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   201
	    if [[ -d $(GIT_CLONE_DIR) ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   202
		cd $(GIT_CLONE_DIR) ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   203
		if [[ ! -z "$(GIT_BRANCH)" ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   204
		    $(GIT) checkout master && \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   205
		    $(GIT) fetch && \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   206
		    $(GIT) checkout $(GIT_BRANCH) ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   207
		else \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   208
		    $(GIT) fetch ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   209
		fi ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   210
	    fi ; \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   211
	fi
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   212
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   213
# Create a local git repo from tarball and patches, to ease generating
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   214
# patches for submission to upstream git or rebasing to new tarballs
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   215
git-import:
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   216
	mkdir $(GIT_CLONE_DIR)
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   217
	cd $(GIT_CLONE_DIR) && git init
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   218
	$(MAKE) SOURCE_DIR="$(GIT_CLONE_DIR)" init_source
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   219
	cd $(GIT_CLONE_DIR) && git add . && \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   220
		git commit -a -m 'Initialized from $(SOURCE_TARBALL_NAME)' \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   221
		&& git tag '$(MODULE_NAME)-$(MODULE_VERSION)'
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   222
	@for f in $(SOURCE_PATCHES) ; do \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   223
	    p=$${f%,*} ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   224
	    print '=================' $$p ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   225
	    if head -n 1 $$p | \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   226
	       ggrep -Eq '^From .* Mon Sep 17 00:00:00 2001' ; then \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   227
		(cd $(GIT_CLONE_DIR) ; $(START_CMD_ECHO) ; git am $(PWD)/$$p) ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   228
	    else \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   229
		rm -f $(GIT_CLONE_DIR)/$(PATCHED_TARGET_FILE) ; \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   230
		$(MAKE) SOURCE_PATCHES="$$f" SOURCE_DIR="$(GIT_CLONE_DIR)" \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   231
			patched_source ; \
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   232
		printf '%s\n\n' "$${p%.patch}" > git.comments ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   233
	    	gawk '/^--- /		{exit} \
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   234
		      /^diff -/		{exit} \
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   235
		      {print}' $$p >> git.comments ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   236
		(cd $(GIT_CLONE_DIR) ; $(START_CMD_ECHO) ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   237
		 git commit -a --file=$(PWD)/git.comments ) ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   238
		rm git.comments ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   239
	   fi ; \
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   240
	done
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   241
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   242
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   243
### Unpack source and apply patches
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   244
963
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
   245
SOURCE_DEPS = $(SOURCE_TARBALL) $(CHECKSUM_TARGET) \
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
   246
	$(MODTYPE_SOURCE_DEPS) $(MODULE_SOURCE_DEPS)
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
   247
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   248
# Step 1: Initialize source dir with upstream sources
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   249
# - if there's a tarball, unpack it.
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   250
# - if using a git master, copy it.
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   251
SOURCE_INIT_TARGET_FILE=.source.init.done
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   252
SOURCE_INIT_TARGET=$(SOURCE_DIR)/$(SOURCE_INIT_TARGET_FILE)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   253
init_source: $(SOURCE_INIT_TARGET)
90
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   254
963
7a4fced80e83 6962316 X proto area should more closely match packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 957
diff changeset
   255
$(SOURCE_INIT_TARGET): $(SOURCE_DEPS)
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   256
	mkdir -p $(SOURCE_DIR)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   257
	@ if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   258
	  if [[ "$(MODULE_VERSION)" = "git" ]] ; then \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   259
	    SOURCE_CMD='gtar --exclude=.git* -cf - $(GIT_CLONE_DIR)' ; \
1228
47726356aac9 7114886 Remove SOURCE_UNCOMPRESS support from X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1207
diff changeset
   260
	    SOURCE_FILE='-' ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   261
	  else \
1228
47726356aac9 7114886 Remove SOURCE_UNCOMPRESS support from X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1207
diff changeset
   262
	    SOURCE_CMD=':' ; SOURCE_FILE='$(SOURCE_TARBALL)' ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   263
	  fi ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   264
	  $(START_CMD_ECHO) ; \
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   265
	  $${SOURCE_CMD} | \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   266
	    gtar --directory="$(SOURCE_DIR)" --strip-components=1 \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   267
		$(ADD_TAR_FLAGS) -xf $${SOURCE_FILE} ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   268
	fi
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   269
	touch $(SOURCE_INIT_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   270
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   271
# Step 2: Add in any additional local sources from $(ADDITIONAL_SOURCE_DIR)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   272
# (done after init source to avoid races in directory/file creation)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   273
SOURCE_ADD_TARGET_FILE=.source.add.done
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   274
SOURCE_ADD_TARGET=$(SOURCE_DIR)/$(SOURCE_ADD_TARGET_FILE)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   275
add_source: $(SOURCE_ADD_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   276
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   277
$(SOURCE_ADD_TARGET): $(SOURCE_INIT_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   278
	@if [[ "$(ADDITIONAL_SOURCE_DIR)" != "" ]] ; then \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   279
	  if [[ ! -x $(LNDIR) ]] ; then \
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   280
	    (cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install) ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   281
	  fi ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   282
	  $(START_CMD_ECHO) ; \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   283
	  cd $(SOURCE_DIR) && $(LNDIR) ../$(ADDITIONAL_SOURCE_DIR) ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   284
	fi
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   285
	touch $(SOURCE_ADD_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   286
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   287
# Step 3: Apply any local patches (must come after add_source is finished)
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   288
#
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   289
# SOURCE_PATCHES is a list in the format: filename[,flags]
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   290
# $${p/*,} is ksh93 syntax to remove the comma and everything before it in $p
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   291
# $${p%,*} is ksh93 syntax to remove the comma and everything after it in $p
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   292
PATCHED_TARGET_FILE=.patches.done
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   293
PATCHED_TARGET=$(SOURCE_DIR)/$(PATCHED_TARGET_FILE)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   294
patched_source: $(PATCHED_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   295
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   296
# Include Xorg autoconf macros when rebuilding configure scripts
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   297
# and use specific version of automake.
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   298
ACLOCAL_PATH=/usr/bin/aclocal-$(AUTOMAKE_VERSION)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   299
ACLOCAL_INCLUDES = -I $(PROTODIR)$(X11_ACLOCAL_DIR) \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   300
	-I /usr/share/aclocal -I /usr/share/aclocal-$(AUTOMAKE_VERSION)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   301
AUTOMAKE_PATH=/usr/bin/automake-$(AUTOMAKE_VERSION)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   302
AUTORECONF_ENV= ACLOCAL="$(ACLOCAL_PATH) $(ACLOCAL_INCLUDES)" \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   303
	AUTOMAKE="$(AUTOMAKE_PATH)"
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   304
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   305
$(PATCHED_TARGET): $(SOURCE_ADD_TARGET)
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   306
	@ if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   307
	    for p in $(SOURCE_PATCHES) x ; do \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   308
	        if [[ "$$p" != "x" ]] ; then \
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   309
		    patch_file="$${p%,*}" ; \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   310
		    if [[ "$$p" =~ "," ]] ; then \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   311
			patch_flags="$${p/*,}" ; \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   312
		    else \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   313
			patch_flags="-p0" ; \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   314
		    fi ; \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   315
		    ($(START_CMD_ECHO) ; \
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   316
		     gpatch -d $(SOURCE_DIR) $${patch_flags} < "$${patch_file}" ) ; \
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   317
		fi ; \
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   318
	    done ; \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   319
	fi ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   320
	if [[ "$(AUTORECONF)" = "yes" || "$(MODULE_VERSION)" = "git" ]] ; then \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   321
	     ($(START_CMD_ECHO) ; cd $(SOURCE_DIR) && \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   322
	      $(AUTORECONF_ENV) autoreconf -v --install --force) ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   323
	fi ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   324
	touch $(PATCHED_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   325
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   326
# Step 4: Apply common Solaris changes to man pages in $(SUNTOUCHED_MANPAGES)
947
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   327
FIXED_MAN_SUFFIX=mantouch.done
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   328
FIXED_MAN_TARGET=$(SUNTOUCHED_MANPAGES:%=$(SOURCE_DIR)/%.$(FIXED_MAN_SUFFIX))
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   329
fixed_man: $(FIXED_MAN_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   330
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   331
COMMON_SUNTOUCH_MAN_FLAGS  = -a '{Availability, $(MODULE_PKGNAME)}'
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   332
COMMON_SUNTOUCH_MAN_FLAGS += -a '{Interface Stability, $(MODULE_STABILITY)}' 
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   333
COMMON_SUNTOUCH_MAN_FLAGS += -r '{__distroname__, $(DISTRO_NAME)}'
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   334
947
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   335
DEFAULT_SUNTOUCH_MAN_FLAGS = \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   336
	$(COMMON_SUNTOUCH_MAN_FLAGS) \
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   337
	$(MODTYPE_SUNTOUCH_MAN_FLAGS) \
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   338
	$(MODULE_SUNTOUCH_MAN_FLAGS)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   339
947
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   340
SUNTOUCH_MAN_FLAGS_DEFAULT	= $(SUNTOUCH_MAN_FLAGS_SET:yes=$(POUND_SIGN))
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   341
$(SUNTOUCH_MAN_FLAGS_DEFAULT)	SUNTOUCH_MAN_FLAGS = $(DEFAULT_SUNTOUCH_MAN_FLAGS)
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   342
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   343
$(FIXED_MAN_TARGET): $(PATCHED_TARGET) $(SOURCE_ADD_TARGET)
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   344
	$(PERL) $(TOP)/open-src/common/suntouch-manpages.pl $(SUNTOUCH_MAN_FLAGS) \
947
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   345
		$(@:%.$(FIXED_MAN_SUFFIX)=%)
ef9da9d336f5 6950022 X man page cleanups
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 935
diff changeset
   346
	touch $@
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   347
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   348
# Step 5: Apply common Solaris changes to pkg-config *.pc files listed in
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   349
# $(FIX_PC_FILES)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   350
SOURCE_PC_FILES = $(FIX_PC_FILES:%=$(SOURCE_DIR)/%)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   351
ORIG_PC_FILES = $(SOURCE_PC_FILES:%=%.orig)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   352
FIXED_PC_TARGET = $(ORIG_PC_FILES)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   353
fixed_pc: $(FIXED_PC_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   354
1418
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   355
# Perl operations to perform on pkg-config *.pc files we build/install
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   356
# First, make warnings about missing files into fatal errors
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   357
FIX_PC_OPS  = $(PERL_MISSING_FILES_ERROR)
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   358
# Remove -L flags for libraries in the default library path (/usr/lib{/64})
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   359
FIX_PC_OPS += -e 's|-L\$${libdir}|| if "$(MODULE_ADD_LIB_SUBDIR)" eq "";'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   360
# Add -R flags for libraries in non-default library paths
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   361
FIX_PC_OPS += -e 's|-L\$${libdir}|-L\$${libdir} -R\$${libdir}|;'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   362
# Remove duplicate -R flags if upstream already provided one
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   363
FIX_PC_OPS += -e 's|-R\$${libdir}( .*)? -R\$${libdir}|-R\$${libdir}$$1|g;'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   364
# Allow modules to add their own operations
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   365
FIX_PC_OPS += $(MODTYPE_FIX_PC_FLAGS) $(MODULE_FIX_PC_FLAGS)
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   366
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   367
$(ORIG_PC_FILES): $(PATCHED_TARGET)
1418
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   368
	@ print "FIX_PC: $(@:.orig=)"
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   369
	$(MAKE_QUIET)$(PERL) -i.orig -p $(FIX_PC_OPS) $(@:.orig=)
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   370
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   371
# Tie them all together
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   372
UNPACK_TARGETS = $(SOURCE_INIT_TARGET) $(PATCHED_TARGET) \
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   373
	$(SOURCE_ADD_TARGET) $(FIXED_MAN_TARGET) $(FIXED_PC_TARGET)
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   374
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   375
source: $(SOURCE_TARGETS)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   376
default_source: $(SOURCE_TARGETS)
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   377
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   378
$(UNPACK_TARGET): $(SOURCE_DEPS) $(UNPACK_TARGETS)
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   379
	touch $(UNPACK_TARGET)
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   380
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   381
# Make sure build directory exists, and if CLONE_SRC=yes, then
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   382
# lndir the sources into it.
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   383
$(BUILD_DIR): $(SOURCE_TARGETS)
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   384
	mkdir -p $@
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   385
	@if [[ "$(CLONE_SRC)" = "yes" ]]; then \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   386
		$(START_CMD_ECHO) ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   387
		cd $(BUILD_DIR) && $(LNDIR) ../$(SOURCE_DIR) ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   388
	fi
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   389
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   390
### Run configure scripts
191
8c3443e72486 6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 156
diff changeset
   391
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   392
# Dependencies for running configure to make a Makefile
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   393
CONFIGURE_DEPS = $(SOURCE_TARGETS) $(BUILD_DIR) \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   394
	$(MODTYPE_CONFIGURE_DEPS) $(MODULE_CONFIGURE_DEPS)
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   395
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   396
# Command line options to GNU autoconf configure script
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   397
DEFAULT_CONFIG_OPTS = --prefix=$(MODULE_PREFIX) \
1437
d660534eef7a 18241851 X builds should enable build & delivery of docs in asciidoc format
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1425
diff changeset
   398
	--without-xmlto --with-asciidoc --without-fop \
1500
f21b42287315 20484350 cleanup assorted build & check warnings
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1494
diff changeset
   399
	--mandir='$${prefix}/share/man' --localstatedir=/var --sysconfdir=/etc
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   400
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   401
CONFIG_OPTS = $(DEFAULT_CONFIG_OPTS) \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   402
	$(MODTYPE_CONFIG_OPTS) $(MODULE_CONFIG_OPTS)
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   403
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   404
# Environment variable options to GNU autoconf configure script
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   405
$(USE_DEFAULT_CONFIG_CPPFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_CPPFLAGS= \
494
549ab2aae6ae 6735203 open-src Makefile cleanup & enhancements (fix Studio 11 builds)
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 493
diff changeset
   406
	-I$(PROTODIR)$(X11_INCLUDES_DIR) \
549ab2aae6ae 6735203 open-src Makefile cleanup & enhancements (fix Studio 11 builds)
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 493
diff changeset
   407
	-I$(PROTODIR)/usr/include -I$(PROTODIR)/usr/include/freetype2
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   408
$(USE_DEFAULT_CONFIG_LDFLAGS:no=$(POUND_SIGN)) DEFAULT_CONFIG_LDFLAGS= \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   409
	-L$(PROTODIR)/usr/lib$(ARCHLIBSUBDIR) \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   410
	-L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR)
561
3c2df35483af 6756343 Split FSWxorg-fonts into smaller packages & integrate to Nevada gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 536
diff changeset
   411
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   412
DEFAULT_PKG_CONFIG_PATH=$(PROTODIR)$(PKGCONFIG_DIR):$(PROTODIR)$(PKGCONFIG_DIR_SHARE):$(PKGCONFIG_DIR):$(PKGCONFIG_DIR_SHARE)
191
8c3443e72486 6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 156
diff changeset
   413
1111
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   414
# Most upstream software is written by developers using bash as /bin/sh, so
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   415
# we run configure scripts with that to minimize problems and work around
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   416
# some ksh93 bugs we've hit
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   417
CONFIG_SHELL_DEFAULT		= $(CONFIG_SHELL_SET:yes=$(POUND_SIGN))
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   418
$(CONFIG_SHELL_DEFAULT)		CONFIG_SHELL = /usr/bin/bash
582653852b4c 7035299 clean up CONFIG_SHELL in X makefiles
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1105
diff changeset
   419
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   420
# Set USE_DEFAULT_CONFIG_ENV=no in a Makefile to not use this default
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   421
# autoconfig environment
1416
bcf00ae6c8e5 17768852 fix X build failures seen on shared build servers installed with s > s12_32
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents: 1408
diff changeset
   422
# gnu/nm added for working around 17596443
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   423
DEFAULT_CONFIG_ENV  = CC="$(CC)" CXX="$(CXX)" AR="$(AR)"
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   424
DEFAULT_CONFIG_ENV += LD="$(CC) $(ARCH_FLAGS) $(LDFLAGS)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   425
DEFAULT_CONFIG_ENV += CFLAGS="$(MODTYPE_CFLAGS) $(MODULE_CFLAGS)" 
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   426
DEFAULT_CONFIG_ENV += CXXFLAGS="$(MODTYPE_CXXFLAGS) $(MODULE_CXXFLAGS)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   427
DEFAULT_CONFIG_ENV += CPPFLAGS="$(DEFAULT_CONFIG_CPPFLAGS) $(MODTYPE_CPPFLAGS) $(MODULE_CPPFLAGS)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   428
DEFAULT_CONFIG_ENV += LDFLAGS="$(DEFAULT_CONFIG_LDFLAGS) $(MODTYPE_CFLAGS) $(MODTYPE_LDFLAGS) $(MODULE_CFLAGS) $(MODULE_LDFLAGS)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   429
DEFAULT_CONFIG_ENV += PKG_CONFIG_PATH="$(DEFAULT_PKG_CONFIG_PATH)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   430
DEFAULT_CONFIG_ENV += PERL="$(PERL)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   431
DEFAULT_CONFIG_ENV += PYTHON="$(PYTHON)" PYTHONPATH="$(PYTHON_PATH)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   432
DEFAULT_CONFIG_ENV += am_cv_python_pythondir="$(PYTHON_VENDOR_DIR)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   433
DEFAULT_CONFIG_ENV += am_cv_python_pyexecdir="$(PYTHON_VENDOR_DIR)"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   434
DEFAULT_CONFIG_ENV += INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p"
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   435
DEFAULT_CONFIG_ENV += MAKE="$(MODULE_MAKE)" CONFIG_SHELL="$(CONFIG_SHELL)"
1416
bcf00ae6c8e5 17768852 fix X build failures seen on shared build servers installed with s > s12_32
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents: 1408
diff changeset
   436
DEFAULT_CONFIG_ENV += NM="/usr/gnu/bin/nm"
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   437
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   438
$(USE_DEFAULT_CONFIG_ENV:no=$(POUND_SIGN)) CONFIG_ENV = $(DEFAULT_CONFIG_ENV) 
1422
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1418
diff changeset
   439
$(WITH_PARFAIT) CONFIG_ENV += $(PARFAIT_ENV)
1276
52f85727ce94 7161868 Update X.Org modules to X11R7.7 RC1
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1273
diff changeset
   440
CONFIG_ENV += $(MODTYPE_CONFIG_ENV) $(MODULE_CONFIG_ENV)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   441
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   442
# File created by running configure - defaults to the top-level Makefile
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   443
# in a source directory unless AUTOCONF_TARGET_SET=yes is set
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   444
AUTOCONF_TARGET_DEFAULT = $(AUTOCONF_TARGET_SET:yes=$(POUND_SIGN))
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   445
$(AUTOCONF_TARGET_DEFAULT)	AUTOCONF_TARGET=$(SOURCE_DIR)/Makefile
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   446
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   447
CONFIG_SCRIPT = ../$(SOURCE_DIR)/configure
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   448
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   449
$(AUTOCONF_TARGET): $(CONFIGURE_DEPS)
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   450
	cd $(BUILD_DIR) ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   451
	chmod a+x $(CONFIG_SCRIPT) ; \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   452
	$(CONFIG_ENV) $(CONFIG_SHELL) $(CONFIG_SCRIPT) $(CONFIG_OPTS) ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   453
	if [[ "$(DELIBTOOLIZE)" = "yes" ]] ; then \
1147
54bcc6a673bf 7054723 X consolidation should move to perl 5.12
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1132
diff changeset
   454
	    $(PERL) $(TOP)/open-src/common/delibtoolize.pl $(DELIBTOOLIZE_FLAGS) . ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   455
	fi
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   456
	-rm -f $(BUILD_DIR)/a.out.bc
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   457
910
0a08683bf637 6928500 Race conditions in parallel make break X nightly builds
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
   458
default_configure: $(AUTOCONF_TARGET)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   459
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   460
### Default rules for common build pattern
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   461
1425
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   462
LD_OPTIONS = $(DEFAULT_LD_OPTIONS) $(MODTYPE_LD_OPTIONS) $(MODULE_LD_OPTIONS)
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   463
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   464
LD_EXEC_OPTIONS  = $(DEFAULT_LD_EXEC_OPTIONS)
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   465
LD_EXEC_OPTIONS += $(MODTYPE_LD_EXEC_OPTIONS) $(MODULE_LD_EXEC_OPTIONS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   466
1425
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   467
LD_SHARED_OPTIONS  = $(DEFAULT_LD_SHARED_OPTIONS)
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   468
LD_SHARED_OPTIONS += $(MODTYPE_LD_SHARED_OPTIONS) $(MODULE_LD_SHARED_OPTIONS)
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   469
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   470
BUILD_ENV  = LD_OPTIONS='$(LD_OPTIONS)'
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   471
BUILD_ENV += LD_EXEC_OPTIONS='$(LD_EXEC_OPTIONS)'
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   472
BUILD_ENV += LD_SHARED_OPTIONS='$(LD_SHARED_OPTIONS)'
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   473
BUILD_ENV += PROTODIR='$(PROTODIR)'
d2b9d2006251 17915870 clean up check_rtime & ld guidance warnings in X gate
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1422
diff changeset
   474
BUILD_ENV += MAKE='$(MODULE_MAKE)'
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 705
diff changeset
   475
# MKDIRPROG - Workaround parallel build race condition
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 705
diff changeset
   476
#		in older upstream packaged install-sh
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   477
BUILD_ENV += MKDIRPROG='mkdir -p'
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   478
BUILD_ENV += PYTHONPATH="$(PYTHON_PATH)"
1422
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1418
diff changeset
   479
$(WITH_PARFAIT) BUILD_ENV += $(PARFAIT_ENV)
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   480
BUILD_ENV += $(MODTYPE_BUILD_ENV) $(MODULE_BUILD_ENV)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   481
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   482
DEFAULT_BUILD_MAKEFLAGS=$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   483
	$(MODTYPE_BUILD_MAKEFLAGS) $(MODULE_BUILD_MAKEFLAGS)
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   484
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   485
# Dependencies for make build step
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   486
BUILD_DEPS = $(SOURCE_TARGETS) $(CONFIGURE_TARGETS) $(MODTYPE_BUILD_DEPS) $(MODULE_BUILD_DEPS)
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   487
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   488
DEFAULT_BUILD_COMMAND = cd @DIR@ ; \
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   489
	$(BUILD_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_BUILD_MAKEFLAGS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   490
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   491
default_build: $(BUILD_DEPS)
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   492
	$(DEFAULT_BUILD_COMMAND:@DIR@=$(BUILD_DIR))
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   494
build-in-subdir:
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   495
	$(DEFAULT_BUILD_COMMAND:@DIR@=$(subdir)) $(subdir_cmd)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   496
1132
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   497
INSTALL_ENV = $(BUILD_ENV) \
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   498
	INSTALL="$(INSTALL_SCRIPT)" CPPROG="cp -p" \
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   499
	$(MODTYPE_INSTALL_ENV) $(MODULE_INSTALL_ENV)
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   500
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   501
DEFAULT_INSTALL_MAKEFLAGS= -e DESTDIR=$(PROTODIR) \
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 837
diff changeset
   502
	pkgconfigdir=$(MODULE_PKGCONFIG_DIR) \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   503
	$(MODTYPE_MAKEFLAGS) $(MODULE_MAKEFLAGS) \
1132
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   504
	$(MODTYPE_INSTALL_MAKEFLAGS) $(MODULE_INSTALL_MAKEFLAGS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   505
591
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   506
# Dependencies for make install step
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   507
INSTALL_DEPS = $(BUILD_TARGETS) $(MODTYPE_INSTALL_DEPS) $(MODULE_INSTALL_DEPS)
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   508
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   509
DEFAULT_INSTALL_COMMAND = cd @DIR@ ; \
1132
d9f96853a754 7047456 X could do better at building & packaging python bits
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   510
	$(INSTALL_ENV) $(MODULE_MAKE) $(MAKEFLAGS) $(DEFAULT_INSTALL_MAKEFLAGS)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   511
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   512
default_install: $(INSTALL_DEPS)
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   513
	$(DEFAULT_INSTALL_COMMAND:@DIR@=$(BUILD_DIR)) install
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   514
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   515
install-in-subdir:
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   516
	$(DEFAULT_INSTALL_COMMAND:@DIR@=$(subdir)) $(subdir_cmd) \
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   517
		$(install_subdir_cmd)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   518
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   519
# Adjust paths in pkg-config files for -uninstalled variants used during build
1418
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   520
# First, make warnings about missing files into fatal errors
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   521
UNINSTALLED_PC_OPS  = $(PERL_MISSING_FILES_ERROR)
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   522
# Set perl $protodir to absolute path to $(PROTODIR)
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   523
UNINSTALLED_PC_OPS += -e 'BEGIN {use Cwd; $$protodir=Cwd::realpath("$(PROTODIR)");}'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   524
# Prepend $protodir to paths for includes, libraries to link against, etc.
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   525
UNINSTALLED_PC_OPS += -e 's|(-[LI]\s*)\$$|$$1$$protodir\$$|g;'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   526
UNINSTALLED_PC_OPS += -e 's|^sdkdir=|sdkdir=$$protodir|g;'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   527
UNINSTALLED_PC_OPS += -e 's|$$protodir\$${sdkdir}|\$${sdkdir}|g;'
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   528
# Allow modules to add their own operations
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   529
UNINSTALLED_PC_OPS += $(MODTYPE_ADD_UNINSTALLED_PC_OPS)
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   530
UNINSTALLED_PC_OPS += $(MODULE_ADD_UNINSTALLED_PC_OPS)
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   531
910
0a08683bf637 6928500 Race conditions in parallel make break X nightly builds
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
   532
INSTALL_PCU_DEPS_DEFAULT	= $(INSTALL_PCU_DEPS_SET:yes=$(POUND_SIGN))
0a08683bf637 6928500 Race conditions in parallel make break X nightly builds
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
   533
$(INSTALL_PCU_DEPS_DEFAULT)	INSTALL_PCU_DEPS = $(INSTALL_TARGETS)
0a08683bf637 6928500 Race conditions in parallel make break X nightly builds
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
   534
0a08683bf637 6928500 Race conditions in parallel make break X nightly builds
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
   535
install_pkgconfig_uninstalled: $(INSTALL_PCU_DEPS)
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   536
	@ if [[ ! -z "$(FIX_PC_FILES)" ]] ; then \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   537
	    cd $(BUILD_DIR) ; \
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   538
	    for pcin in $(FIX_PC_FILES:.in=) ; do \
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   539
		pc="$${pcin%%+(.pc|.in)}" ; \
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   540
		pcu="$${pc##*/}-uninstalled.pc" ; \
851
d428083dbbdd 6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 837
diff changeset
   541
		($(START_CMD_ECHO) ; \
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   542
		 rm -f $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   543
		 $(PERL) -p $(UNINSTALLED_PC_OPS) $$pc.pc > \
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   544
		    $(PROTODIR)$(MODULE_PKGCONFIG_DIR)/$${pcu} ) ; \
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   545
	    done ; \
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   546
	fi
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   547
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   548
# Add links if needed from /usr/X11/* to new locations in /usr/*
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   549
X11_BINCOMPAT_DIR = $(PROTODIR)/usr/X11/bin
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   550
X11_BINCOMPAT_LINKS = $(MODULE_X11_BINCOMPAT_LINKS:%=$(X11_BINCOMPAT_DIR)/%)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   551
X11_LIBCOMPAT_DIR = $(PROTODIR)/usr/X11/lib$(ARCHLIBSUBDIR)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   552
X11_LIBCOMPAT_LINKS = $(MODULE_X11_LIBCOMPAT_LINKS:%=$(X11_LIBCOMPAT_DIR)/%)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   553
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   554
$(X11_BINCOMPAT_DIR) $(X11_LIBCOMPAT_DIR):
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   555
	mkdir -p $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   556
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   557
$(X11_BINCOMPAT_LINKS): $(X11_BINCOMPAT_DIR)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   558
	@rm -f $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   559
	ln -s ../../bin/$(@F) $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   560
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   561
$(X11_LIBCOMPAT_LINKS): $(X11_LIBCOMPAT_DIR)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   562
	@rm -f $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   563
	@if [[ -z "$(ARCHLIBSUBDIR)" ]] ; then \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   564
	    TARGETDIR=../../lib ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   565
	else \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   566
	    TARGETDIR=../../../lib$(ARCHLIBSUBDIR) ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   567
	fi ; $(START_CMD_ECHO) ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   568
	ln -s $${TARGETDIR}/$(@F) $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   569
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   570
install_X11_compat_links: $(X11_BINCOMPAT_LINKS) $(X11_LIBCOMPAT_LINKS)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   571
591
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   572
# Set comments in ELF binaries to help identify versions/builds
1071
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   573
$(BUILD_DEBUG:yes=)			DEBUG_ELF_COMMENTS=(DEBUG)
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   574
$(BUILD_DEBUG:yes=)			DEBUG_ELF_COMMENTS_FLAGS=-b -B 'hg id'
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   575
$(BUILD_DEBUG:yes=$(POUND_SIGN))	DEBUG_ELF_COMMENTS=
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   576
$(BUILD_DEBUG:yes=$(POUND_SIGN))	DEBUG_ELF_COMMENTS_FLAGS=
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   577
591
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   578
ELF_COMMENTS = $(MODULE_NAME) $(MODULE_VERSION)
1071
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   579
ELF_COMMENTS += $(DEBUG_ELF_COMMENTS)
591
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   580
ELF_COMMENTS += $(MODTYPE_ELF_COMMENTS)$(MODULE_ELF_COMMENTS)
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   581
1071
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   582
ELF_COMMENTS_FLAGS = -M '$(ELF_COMMENTS)'
79918bb93075 7019195 stop embedding hg id/tag & build date in mcs information in X
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1061
diff changeset
   583
ELF_COMMENTS_FLAGS += $(DEBUG_ELF_COMMENTS_FLAGS)
994
ebd9341332ef 6975153 libfreetype.so.6 does not contain correct mcs version info
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
   584
ELF_COMMENTS_FLAGS += $(MODTYPE_ELF_COMMENTS_FLAGS) $(MODULE_ELF_COMMENTS_FLAGS)
ebd9341332ef 6975153 libfreetype.so.6 does not contain correct mcs version info
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
   585
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 705
diff changeset
   586
set-elf-comments: $(BUILD_TARGETS:set-elf-comments=)
1147
54bcc6a673bf 7054723 X consolidation should move to perl 5.12
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1132
diff changeset
   587
	$(PERL) $(TOP)/open-src/common/set-elf-comments.pl \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   588
	 $(ELF_COMMENTS_FLAGS) $(BUILD_DIR)
591
a2c6b61a92aa 6777135 X builds should record version info in ELF comments
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 587
diff changeset
   589
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   590
MANIFEST_DEST=$(PWD)/tmp-proto-$(MACH)
1105
515c6398d9df 7010836 Package manifests in X gate should use .p5m naming convention
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1097
diff changeset
   591
MANIFEST_TMP=$(PWD)/tmp.p5m
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   592
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   593
MANIFEST_TARGETS_DEFAULT	= $(MANIFEST_TARGETS_SET:yes=$(POUND_SIGN))
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   594
$(MANIFEST_TARGETS_DEFAULT)	MANIFEST_TARGETS=$(MODULE_PKG_MANIFEST)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   595
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   596
manifest: $(MANIFEST_TARGETS)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   597
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   598
manifest-per-type: $(MODULE_PKG_MANIFEST)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   599
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   600
MANIFEST_INSTALL_RULES = PROTOTOOLSDIR="$(PROTODIR)" \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   601
	PROTODIR="$(MANIFEST_DEST)"
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   602
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   603
$(MANIFEST_DEST): install
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   604
	/usr/xpg4/bin/make $(MAKEFLAGS) install $(MANIFEST_INSTALL_RULES) \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   605
		|| (rm -rf $(MANIFEST_DEST) ; exit 1)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   606
1207
996eb6e88a18 7086641 X package manifests should move to pkgfmt version 2
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1201
diff changeset
   607
$(MANIFEST_TMP): $(MANIFEST_DEST)
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   608
	$(PERL) $(TOP)/open-src/common/pkg-manifest-generate.pl \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   609
		input_manifest='$(MODULE_PKG_MANIFEST)' \
1172
4597acbe535f 7041659 X packages should not deliver dir actions for directories defined elsewhere
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1162
diff changeset
   610
		exception_manifest='$(PKG_SRC_DIR)/exceptions-validate_pkg.p5m' \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   611
		manifest_license='$(PKG_LICENSE_DIR)/cr_Oracle.tmpl' \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   612
		manifest_license='$(PKG_LICENSE_DIR)/lic_X11' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   613
		pkg_name='$(MODULE_PKGNAME)' \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   614
		summary='$(MODULE_DESC)' \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   615
		source_dir='$(SOURCE_DIRNAME)' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   616
		arch_64='$(ARCH64)' subdir_64='$(SUBDIR64)' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   617
		proto_area='$(MANIFEST_DEST)' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   618
		pkgfmt='$(PKGFMT)' \
1088
1c99106ccbe0 6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1072
diff changeset
   619
		version='__version:$(MODULE_NAME)__' \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   620
		> $(MANIFEST_TMP)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   621
	-rm -rf $(MANIFEST_DEST)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   622
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   623
$(MODULE_PKG_MANIFEST): $(MANIFEST_TMP) $(PKG_MANIFEST_DIR)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   624
	mv -f $(MANIFEST_TMP) $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   625
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   626
$(PKG_MANIFEST_DIR):
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   627
	mkdir -p $(PKG_MANIFEST_DIR)
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   628
1201
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   629
### Doc tools
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   630
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   631
# Convert DocBook/XML to HTML (since Solaris doesn't bundle the xmlto tool
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   632
# used by most upstream code to do this)
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   633
XML_TO_HTML  = /usr/bin/xsltproc --nonet --xinclude
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   634
XML_TO_HTML += --stringparam html.stylesheet $(X11_SGML_DIR)/xorg.css
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   635
XML_TO_HTML += --stringparam current.docid $(@F:.html=)
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   636
XML_TO_HTML += --stringparam collect.xref.targets no
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   637
XML_TO_HTML += --path "$(PROTODIR)$(X11_SGML_DIR) $(MODULE_XML_PATH)"
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   638
XML_TO_HTML += $(TOP)/open-src/doc/xorg-sgml-doctools/xmltohtml.xsl
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   639
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   640
# Convert HTML to text (also normally done by xmlto upstream)
1536
9169c528bff2 21090741 post build server update to s12_73, X builds are failing
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents: 1508
diff changeset
   641
HTML_TO_TEXT = /usr/bin/lynx -dump
1201
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   642
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   643
.SUFFIXES: .xml .html .txt
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   644
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   645
.xml.html:
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   646
	$(XML_TO_HTML) $< > $@
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   647
	@ if [[ ! -s $@ ]] ; then print "xml to html failed" ; exit 1 ; fi
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   648
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   649
.html.txt:
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   650
	$(HTML_TO_TEXT) $< > $@
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   651
	@ if [[ ! -s $@ ]] ; then print "html to text failed" ; exit 1 ; fi
d6ebb7728565 6489124 docs needed for Xserver dtrace provider
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1179
diff changeset
   652
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   653
### Other tools/dependencies needed to build
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   654
90
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   655
# Some modules use lndir to merge in sources from Sun specific directories
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   656
$(LNDIR):
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 965
diff changeset
   657
	(cd $(TOP)/open-src/util/lndir && $(MAKE) $(MAKEFLAGS) install)
90
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   658
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   659
### Useful rules for maintaining patch sets
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   660
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   661
# regenerate patches against new baseline to reduce messages about hunks
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   662
# having fuzz or offsets when applying patches - new patches will be in new/
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   663
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   664
regen-patches:
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   665
	CUR_LIST=""
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   666
	rm -rf tmp-regen
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   667
	$(MAKE) SOURCE_PATCHES="$(CUR_LIST)" SOURCE_DIR=tmp-regen \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   668
	    AUTORECONF="no" patched_source
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   669
	mkdir -p new
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   670
	for f in $(SOURCE_PATCHES) ; do \
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   671
	    p=$${f%,*} ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   672
	    print '=================' $$p ; \
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   673
	    rm -rf prev ; \
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   674
	    mv tmp-regen prev ; \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   675
	    $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" SOURCE_DIR=tmp-regen \
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   676
		AUTORECONF="no" patched_source ; \
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   677
	    find tmp-regen -name '*.orig' -exec rm {} \+ ; \
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   678
	    gawk '/^--- /	{exit} \
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   679
		  /^diff -/	{exit} \
90
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   680
			 	{print}' $$p > new/$$p ; \
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   681
	    LC_COLLATE=C git diff --no-color ./prev ./tmp-regen \
1466
fbd4067be4c6 19461700 Split source & build subdirectories in X builds
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1456
diff changeset
   682
		| sed -e 's% a/\./prev/% a/%' -e 's% b/\./tmp-regen/% b/%' \
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   683
		| grep -v '^Common subdirectories:' \
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   684
		| grep -v '^Only in ' \
90
aa93b75745de 6509458 Xorg modularization: libXpm & xpm apps
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 70
diff changeset
   685
		>> new/$$p ; \
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1123
diff changeset
   686
	    CUR_LIST="$${CUR_LIST} new/$$p,-p1" ; \
47
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   687
	done
d59efbadf28b 4869280 Update xscreensaver to 5.0
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 40
diff changeset
   688
	rm -rf tmp-regen
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   689
935
f812f9863e75 6941861 Collected X gate build fixes
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 922
diff changeset
   690
# Allows running "make list-patches" to get a list of all patches we
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   691
# currently apply in our builds
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   692
list-patches:
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   693
	@if [[ "$(SOURCE_PATCHES)" != "" ]] ; then \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   694
	    THIS_MODULE="$${PWD##*/open-src/}" ; \
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   695
	    for p in $(SOURCE_PATCHES) x ; do \
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   696
		if [[ "$$p" != "x" ]] ; then \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   697
	            print "$${THIS_MODULE}/$${p%,*}" ;  \
606
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   698
		fi ; \
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   699
	    done ; \
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   700
	fi
068c11b419c9 6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 599
diff changeset
   701
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   702
### Metadata used in packaging
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   703
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   704
MODULE_PKG_METADATA_DIR	= $(PROTOMETA)/$(MODULE_PKG_MANIFEST_NAME)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   705
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   706
$(MODULE_PKG_METADATA_DIR):
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   707
	mkdir -p $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   708
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   709
METADATA_TARGETS = $(MODULE_PKG_METADATA_DIR)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   710
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   711
# Base URL for ARC cases used in opensolaris.arc_url metadata
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   712
# Set to '$(ARC_URL)' here, resolved by pkgmogrify to the URL
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   713
# set in pkg/Makefile during the package building process
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   714
ARC_URL_BASE = $$(ARC_URL)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   715
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   716
# Metadata about upstream
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   717
UPSTREAM_NONE		= NONE
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   718
UPSTREAM_NONE_SET	= yes
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   719
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   720
UPSTREAM_xorg		= X.Org Foundation
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   721
UPSTREAM_URL_xorg	= http://www.x.org/
1123
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   722
SOURCE_URL_xorg		= $(XORG_RELEASES_URL)/$(SOURCE_TARBALL_DIR)/$(SOURCE_TARBALL_NAME)
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   723
# TPNO's for X.Org software & font batches
1549
4b5a9782609e 21256857 Update Xorg to the latest community version 1.17.2
Niveditha Rau <Niveditha.Rau@Oracle.COM>
parents: 1536
diff changeset
   724
ORACLE_TPNO_xorg	= 22895
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   725
ORACLE_TPNO_xorg_fonts	= 11716
1123
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   726
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   727
UPSTREAM_xcb		= The XCB Project
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   728
UPSTREAM_URL_xcb	= http://xcb.freedesktop.org/
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   729
SOURCE_URL_xcb		= http://xcb.freedesktop.org/dist/$(SOURCE_TARBALL_NAME)
1456
c800ec17944c 18952370 X packages need TPNO updates for new versions approved via LTE
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1437
diff changeset
   730
ORACLE_TPNO_xcb		= 18006
1123
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   731
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   732
UPSTREAM_PROJECT_DEFAULT	= $(UPSTREAM_PROJECT_SET:yes=$(POUND_SIGN))
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   733
$(UPSTREAM_PROJECT_DEFAULT)	UPSTREAM_PROJECT = xorg
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   734
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   735
UPSTREAM_DEFAULT	= $(UPSTREAM_SET:yes=$(POUND_SIGN))
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   736
$(UPSTREAM_DEFAULT) UPSTREAM = $(UPSTREAM_$(SOURCE_TARBALL_NAME))
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   737
$(UPSTREAM_DEFAULT) UPSTREAM_SET_YET = $(UPSTREAM_$(SOURCE_TARBALL_NAME)_SET)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   738
$(UPSTREAM_DEFAULT) UPSTREAM_NOTFOUND = $(UPSTREAM_SET_YET:yes=$(POUND_SIGN))
1123
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   739
$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM = $(UPSTREAM_$(UPSTREAM_PROJECT))
4678f8c1d429 7042918 Update xcb-util to version 0.3.8 [PSARC/2011/215]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1111
diff changeset
   740
$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) UPSTREAM_URL = $(UPSTREAM_URL_$(UPSTREAM_PROJECT))
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   741
ORACLE_TPNO_DEFAULT	= $(ORACLE_TPNO_SET:yes=$(POUND_SIGN))
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   742
$(UPSTREAM_NOTFOUND) $(SOURCE_URL_DEFAULT) $(ORACLE_TPNO_DEFAULT) ORACLE_TPNO = $(ORACLE_TPNO_$(UPSTREAM_PROJECT))
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   743
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   744
## Attributes files
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   745
1105
515c6398d9df 7010836 Package manifests in X gate should use .p5m naming convention
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1097
diff changeset
   746
ATTRDATA_FILE_NAME	= attributes_$(MODULE_NAME).p5m
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   747
ATTRDATA_FILE		= $(MODULE_PKG_METADATA_DIR)/$(ATTRDATA_FILE_NAME)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   748
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   749
METADATA_TARGETS += $(ATTRDATA_FILE)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   750
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   751
# $${MODVERS//\.+(0)(\d)/.\2} - ksh93 pattern substitution to remove leading
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   752
# 0's from package version number components, to meet pkg(5) fmri requirements
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   753
%/$(ATTRDATA_FILE_NAME): %
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   754
	-rm -f $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   755
	@if [[ "$(SOURCE_TARBALL_NAME)" != "NONE" ]] ; then \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   756
	    $(START_CMD_ECHO) ; \
1162
9045745b7172 7062962 X pkg attribute name changes underscored by desire for consistency
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1147
diff changeset
   757
	    print 'set name=info.source-url value="$(SOURCE_URL)"' >> $@ ; \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   758
	fi
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   759
	@if [[ "$(UPSTREAM)" != "NONE" ]] ; then \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   760
	    $(START_CMD_ECHO) ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   761
	    print 'set name=info.upstream value="$(UPSTREAM)"' >> $@ ; \
1162
9045745b7172 7062962 X pkg attribute name changes underscored by desire for consistency
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1147
diff changeset
   762
	    print 'set name=info.upstream-url value="$(UPSTREAM_URL)"' >> $@ ; \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   763
	fi
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   764
	@if [[ ! -z "$(MODULE_ARC_CASES)" ]] ; then \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   765
	    $(START_CMD_ECHO) ; \
1162
9045745b7172 7062962 X pkg attribute name changes underscored by desire for consistency
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1147
diff changeset
   766
	    print 'set name=org.opensolaris.arc-caseid' \
9045745b7172 7062962 X pkg attribute name changes underscored by desire for consistency
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1147
diff changeset
   767
		'$(MODULE_ARC_CASES:%=value="%")' >> $@ ;  \
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   768
	fi
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   769
	@if [[ ! -z "$(MODULE_PKGCLASS)" ]] ; then \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   770
	    $(START_CMD_ECHO) ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   771
	    print 'set name=info.classification' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   772
		'value="org.opensolaris.category.2008:$(MODULE_PKGCLASS)"' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   773
		>> $@ ;  \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   774
	fi
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   775
	@ MODVERS="$(MODULE_VERSION)" ; $(START_CMD_ECHO) ; \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   776
	printf '<transform set -> edit value __version:$(MODULE_NAME)__ %s>\n' \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   777
	       "$${MODVERS//\.+(0)(\d)/.\2}" >> $@
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   778
	$(MODTYPE_ATTRDATA_COMMANDS)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   779
	$(MODULE_ATTRDATA_COMMANDS)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   780
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   781
## License files
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   782
1302
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   783
LICENSE_FILE_NAME = license_$(MODULE_NAME)
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   784
LICENSE_FILE_DEST = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME)
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   785
LICENSE_ATTR_FILE = $(MODULE_PKG_METADATA_DIR)/$(LICENSE_FILE_NAME).p5m
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   786
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   787
# Default license file name is COPYING (X.Org & GNU autoconf default)
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   788
# For other license file names, set LICENSE_FILE to the file name
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   789
# and set LICENSE_FILE_SET=yes
387
5ce4f3ae3e65 6681709 Copyright update project for Xorg
Jay Cotton <Jay.Cotton@Sun.COM>
parents: 359
diff changeset
   790
# A file in the same directory as the Makefile takes precedence
5ce4f3ae3e65 6681709 Copyright update project for Xorg
Jay Cotton <Jay.Cotton@Sun.COM>
parents: 359
diff changeset
   791
# over one that is delivered in the package.
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   792
LICENSE_FILE_DEFAULT	= $(LICENSE_FILE_SET:yes=$(POUND_SIGN))
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   793
$(LICENSE_FILE_DEFAULT)	LICENSE_FILE=COPYING
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   794
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   795
# Oracle copyright notice template
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   796
ORACLE_COPYRIGHT_TEMPLATE=$(PKG_LICENSE_DIR)/cr_Oracle.tmpl
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   797
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   798
# Default is the MIT/X11 license
1305
693dba88be96 7086639 X packages should have license file banners (fix license names in pkgs)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1302
diff changeset
   799
MIT_LICENSE_NAME = MIT License
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   800
MIT_LICENSE_FILE = $(PKG_LICENSE_DIR)/lic_X11
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   801
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   802
MODULE_LICENSE_DEFAULT		= $(MODULE_LICENSE_SET:yes=$(POUND_SIGN))
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   803
$(MODULE_LICENSE_DEFAULT)	MODULE_LICENSE = $(MIT_LICENSE_NAME)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   804
1302
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   805
# Each license file should have a header showing which upstream module it's 
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   806
# from for easier viewing/cross-referencing.  The format of this header is
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   807
# common to all Solaris consolidations, so should not be changed without
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   808
# coordination.
1418
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   809
PRINT_IN_BOX = $(PERL) -n -e '$$border = "-" x length($$_);' \
536e3ec8f101 17768989 pkg-config adds unnecessary runpaths to default locations for X11 libraries
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1416
diff changeset
   810
	-e 'printf "--%s--\n- %s -\n--%s--\n\n", $$border, $$_, $$border'
1302
bdcf270fda09 7086639 X packages should have license file banners
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1298
diff changeset
   811
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   812
# Some packages contain only code that Oracle owns all the rights to.
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   813
# For these, Makefile.options.oracle.com chooses to omit the license
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   814
# notice when Oracle is building its distros.   Everyone else gets the
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   815
# notice required by open source license Oracle released the code under.
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   816
LICENSE_CHOICE_DEFAULT		= $(LICENSE_CHOICE_SET:yes=$(POUND_SIGN))
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   817
$(LICENSE_CHOICE_DEFAULT)	LICENSE_CHOICE=open
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   818
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   819
ORACLE_LICENSE_NAME_open	= $(MIT_LICENSE_NAME)
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   820
ORACLE_LICENSE_INSERT_open	= $(MIT_LICENSE_FILE)
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   821
1305
693dba88be96 7086639 X packages should have license file banners (fix license names in pkgs)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1302
diff changeset
   822
ORACLE_LICENSE_NAME_Oracle	= Oracle Copyright Notice
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   823
ORACLE_LICENSE_INSERT_Oracle 	= # Nothing to append to copyright notice
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   824
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   825
ORACLE_LICENSE_NAME 		= $(ORACLE_LICENSE_NAME_$(LICENSE_CHOICE))
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   826
ORACLE_LICENSE_INSERT		= $(ORACLE_LICENSE_INSERT_$(LICENSE_CHOICE))
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   827
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   828
# Use default license info unless MODULE_LICENSE = "Oracle"
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   829
LICENSE_NAME			= $(MODULE_LICENSE)
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   830
LICENSE_PREPEND			= $(MODULE_LICENSE_PREPEND)
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   831
LICENSE_INSERT 			= $(MODULE_LICENSE_INSERT)
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   832
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   833
LICENSE_OVERRIDE_1		= $(POUND_SIGN)$(MODULE_LICENSE)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   834
LICENSE_OVERRIDE		= $(LICENSE_OVERRIDE_1:$(POUND_SIGN)Oracle%=)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   835
$(LICENSE_OVERRIDE)		LICENSE_NAME = $(ORACLE_LICENSE_NAME)
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   836
$(LICENSE_OVERRIDE)		LICENSE_INSERT = $(ORACLE_LICENSE_INSERT)
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 999
diff changeset
   837
1394
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   838
# Name to use in TPNO metadata & license file headers
1408
17c15e2662ba 17472475 Mass minor bugfix update to X.Org upstream release [Sep. 2013 edition]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1395
diff changeset
   839
MODULE_TPNO_NAME_DEFAULT	= $(MODULE_TPNO_NAME_SET:yes=$(POUND_SIGN))
1394
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   840
$(MODULE_TPNO_NAME_DEFAULT)	MODULE_TPNO_NAME = $(MODULE_NAME)
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   841
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   842
install_license: $(LICENSE_FILE_DEST)
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   843
METADATA_TARGETS += $(LICENSE_FILE_DEST)
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   844
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   845
%/$(LICENSE_FILE_NAME): % $(SOURCE_TARGETS) $(LICENSE_PREPEND) $(LICENSE_INSERT)
922
db66e53f0c94 6933880 Simplify building the same X workspace on sparc & x86
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 920
diff changeset
   846
	@ $(START_CMD_ECHO) ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   847
	if [[ -f '$(LICENSE_FILE)' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   848
	    license_to_copy='$(LICENSE_FILE)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   849
	elif [[ -f '$(SOURCE_DIR)/$(LICENSE_FILE)' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   850
	    license_to_copy='$(SOURCE_DIR)/$(LICENSE_FILE)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   851
	else \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   852
	    license_to_copy='/dev/null' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   853
	fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   854
	if [[ -s "$${license_to_copy}" || -n '$(ORACLE_COPYRIGHT_YEARS)' ]] ; then \
1394
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   855
	    m='$(MODULE_TPNO_NAME)' ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   856
	    if [[ '$(MODULE_VERSION)' != 'src' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   857
		m+=' $(MODULE_VERSION)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   858
	    fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   859
	    print -n $$m | $(PRINT_IN_BOX) > $@ ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   860
	fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   861
	if [[ -n '$(ORACLE_COPYRIGHT_YEARS)' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   862
	    sed 's/@YEARS@/$(ORACLE_COPYRIGHT_YEARS)/' \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   863
		$(ORACLE_COPYRIGHT_TEMPLATE) >> $@ ; \
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   864
	    if [[ -n '$(LICENSE_INSERT)' ]] ; then \
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   865
		cat $(LICENSE_INSERT) >> $@ ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   866
	    fi ; \
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 460
diff changeset
   867
	fi ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   868
	if [[ -n '$(MODULE_LICENSE_DESC)' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   869
	    license_desc='$(MODULE_LICENSE_DESC)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   870
	elif [[ -n '$(MODULE_DESC)' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   871
	    license_desc='$(MODULE_DESC)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   872
	else \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   873
	    license_desc='$(MODTYPE_DESC)' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   874
	fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   875
	if [[ -s "$${license_to_copy}" ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   876
	    if [[ -n "$${license_desc}" ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   877
		contents="$${license_desc}," ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   878
	    else \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   879
		contents="technology" ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   880
	    fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   881
	    print "This package may include $${contents} which may be subject to one or more of the following notices:\n" | fmt >> $@ ; \
1395
491325df357b 17251350 X needs more TPNO's (fix font licenses)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1394
diff changeset
   882
	    if [[ -n '$(LICENSE_PREPEND)' ]] ; then \
491325df357b 17251350 X needs more TPNO's (fix font licenses)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1394
diff changeset
   883
		cat $(LICENSE_PREPEND) >> $@ ; \
491325df357b 17251350 X needs more TPNO's (fix font licenses)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1394
diff changeset
   884
	    fi ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   885
	    cat "$${license_to_copy}" >> $@ ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   886
	fi ; \
1392
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   887
	if [[ -n '$(LICENSE_APPEND)' ]] ; then \
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   888
	  cat $(LICENSE_APPEND) >> $@ ; \
fa8ecde31cf5 17251350 X needs more TPNO's
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1356
diff changeset
   889
	fi ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   890
	if [[ -s $@ ]] ; then \
1394
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   891
	    license_attributes='license="$(LICENSE_NAME) ($(MODULE_TPNO_NAME))"' ; \
1424fada9837 17251350 X needs more TPNO's (fix sparc build)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1392
diff changeset
   892
	    license_attributes+=' com.oracle.info.name="$(MODULE_TPNO_NAME)"' ; \
1356
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   893
	    if [[ '$(MODULE_VERSION)' != 'src' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   894
		license_attributes+=' com.oracle.info.version="$(MODULE_VERSION)"' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   895
	    fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   896
	    license_attributes+=" com.oracle.info.description=\"$${license_desc}\"" ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   897
	    if [[ -n '$(ORACLE_TPNO)' && '$(LICENSE_CHOICE)' == 'Oracle' ]] ; then \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   898
		license_attributes+=' com.oracle.info.tpno="$(ORACLE_TPNO)"' ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   899
	    fi ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   900
	    print 'license $(LICENSE_FILE_NAME)' "$${license_attributes}" > [email protected] ; \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   901
	else \
73c3eb360de2 16167547 Update copyright & license display & metadata in X packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1354
diff changeset
   902
	    print '*** $@ is empty' ; \
355
a3a81e9c227d 6672824 Copyright/license notices from X.Org software should be included in SVR4 package copyrights
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 354
diff changeset
   903
	fi
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   904
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   905
install_metadata: $(METADATA_TARGETS)
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   906
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   907
### Parfait scans
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   908
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   909
parfait:
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   910
	parfait -e all -c "$(TOP)/open-src/common/X-parfait.conf" -z "$(TOP)" \
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1276
diff changeset
   911
		-j "$${DMAKE_MAX_JOBS:-100%}" . || true