1 # |
1 # |
2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
5 # This code is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License version 2 only, as |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. Oracle designates this |
7 # published by the Free Software Foundation. Oracle designates this |
46 # and not directories. |
46 # and not directories. |
47 # EXCLUDE_PATTERNS_$dir - Exclude patterns just like above but specific to one |
47 # EXCLUDE_PATTERNS_$dir - Exclude patterns just like above but specific to one |
48 # src dir |
48 # src dir |
49 # SUFFIXES |
49 # SUFFIXES |
50 # EXTRA_DEPS |
50 # EXTRA_DEPS |
|
51 # FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of |
|
52 # finding files. |
51 # ZIP_OPTIONS extra options to pass to zip |
53 # ZIP_OPTIONS extra options to pass to zip |
52 SetupZipArchive = $(NamedParamsMacroTemplate) |
54 SetupZipArchive = $(NamedParamsMacroTemplate) |
53 define SetupZipArchiveBody |
55 define SetupZipArchiveBody |
54 |
56 |
55 # To avoid running find over too large sets of files, which causes make to crash |
57 # To avoid running find over too large sets of files, which causes make to crash |
60 $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) |
62 $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) |
61 else |
63 else |
62 $1_FIND_LIST := $$($1_SRC) |
64 $1_FIND_LIST := $$($1_SRC) |
63 endif |
65 endif |
64 |
66 |
65 # Find all files in the source tree. Follow symlinks in this find since that is |
67 # Find all files in the source tree. |
66 # what zip does. |
68 # If asked to, follow symlinks in this find since that is what zip does. To do |
67 $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L)) |
69 # this, we need to call ShellFindFiles directly. |
|
70 ifeq ($$($1_FOLLOW_SYMLINKS), true) |
|
71 $1_ALL_SRCS := $$(call not-containing,_the.,$$(call ShellFindFiles,$$($1_FIND_LIST), , -L)) |
|
72 else |
|
73 $1_ALL_SRCS := $$(call not-containing,_the.,$$(call FindFiles,$$($1_FIND_LIST))) |
|
74 endif |
68 |
75 |
69 # Filter on suffixes if set |
76 # Filter on suffixes if set |
70 ifneq ($$($1_SUFFIXES),) |
77 ifneq ($$($1_SUFFIXES),) |
71 $1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS)) |
78 $1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS)) |
72 endif |
79 endif |