Makefile 4.5 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
D
duke 已提交
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
D
duke 已提交
10 11 12 13 14 15 16 17 18 19 20
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
21 22 23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
24 25 26 27 28
#

BUILDDIR = ../..
PACKAGE = java.security
PRODUCT = sun
29 30
JAVAC_MAX_WARNINGS = true 
JAVAC_LINT_OPTIONS = -Xlint:all
31
JAVAC_WARNINGS_FATAL = true
D
duke 已提交
32 33 34 35 36 37 38 39 40 41 42
include $(BUILDDIR)/common/Defs.gmk

#
# Rules
#
AUTO_FILES_JAVA_DIRS = java/security

#
# Directories
#

43 44
# The default security properties file is for linux
PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-linux
D
duke 已提交
45 46 47 48

ifeq ($(PLATFORM), solaris)
PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-solaris

49
else # NOT_SOLARIS
D
duke 已提交
50

51
# Register Microsoft CryptoAPI provider only on Windows platform.
D
duke 已提交
52
ifeq ($(PLATFORM), windows)
53
  PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-windows
54 55 56 57 58 59 60 61 62

else # NOT_WINDOWS

ifeq ($(PLATFORM), macosx)
  PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-macosx
endif # MACOSX

endif # NOT_WINDOWS
endif # NOT_SOLARIS
D
duke 已提交
63 64 65 66 67 68 69 70 71 72


PROPS_BUILD = $(LIBDIR)/security/java.security

POLICY_SRC =	$(TOPDIR)/src/share/lib/security/java.policy
POLICY_BUILD = $(LIBDIR)/security/java.policy

CACERTS_SRC =	$(CACERTS_FILE)
CACERTS_BUILD = $(LIBDIR)/security/cacerts

73 74 75
BLACKLISTED_CERTS_SRC =	$(TOPDIR)/src/share/lib/security/blacklisted.certs
BLACKLISTED_CERTS_BUILD = $(LIBDIR)/security/blacklisted.certs

76 77 78
ifndef OPENJDK
  BLACKLIST_SRC =	$(CLOSED_SHARE_SRC)/lib/security/blacklist
  BLACKLIST_BUILD = $(LIBDIR)/security/blacklist
79
  BLACKLISTED_CERTS_SRC +=	$(wildcard $(CLOSED_SHARE_SRC)/lib/security/blacklisted.certs)
80 81
  TRUSTEDLIBS_SRC = $(CLOSED_SHARE_SRC)/lib/security/trusted.libraries
  TRUSTEDLIBS_BUILD = $(LIBDIR)/security/trusted.libraries
82 83 84
  RESTRICTED_PKGS_SRC = $(CLOSED_SHARE_SRC)/lib/security/restricted.pkgs
  RESTRICTED_PKGS := $(shell $(CAT) $(RESTRICTED_PKGS_SRC) | $(TR) "\n" " ")
  ADDTORESTRICTEDPKGS_JARFILE = $(BUILDTOOLJARDIR)/addtorestrictedpkgs.jar
85 86
endif

D
duke 已提交
87 88 89 90 91 92 93
FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class)

#
# Rules
#
include $(BUILDDIR)/common/Rules.gmk

94
ifdef OPENJDK
95
build: properties policy cacerts blacklisted-certs
96
else
97
build: properties policy cacerts blacklist blacklisted-certs trustedlibs
98
endif
D
duke 已提交
99 100 101 102 103 104 105 106 107

install: all

properties: classes  $(PROPS_BUILD)

policy: classes  $(POLICY_BUILD)

cacerts: classes $(CACERTS_BUILD)

108 109
blacklist: classes $(BLACKLIST_BUILD)

110 111
blacklisted-certs: classes $(BLACKLISTED_CERTS_BUILD)

112 113
trustedlibs: classes $(TRUSTEDLIBS_BUILD)

114
ifdef OPENJDK
D
duke 已提交
115 116
$(PROPS_BUILD): $(PROPS_SRC)
	$(install-file)
117 118 119 120 121 122
else
$(PROPS_BUILD): $(PROPS_SRC)
	$(MKDIR) -p $(@D)
	$(BOOT_JAVA_CMD) -jar $(ADDTORESTRICTEDPKGS_JARFILE) $^ $@.tmp $(RESTRICTED_PKGS)
	$(MV) $@.tmp $@
endif
D
duke 已提交
123 124 125 126 127 128 129

$(POLICY_BUILD): $(POLICY_SRC)
	$(install-file)

$(CACERTS_BUILD): $(CACERTS_SRC)
	$(install-file)

130 131 132
$(BLACKLIST_BUILD): $(BLACKLIST_SRC)
	$(install-file)

133 134 135 136 137 138 139 140 141 142 143 144
$(BLACKLISTED_CERTS_BUILD): $(BLACKLISTED_CERTS_SRC)
	$(MKDIR) -p $(@D)
	$(CAT) $^ | $(SED) '/^$$/d' | $(SORT) | $(UNIQ) > $@.tmp
	$(GREP) -i Algorithm $@.tmp > $@
	if [ `$(SED) -n -e "$$=" $@` != 1 ]; then \
	   $(ECHO) "Different algorithms defined in $^"; \
	   $(RM) $@ $@.tmp; \
	   false; \
	fi
	$(GREP) -iv Algorithm $@.tmp >> $@
	$(RM) $@.tmp

145 146 147
$(TRUSTEDLIBS_BUILD): $(TRUSTEDLIBS_SRC)
	$(install-file)

D
duke 已提交
148 149
clean clobber:: .delete.classlist
	$(RM) -r $(CLASSBINDIR)/java/security
150 151
	$(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD) \
	      $(BLACKLISTED_CERTS_BUILD) $(TRUSTEDLIBS_BUILD)
D
duke 已提交
152 153 154 155 156

# Additional Rule for building sun.security.util
$(CLASSBINDIR)/%.class: $(SHARE_SRC)/sun/%.java
	@$(ECHO) $? >> $(TEMPDIR)/.classes.list