blob: 42d10369715256e6eca51d94ef5379475f0dfe46 [file] [log] [blame]
The Android Open Source Project52d4c302009-03-03 19:29:09 -08001#
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#
16
17# Assemble the Platform Development Kit (PDK)
18# (TODO) Figure out why $(ACP) builds with target ndk but not pdk_docs
The Android Open Source Project52d4c302009-03-03 19:29:09 -080019
20pdk:
21 @echo "Package: $@ has targets ndk, pdk_docs and pdk_all"
22
23pdk_all: ndk pdk_docs
24 @echo "Package: $^"
25
26LOCAL_PATH := $(call my-dir)
27
28#-------------------------------------------------------------------------------
29# Make the Native Development Kit (Code examples)
30# Allows vendors to build shared libraries without entire source tree.
31# This include adds /ndk to LOCAL_PATH, so can't use it afterwards...
32include $(LOCAL_PATH)/ndk/Ndk.mk
33
34
35#-------------------------------------------------------------------------------
36# Make the Plaftorm Development Kit Documentation.
37# Doxygenize the header files to create html docs in the generatedDocs dir.
38# Copy the appengine files, the template files and the generated html
39# to the docs dir and zip everything up to the distribution directory.
Mike Ritterdfa54942009-04-01 17:30:12 -070040# Run javadocs/droiddocs/clearsilver on the generatedDocs dir to get the right
41# styles added to the html.
The Android Open Source Project52d4c302009-03-03 19:29:09 -080042
43
44# Workspace directory
45pdk_docs_intermediates := $(call intermediates-dir-for,PACKAGING,pdkdocs)
46
47# Source directories for appengine, templates, config & header files
48pdk_hosting_dir := development/pdk/hosting
49pdk_templates_dir := development/pdk/docs
50pdk_config_dir := development/pdk/doxygen_config
51pdk_docsfile_dir := $(pdk_config_dir)/docsfiles
52pdk_legacy_hardware_dir := hardware/libhardware_legacy/include/hardware_legacy
53pdk_camera_dir := frameworks/base/include/ui
54
55# Destination directory for docs (templates + doxygenated headers)
Mike Ritteraa2d9522009-04-29 09:19:32 -070056pdk_docs_dest_dir := $(pdk_docs_intermediates)/docs/guide
57pdk_app_eng_root := $(pdk_docs_intermediates)/docs
The Android Open Source Project52d4c302009-03-03 19:29:09 -080058
59# Working directory for source to be doxygenated
60pdk_doxy_source_dir := $(pdk_docs_intermediates)/sources
61
62# Working directory for html, et al. after doxygination
63pdk_generated_source_dir := $(pdk_docs_intermediates)/generatedDocs/html
64
65# Working directory for .dox files
66pdk_doxy_docsfiles_dir := $(pdk_docs_intermediates)/docsfiles
67
68# Doxygen version to use, so we can override it on the command line
Mike Ritter0025ca42009-04-14 13:36:43 -070069# doxygen 1.5.6 working, the latest version get-apt installable on ghardy.
70# with bug fix for </div> error.
The Android Open Source Project52d4c302009-03-03 19:29:09 -080071doxygen_version = doxygen
72
73#-------------------------------------------------------------------------------
74# Header files to doxygenize.
75# Add new header files to document here, also adjust the templates to have
76# descriptions for the new headers and point to the new doxygen created html.
77pdk_headers := \
78 $(pdk_legacy_hardware_dir)/AudioHardwareInterface.h \
79 $(pdk_legacy_hardware_dir)/gps.h \
80 $(pdk_legacy_hardware_dir)/wifi.h \
81 $(pdk_camera_dir)/CameraHardwareInterface.h
82
83# Create a rule to copy the list of PDK headers to be doxyginated.
84# copy-one-header defines the actual rule.
85$(foreach header,$(pdk_headers), \
86 $(eval _chFrom := $(header)) \
87 $(eval _chTo := $(pdk_doxy_source_dir)/$(notdir $(header))) \
88 $(eval $(call copy-one-header,$(_chFrom),$(_chTo))) \
89 $(eval all_copied_pdk_headers: $(_chTo)) \
90 )
91_chFrom :=
92_chTo :=
93
94
95#-------------------------------------------------------------------------------
96# Assemble all the necessary doxygen config files and the sources into the
97# working directories
98
99pdk_templates := $(shell find $(pdk_templates_dir) -type f)
100
101# Create a rule to copy the list of PDK doc templates.
102# copy-one-file defines the actual rule.
103$(foreach template,$(pdk_templates), \
104 $(eval _chFrom := $(template)) \
Mike Ritteraa2d9522009-04-29 09:19:32 -0700105 $(eval _chTo := $(pdk_app_eng_root)/$(patsubst $(pdk_templates_dir)/%,%,$(template))) \
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800106 $(eval $(call copy-one-header,$(_chFrom),$(_chTo))) \
107 $(eval all_copied_pdk_templates: $(_chTo)) \
108 )
109_chFrom :=
110_chTo :=
111
112# Copy newer doxygen config file (basic configs, should not change very often.)
113pdk_doxygen_config_file := $(pdk_docs_intermediates)/pdk_config.conf
114$(pdk_doxygen_config_file): $(pdk_config_dir)/pdk_config.conf
115 @echo "PDK: $@"
116 $(copy-file-to-target-with-cp)
117
118# Copy newer doxygen override config file (may change these more often.)
119pdk_doxygen_config_override_file := $(pdk_docs_intermediates)/overrideconfig.conf
120$(pdk_doxygen_config_override_file): $(pdk_config_dir)/overrideconfig.conf
121 @echo "PDK: $@"
122 $(copy-file-to-target-with-cp)
123
124# (TODO) Get the latest templates
125# Copy newer doxygen html files.
126$(pdk_docs_intermediates)/header.html: $(pdk_config_dir)/header.html
127 @echo "PDK: $@"
128 $(copy-file-to-target-with-cp)
129
130$(pdk_docs_intermediates)/footer.html: $(pdk_config_dir)/footer.html
131 @echo "PDK: $@"
132 $(copy-file-to-target-with-cp)
133
134# Copy newer doxygen .dox files
135$(pdk_doxy_docsfiles_dir)/groups.dox: $(pdk_docsfile_dir)/groups.dox
136 @echo "PDK: $@"
137 $(copy-file-to-target-with-cp)
138
139$(pdk_doxy_docsfiles_dir)/main.dox: $(pdk_docsfile_dir)/main.dox
140 @echo "PDK: $@"
141 $(copy-file-to-target-with-cp)
142
Mike Ritterdfa54942009-04-01 17:30:12 -0700143# All the files that we depend upon
144all_pdk_docs_files := $(pdk_doxygen_config_override_file) \
145 $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \
146 $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \
Mike Ritter0025ca42009-04-14 13:36:43 -0700147 $(pdk_doxy_docsfiles_dir)/main.dox all_copied_pdk_templates \
148 all_copied_pdk_headers
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800149
150# Run doxygen and copy all output and templates to the final destination
151# We replace index.html with a template file so don't use the generated one
152pdk_doxygen: all_copied_pdk_headers $(pdk_doxygen_config_override_file) \
153 $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \
154 $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \
Mike Ritterdfa54942009-04-01 17:30:12 -0700155 $(pdk_doxy_docsfiles_dir)/main.dox
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800156 @echo "Files for Doxygination: $^"
157 @mkdir -p $(pdk_generated_source_dir)
158 @rm -f $(pdk_generated_source_dir)/*
159 @cd $(pdk_docs_intermediates) && $(doxygen_version) pdk_config.conf
160 @mkdir -p $(pdk_docs_dest_dir)
161 @cd $(pdk_generated_source_dir) && chmod ug+rx *
162 @rm -f $(pdk_generated_source_dir)/index.html
Mike Ritter0025ca42009-04-14 13:36:43 -0700163 # Fix a doxygen bug: in *-source.html file insert '</div>\n' after line 25
Mike Ritteraa2d9522009-04-29 09:19:32 -0700164 # @$(pdk_hosting_dir)/edoxfix.sh $(pdk_generated_source_dir)
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800165 @cp -fp $(pdk_generated_source_dir)/* $(pdk_docs_dest_dir)
Mike Ritter0025ca42009-04-14 13:36:43 -0700166 @rm $(pdk_generated_source_dir)/*
Mike Ritterdfa54942009-04-01 17:30:12 -0700167
168
169# ==== docs for the web (on the google app engine server) =======================
170# Run javadoc/droiddoc/clearsilver to get the formatting right
171
172# make droiddocs run after we make our doxygen docs
Mike Ritter0025ca42009-04-14 13:36:43 -0700173$(pdk_docs_intermediates)/pdk-timestamp: pdk_doxygen all_copied_pdk_templates
Mike Ritterdfa54942009-04-01 17:30:12 -0700174 @touch $(pdk_docs_intermediates)/pdk-timestamp
175
176$(LOCAL_PATH)/pdk-timestamp: $(pdk_docs_intermediates)/pdk-timestamp
177
178include $(CLEAR_VARS)
179
180LOCAL_SRC_FILES := pdk-timestamp samples/samplejni/src/com/example/jniexample/JNIExample.java
181LOCAL_MODULE_CLASS := development/pdk/ndk/samples/samplejni/src/com/example/jniexample
182LOCAL_DROIDDOC_SOURCE_PATH := $(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Mike Ritteraa2d9522009-04-29 09:19:32 -0700183LOCAL_DROIDDOC_HTML_DIR := ../../../$(pdk_app_eng_root)
Mike Ritterdfa54942009-04-01 17:30:12 -0700184
185LOCAL_MODULE := online-pdk
186
Mike Ritteraa2d9522009-04-29 09:19:32 -0700187LOCAL_DROIDDOC_OPTIONS:= \
188 -toroot /online-pdk/ \
David Warren2b15cf12009-04-30 17:23:42 -0700189 -hdf android.whichdoc online \
Mike Ritter925f5d22009-04-30 17:07:19 -0700190 -hdf android.whichmodule $(LOCAL_MODULE)
Mike Ritterdfa54942009-04-01 17:30:12 -0700191
192LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-pdk
193LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets-pdk
194
195include $(BUILD_DROIDDOC)
196
197# The docs output dir is: out/target/common/docs/online-pdk
198DOCS_OUT_DIR := $(OUT_DOCS)/$(LOCAL_MODULE)
199
Mike Ritter0025ca42009-04-14 13:36:43 -0700200# Copy appengine server files for new system
201$(OUT_DOCS)/app.yaml: $(pdk_hosting_dir)/app.yaml
202 @echo "PDK: $@"
203 $(copy-file-to-target-with-cp)
204
205$(OUT_DOCS)/pdk.py: $(pdk_hosting_dir)/pdk.py
206 @echo "PDK: $@"
207 $(copy-file-to-target-with-cp)
208
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800209# Name the tar files
210name := android_pdk_docs-$(REQUESTED_PRODUCT)
211ifeq ($(TARGET_BUILD_TYPE),debug)
212 name := $(name)_debug
213endif
214name := $(name)-$(BUILD_NUMBER)
215pdk_docs_tarfile := $(pdk_docs_intermediates)/$(name).tar
216pdk_docs_tarfile_zipped := $(pdk_docs_tarfile).gz
217
Mike Ritterdfa54942009-04-01 17:30:12 -0700218.PHONY: pdk pdk_docs pdk_doxygen all_copied_pdk_headers all_copied_pdk_templates pdk-timestamp
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800219
Mike Ritter0025ca42009-04-14 13:36:43 -0700220pdk_docs: $(pdk_docs_tarfile_zipped) $(pdk_docs_tarfile)
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800221 @echo "PDK: Docs tarred and zipped"
222
223# Put the pdk_docs zip files in the distribution directory
224$(call dist-for-goals,pdk_docs,$(pdk_docs_tarfile_zipped))
225
226# zip up tar files
227%.tar.gz: %.tar
Mike Ritterdfa54942009-04-01 17:30:12 -0700228 @echo "PDK docs: zipped $<"
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800229 $(hide) gzip -cf $< > $@
230
231# tar up all the files to make the pdk docs.
Mike Ritter0025ca42009-04-14 13:36:43 -0700232$(pdk_docs_tarfile): $(DOCS_OUT_DIR)-timestamp $(OUT_DOCS)/app.yaml $(OUT_DOCS)/pdk.py
Mike Ritterdfa54942009-04-01 17:30:12 -0700233 @echo "PDK docs: $@"
234 @mkdir -p $(dir $@)
235 @rm -f $@
Mike Ritteraa2d9522009-04-29 09:19:32 -0700236 $(hide) tar rf $@ -C $(OUT_DOCS) $(LOCAL_MODULE) pdk.py app.yaml
Mike Ritterdfa54942009-04-01 17:30:12 -0700237
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800238# Debugging reporting can go here, add it as a target to get output.
239pdk_debug:
240 @echo "You are here: $@"
241 @echo "pdk headers copied: $(all_copied_pdk_headers)"
242 @echo "pdk headers: $(pdk_headers)"
243 @echo "pdk docs dest: $(pdk_docs_dest_dir)"
244 @echo "config dest: $(pdk_doxygen_config_file)"
245 @echo "config src: $(pdk_config_dir)/pdk_config.conf"
246 @echo "pdk templates: $(pdk_templates_dir)"