4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
24 GPATCH
= /usr
/gnu
/bin
/patch
26 GPATCH_BACKUP
= --backup
--version-control
=numbered
27 GPATCH_FLAGS
= --strip=$(PATCH_LEVEL
) $(GPATCH_BACKUP
)
30 # Rules for patching source that is downloaded and unpacked or pulled from
31 # a source repository.
33 # PATCH_DIR can be overridden to move patches to a different location
34 # PATCH_PATTERN can be overridden to adjust the patch naming scheme that the
36 # EXTRA_PATCHES{version} can be defined in the component Makefile to include
40 PATCH_PATTERN ?
= *.patch
43 # patches specific to parfait builds.
44 ifeq ($(strip $(PARFAIT_BUILD
)),yes
)
45 PARFAIT_PATCH_DIR
= parfait
48 PATCHES
= $(shell find
$(PATCH_DIR
) $(PARFAIT_PATCH_DIR
) -type f \
49 -name
'$(PATCH_PATTERN)' 2>/dev
/null | \
52 $(SOURCE_DIR
)/.patched
: unpack
53 @for p in
$(PATCHES
); do \
55 if
! [ -f
$@
-$$b ]; then \
56 echo
"$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $$p";\
57 $(GPATCH
) -d
$(@D
) $(GPATCH_FLAGS
) < $$p || exit
1;\
62 patch
:: $(SOURCE_DIR
)/.patched
64 REQUIRED_PACKAGES
+= text
/gnu-patch