blob: b1bd465af79bb35e2a2919a000e437ce011aef5a [file] [log] [blame]
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16LOCAL_PATH := $(my-dir)
17include $(CLEAR_VARS)
18
19#
20# Define rules to build temp_layoutlib.jar, which contains a subset of
21# the classes in framework.jar. The layoutlib_create tool is used to
22# transform the framework jar into the temp_layoutlib jar.
23#
24
25# We need to process the framework classes.jar file, but we can't
26# depend directly on it (private vars won't be inherited correctly).
27# So, we depend on framework's BUILT file.
28built_framework_dep := \
29 $(call intermediates-dir-for,JAVA_LIBRARIES,framework)/javalib.jar
30built_framework_classes := \
31 $(call intermediates-dir-for,JAVA_LIBRARIES,framework)/classes.jar
32
33built_core_dep := \
34 $(call intermediates-dir-for,JAVA_LIBRARIES,core)/javalib.jar
35built_core_classes := \
36 $(call intermediates-dir-for,JAVA_LIBRARIES,core)/classes.jar
37
38built_policy_dep := \
39 $(call intermediates-dir-for,JAVA_LIBRARIES,android.policy)/javalib.jar
40built_policy_classes := \
41 $(call intermediates-dir-for,JAVA_LIBRARIES,android.policy)/classes.jar
42
43built_layoutlib_create_jar := $(call intermediates-dir-for, \
44 JAVA_LIBRARIES,layoutlib_create,HOST)/javalib.jar
45
46# This is mostly a copy of config/host_java_library.mk
47LOCAL_MODULE := temp_layoutlib
48LOCAL_MODULE_CLASS := JAVA_LIBRARIES
49LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
50LOCAL_IS_HOST_MODULE := true
51LOCAL_BUILT_MODULE_STEM := javalib.jar
52
53#######################################
54include $(BUILD_SYSTEM)/base_rules.mk
55#######################################
56
57$(LOCAL_BUILT_MODULE): $(built_core_dep) \
58 $(built_framework_dep) \
59 $(built_policy_dep) \
60 $(built_layoutlib_create_jar)
61 @echo "host layoutlib_create: $@"
62 @mkdir -p $(dir $@)
63 @rm -f $@
64 $(hide) java -jar $(built_layoutlib_create_jar) \
65 $@ \
66 $(built_core_classes) \
67 $(built_framework_classes) \
68 $(built_policy_classes)
69
70
71#
72# Include the subdir makefiles.
73#
74include $(call all-makefiles-under,$(LOCAL_PATH))