test/make/TestJavaCompilation.gmk
author martin
Thu, 18 Sep 2014 16:25:50 -0700
changeset 26715 5e166a2dc3ac
parent 25854 98ce0879ab4c
child 28600 09dd1740f176
permissions -rw-r--r--
8058550: Clarify that TimerTasks are not reusable Reviewed-by: alanb, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     1
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     2
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     4
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    10
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    15
# accompanied this code).
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    16
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    20
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    23
# questions.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    24
#
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    25
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    26
default: all
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    27
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    28
include $(SPEC)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    29
include MakeBase.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    30
include JavaCompilation.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    31
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    32
THIS_FILE := $(SRC_ROOT)/test/make/TestJavaCompilation.gmk
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    33
DEPS := $(THIS_FILE) \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    34
    $(SRC_ROOT)/make/common/MakeBase.gmk \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    35
    $(SRC_ROOT)/make/common/JavaCompilation.gmk \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    36
    #
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    37
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    38
OUTPUT_DIR := $(TESTMAKE_OUTPUTDIR)/java-compilation
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    39
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    40
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    41
# Test: jar1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    42
# Creates a simple jar file and unzips it to verify that the files have not
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    43
# changed.
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    44
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    45
JAR1_SRC_ROOT := $(OUTPUT_DIR)/jar1src
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    46
JAR1_UNZIP := $(OUTPUT_DIR)/jar1unzip
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    47
JAR1_FILE := $(OUTPUT_DIR)/jar1.jar
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    48
JAR1_MANIFEST := $(OUTPUT_DIR)/jar1_manifest
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    49
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    50
clean-jar1:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    51
	$(RM) -r $(OUTPUT_DIR)/_jar1* $(OUTPUT_DIR)/jar1*
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    52
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    53
$(OUTPUT_DIR)/_jar1_created: $(DEPS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    54
	$(RM) -r $(JAR1_SRC_ROOT)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    55
	$(RM) $(JAR1_FILE)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    56
	$(RM) -r $(JAR1_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    57
	$(MKDIR) -p $(JAR1_SRC_ROOT)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    58
	$(MKDIR) -p $(JAR1_SRC_ROOT)/dir1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    59
	$(MKDIR) -p $(JAR1_SRC_ROOT)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    60
	$(MKDIR) -p $(JAR1_SRC_ROOT)/META-INF
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    61
	$(TOUCH) $(JAR1_SRC_ROOT)/dir1/file1.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    62
	$(TOUCH) $(JAR1_SRC_ROOT)/dir2/file2.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    63
	$(TOUCH) $(JAR1_SRC_ROOT)/META-INF/metafile
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    64
	$(ECHO) "Test-Attribute: value" > $(JAR1_MANIFEST)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    65
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    66
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    67
$(eval $(call SetupArchive,BUILD_JAR1, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    68
    $(OUTPUT_DIR)/_jar1_created, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    69
    SRCS := $(JAR1_SRC_ROOT), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    70
    MANIFEST := $(JAR1_MANIFEST), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    71
    JAR := $(JAR1_FILE)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    72
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    73
$(OUTPUT_DIR)/_jar1_verified: $(BUILD_JAR1)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    74
	$(RM) -r $(JAR1_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    75
	$(MKDIR) -p $(JAR1_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    76
	$(CD) $(JAR1_UNZIP) && $(UNZIP) $(JAR1_FILE) $(LOG_DEBUG)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    77
	$(DIFF) -r $(JAR1_SRC_ROOT)/dir1 $(JAR1_UNZIP)/dir1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    78
	$(DIFF) -r $(JAR1_SRC_ROOT)/dir2 $(JAR1_UNZIP)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    79
	$(DIFF) -r $(JAR1_SRC_ROOT)/META-INF/metafile $(JAR1_UNZIP)/META-INF/metafile
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    80
	if [ "`$(GREP) 'Test-Attribute: value' $(JAR1_MANIFEST)`" = "" ]; then \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    81
	  $(ECHO) "Could not find Test-Attribute in manifest of $(JAR1_FILE)"; \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    82
	  exit 1; \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    83
	fi
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    84
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    85
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    86
create-jar2: $(OUTPUT_DIR)/_jar1_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    87
TEST_TARGETS += $(OUTPUT_DIR)/_jar1_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    88
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    89
# Change a source file and call this makefile again to force the jar to be 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    90
# updated. 
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    91
$(OUTPUT_DIR)_jar1_updated: $(OUTPUT_DIR)/_jar1_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    92
	$(ECHO) updated > $(JAR1_SRC_ROOT)/dir1/file1.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    93
	$(ECHO) updated > $(JAR1_SRC_ROOT)/META-INF/metafile
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    94
	$(TOUCH) $(OUTPUT_DIR)/_jar1_created
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    95
	+$(MAKE) -f $(THIS_FILE) $(OUTPUT_DIR)/_jar1_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    96
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    97
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    98
update-jar1: $(OUTPUT_DIR)_jar1_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
    99
TEST_TARGETS += $(OUTPUT_DIR)_jar1_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   100
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   101
.PHONY: clean-jar1 create-jar1 update-jar1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   102
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   103
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   104
# Test: jar2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   105
# Creates a jar file based on 2 source roots
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   106
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   107
JAR2_SRC_ROOT1 := $(OUTPUT_DIR)/jar2src1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   108
JAR2_SRC_ROOT2 := $(OUTPUT_DIR)/jar2src2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   109
JAR2_UNZIP := $(OUTPUT_DIR)/jar2unzip
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   110
JAR2_FILE := $(OUTPUT_DIR)/jar2.jar
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   111
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   112
clean-jar2:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   113
	$(RM) -r $(OUTPUT_DIR)/_jar2* $(OUTPUT_DIR)/jar2*
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   114
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   115
$(OUTPUT_DIR)/_jar2_created: $(DEPS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   116
	$(RM) -r $(JAR2_SRC_ROOT1)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   117
	$(RM) -r $(JAR2_SRC_ROOT2)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   118
	$(RM) $(JAR2_FILE)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   119
	$(RM) -r $(JAR2_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   120
	$(MKDIR) -p $(JAR2_SRC_ROOT1)/dir1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   121
	$(MKDIR) -p $(JAR2_SRC_ROOT2)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   122
	$(TOUCH) $(JAR2_SRC_ROOT1)/dir1/file1.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   123
	$(TOUCH) $(JAR2_SRC_ROOT2)/dir2/file2.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   124
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   125
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   126
$(eval $(call SetupArchive,BUILD_JAR2, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   127
    $(OUTPUT_DIR)/_jar2_created, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   128
    SRCS := $(JAR2_SRC_ROOT1) $(JAR2_SRC_ROOT2), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   129
    JAR := $(JAR2_FILE)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   130
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   131
$(OUTPUT_DIR)/_jar2_verified: $(BUILD_JAR2)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   132
	$(RM) -r $(JAR2_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   133
	$(MKDIR) -p $(JAR2_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   134
	$(CD) $(JAR2_UNZIP) && $(UNZIP) $(JAR2_FILE) $(LOG_DEBUG)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   135
	$(DIFF) -r $(JAR2_SRC_ROOT1)/dir1 $(JAR2_UNZIP)/dir1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   136
	$(DIFF) -r $(JAR2_SRC_ROOT2)/dir2 $(JAR2_UNZIP)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   137
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   138
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   139
create-jar2: $(OUTPUT_DIR)/_jar2_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   140
TEST_TARGETS += $(OUTPUT_DIR)/_jar2_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   141
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   142
$(OUTPUT_DIR)_jar2_updated: $(OUTPUT_DIR)/_jar2_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   143
	$(ECHO) updated > $(JAR2_SRC_ROOT1)/dir1/file1.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   144
	$(TOUCH) $(OUTPUT_DIR)/_jar2_created
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   145
	+$(MAKE) -f $(THIS_FILE) $(OUTPUT_DIR)/_jar2_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   146
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   147
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   148
update-jar2: $(OUTPUT_DIR)_jar2_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   149
TEST_TARGETS += $(OUTPUT_DIR)_jar2_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   150
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   151
.PHONY: clean-jar2 create-jar2 update-jar2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   152
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   153
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   154
# Test: jar3
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   155
# Creates a jar file based on 2 source roots with an extra file
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   156
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   157
JAR3_SRC_ROOT1 := $(OUTPUT_DIR)/jar3src1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   158
JAR3_SRC_ROOT2 := $(OUTPUT_DIR)/jar3src2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   159
JAR3_UNZIP := $(OUTPUT_DIR)/jar3unzip
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   160
JAR3_FILE := $(OUTPUT_DIR)/jar3.jar
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   161
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   162
clean-jar3:
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   163
	$(RM) -r $(OUTPUT_DIR)/_jar3* $(OUTPUT_DIR)/jar3*
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   164
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   165
$(OUTPUT_DIR)/_jar3_created: $(DEPS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   166
	$(RM) -r $(JAR3_SRC_ROOT1)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   167
	$(RM) -r $(JAR3_SRC_ROOT2)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   168
	$(RM) $(JAR3_FILE)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   169
	$(RM) -r $(JAR3_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   170
	$(MKDIR) -p $(JAR3_SRC_ROOT1)/dir1
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   171
	$(MKDIR) -p $(JAR3_SRC_ROOT2)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   172
	$(TOUCH) $(JAR3_SRC_ROOT1)/dir1/file1\$$foo.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   173
	$(TOUCH) $(JAR3_SRC_ROOT2)/dir2/file2.class
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   174
	$(TOUCH) $(JAR3_SRC_ROOT2)/extra-file
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   175
	$(TOUCH) $(JAR3_SRC_ROOT2)/extra-file-abs
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   176
	$(TOUCH) $(JAR3_SRC_ROOT2)/dir2/file\$$foo.dollar
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   177
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   178
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   179
$(eval $(call SetupArchive,BUILD_JAR3, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   180
    $(OUTPUT_DIR)/_jar3_created, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   181
    SRCS := $(JAR3_SRC_ROOT1) $(JAR3_SRC_ROOT2), \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   182
    EXTRA_FILES := extra-file \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   183
        dir2/file$$$$foo.dollar \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   184
        $(JAR3_SRC_ROOT2)/extra-file-abs, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   185
    EXCLUDE_FILES := dir1/file1$$$$foo.class, \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   186
    JAR := $(JAR3_FILE)))
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   187
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   188
$(OUTPUT_DIR)/_jar3_verified: $(BUILD_JAR3)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   189
	$(RM) -r $(JAR3_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   190
	$(MKDIR) -p $(JAR3_UNZIP)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   191
	$(CD) $(JAR3_UNZIP) && $(UNZIP) $(JAR3_FILE) $(LOG_DEBUG)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   192
	if [ -d "$(JAR3_UNZIP)/dir1" ]; then \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   193
	  echo Should not be included $(JAR3_UNZIP)/dir1; \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   194
	  exit 1; \
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   195
        fi
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   196
	$(DIFF) -r $(JAR3_SRC_ROOT2)/dir2 $(JAR3_UNZIP)/dir2
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   197
	$(DIFF) -r $(JAR3_SRC_ROOT2)/extra-file $(JAR3_UNZIP)/extra-file
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   198
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   199
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   200
create-jar3: $(OUTPUT_DIR)/_jar3_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   201
TEST_TARGETS += $(OUTPUT_DIR)/_jar3_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   202
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   203
$(OUTPUT_DIR)_jar3_updated: $(OUTPUT_DIR)/_jar3_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   204
	$(ECHO) updated > $(JAR3_SRC_ROOT2)/extra-file
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   205
	$(TOUCH) $(OUTPUT_DIR)/_jar3_created
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   206
	+$(MAKE) -f $(THIS_FILE) $(OUTPUT_DIR)/_jar3_verified
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   207
	$(TOUCH) $@
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   208
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   209
update-jar3: $(OUTPUT_DIR)_jar3_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   210
TEST_TARGETS += $(OUTPUT_DIR)_jar3_updated
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   211
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   212
.PHONY: clean-jar3 create-jar3 update-jar3
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   213
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   214
################################################################################
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   215
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   216
all: $(TEST_TARGETS)
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   217
98ce0879ab4c 8054834: Modular Source Code
chegar
parents:
diff changeset
   218
.PHONY: default all