jdk

Форк
0
/
ZipSource.gmk 
102 строки · 3.6 Кб
1
#
2
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
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
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
default: all
27

28
include $(SPEC)
29
include MakeBase.gmk
30
include JavaCompilation.gmk
31
include Modules.gmk
32

33
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
34
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
35

36
# Hook to include the corresponding custom file, if present.
37
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
38

39
################################################################################
40
# Create the directory structure for src.zip using symlinks.
41
# <module>/<package>/<file>.java
42

43
ALL_MODULES := $(FindAllModules)
44

45
# Generate the src dirs in the first make invocation and then call this makefile
46
# again to create src.zip.
47
$(foreach m, $(ALL_MODULES), \
48
  $(foreach d, $(call FindModuleSrcDirs, $m), \
49
    $(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$(patsubst $(SUPPORT_OUTPUTDIR)/%,%,$d))/$m) \
50
    $(if $(SRC_GENERATED), , \
51
      $(eval $$($d_TARGET): $d ; \
52
          $$(if $(filter $(SRC_ZIP_BASE)/%, $d), $$(link-file-relative), $$(link-file-absolute)) \
53
      ) \
54
    ) \
55
    $(eval SRC_ZIP_SRCS += $$($d_TARGET)) \
56
    $(eval SRC_ZIP_SRCS_$m += $$($d_TARGET)) \
57
  ) \
58
)
59

60
TARGETS += $(SRC_ZIP_SRCS)
61

62
################################################################################
63
# Only evaluate the creation of src.zip in a sub make call when the symlinked
64
# src directory structure has been generated.
65
ifeq ($(SRC_GENERATED), true)
66

67
  # Rewrite the EXCLUDE_TRANSLATIONS locales as exclude patters for java files
68
  TRANSLATIONS_PATTERN := $(addprefix %_, $(addsuffix .java, $(EXCLUDE_TRANSLATIONS)))
69

70
  # Add excludes for translations for all modules except jdk.localedata
71
  $(foreach s, $(SRC_ZIP_SRCS), \
72
    $(if $(filter $(notdir $s), jdk.localedata), , \
73
      $(eval BUILD_SRC_ZIP_EXCLUDE_PATTERNS_$(dir $s) := $$(TRANSLATIONS_PATTERN)) \
74
    ) \
75
  )
76

77
  $(eval $(call SetupZipArchive, BUILD_SRC_ZIP, \
78
      SRC := $(dir $(SRC_ZIP_SRCS)), \
79
      INCLUDES := $(SRC_ZIP_INCLUDES), \
80
      INCLUDE_FILES := $(SRC_ZIP_INCLUDE_FILES), \
81
      EXCLUDES := $(SRC_ZIP_EXCLUDES), \
82
      EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
83
      SUFFIXES := .java, \
84
      ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
85
      FOLLOW_SYMLINKS := true, \
86
  ))
87

88
  do-zip: $(BUILD_SRC_ZIP)
89

90
  .PHONY: do-zip
91
endif
92

93
zip: $(SRC_ZIP_SRCS)
94
	+$(MAKE) $(MAKE_ARGS) -f ZipSource.gmk do-zip SRC_GENERATED=true
95

96
TARGETS += zip
97

98
################################################################################
99

100
all: $(TARGETS)
101

102
.PHONY: default all zip
103

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.