blob: afe4dc6653c865d73b9ea07ca483ad03d1865033 [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)
Mike Ritter429fbd82009-05-19 11:28:10 -070018# (TODO) Figure out why $(ACP) builds with target pndk but not pdk_docs
The Android Open Source Project52d4c302009-03-03 19:29:09 -080019
20pdk:
Mike Ritter429fbd82009-05-19 11:28:10 -070021 @echo "Package: $@ has targets pndk, pdk_docs and pdk_all"
The Android Open Source Project52d4c302009-03-03 19:29:09 -080022
Mike Ritter429fbd82009-05-19 11:28:10 -070023pdk_all: pndk pdk_docs
The Android Open Source Project52d4c302009-03-03 19:29:09 -080024 @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.
Mike Ritter429fbd82009-05-19 11:28:10 -070031# This include adds /pndk to LOCAL_PATH, so can't use it afterwards...
32include $(LOCAL_PATH)/pndk/Pndk.mk
The Android Open Source Project52d4c302009-03-03 19:29:09 -080033
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
Reena Leec3c74792009-05-18 22:34:25 -070053pdk_hardware_dir := hardware/libhardware/include/hardware
Dan Morrilleeb79232010-03-25 14:33:53 -070054pdk_camera_dir := frameworks/base/include/camera
The Android Open Source Project52d4c302009-03-03 19:29:09 -080055
56# Destination directory for docs (templates + doxygenated headers)
Dan Morrill3cd199f2009-11-06 14:04:16 -080057pdk_docs_dest_dir := $(pdk_docs_intermediates)/docs/porting
Mike Ritteraa2d9522009-04-29 09:19:32 -070058pdk_app_eng_root := $(pdk_docs_intermediates)/docs
The Android Open Source Project52d4c302009-03-03 19:29:09 -080059
60# Working directory for source to be doxygenated
61pdk_doxy_source_dir := $(pdk_docs_intermediates)/sources
62
63# Working directory for html, et al. after doxygination
64pdk_generated_source_dir := $(pdk_docs_intermediates)/generatedDocs/html
65
66# Working directory for .dox files
67pdk_doxy_docsfiles_dir := $(pdk_docs_intermediates)/docsfiles
68
69# Doxygen version to use, so we can override it on the command line
Mike Ritter0025ca42009-04-14 13:36:43 -070070# doxygen 1.5.6 working, the latest version get-apt installable on ghardy.
71# with bug fix for </div> error.
The Android Open Source Project52d4c302009-03-03 19:29:09 -080072doxygen_version = doxygen
73
74#-------------------------------------------------------------------------------
75# Header files to doxygenize.
76# Add new header files to document here, also adjust the templates to have
77# descriptions for the new headers and point to the new doxygen created html.
78pdk_headers := \
79 $(pdk_legacy_hardware_dir)/AudioHardwareInterface.h \
Dan Morrillf7977962010-04-13 16:24:08 -070080 $(pdk_hardware_dir)/gps.h \
The Android Open Source Project52d4c302009-03-03 19:29:09 -080081 $(pdk_legacy_hardware_dir)/wifi.h \
Reena Leec3c74792009-05-18 22:34:25 -070082 $(pdk_camera_dir)/CameraHardwareInterface.h \
Reena Leee557a732009-05-20 08:04:39 -070083 $(pdk_hardware_dir)/sensors.h \
84 $(pdk_hardware_dir)/lights.h
The Android Open Source Project52d4c302009-03-03 19:29:09 -080085
86# Create a rule to copy the list of PDK headers to be doxyginated.
87# copy-one-header defines the actual rule.
88$(foreach header,$(pdk_headers), \
89 $(eval _chFrom := $(header)) \
90 $(eval _chTo := $(pdk_doxy_source_dir)/$(notdir $(header))) \
91 $(eval $(call copy-one-header,$(_chFrom),$(_chTo))) \
92 $(eval all_copied_pdk_headers: $(_chTo)) \
93 )
94_chFrom :=
95_chTo :=
96
97
98#-------------------------------------------------------------------------------
99# Assemble all the necessary doxygen config files and the sources into the
100# working directories
101
102pdk_templates := $(shell find $(pdk_templates_dir) -type f)
103
104# Create a rule to copy the list of PDK doc templates.
105# copy-one-file defines the actual rule.
106$(foreach template,$(pdk_templates), \
107 $(eval _chFrom := $(template)) \
Mike Ritteraa2d9522009-04-29 09:19:32 -0700108 $(eval _chTo := $(pdk_app_eng_root)/$(patsubst $(pdk_templates_dir)/%,%,$(template))) \
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800109 $(eval $(call copy-one-header,$(_chFrom),$(_chTo))) \
110 $(eval all_copied_pdk_templates: $(_chTo)) \
111 )
112_chFrom :=
113_chTo :=
114
115# Copy newer doxygen config file (basic configs, should not change very often.)
116pdk_doxygen_config_file := $(pdk_docs_intermediates)/pdk_config.conf
117$(pdk_doxygen_config_file): $(pdk_config_dir)/pdk_config.conf
118 @echo "PDK: $@"
119 $(copy-file-to-target-with-cp)
120
121# Copy newer doxygen override config file (may change these more often.)
122pdk_doxygen_config_override_file := $(pdk_docs_intermediates)/overrideconfig.conf
123$(pdk_doxygen_config_override_file): $(pdk_config_dir)/overrideconfig.conf
124 @echo "PDK: $@"
125 $(copy-file-to-target-with-cp)
126
127# (TODO) Get the latest templates
128# Copy newer doxygen html files.
129$(pdk_docs_intermediates)/header.html: $(pdk_config_dir)/header.html
130 @echo "PDK: $@"
131 $(copy-file-to-target-with-cp)
132
133$(pdk_docs_intermediates)/footer.html: $(pdk_config_dir)/footer.html
134 @echo "PDK: $@"
135 $(copy-file-to-target-with-cp)
136
137# Copy newer doxygen .dox files
138$(pdk_doxy_docsfiles_dir)/groups.dox: $(pdk_docsfile_dir)/groups.dox
139 @echo "PDK: $@"
140 $(copy-file-to-target-with-cp)
141
142$(pdk_doxy_docsfiles_dir)/main.dox: $(pdk_docsfile_dir)/main.dox
143 @echo "PDK: $@"
144 $(copy-file-to-target-with-cp)
145
Mike Ritterdfa54942009-04-01 17:30:12 -0700146# All the files that we depend upon
147all_pdk_docs_files := $(pdk_doxygen_config_override_file) \
148 $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \
149 $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \
Mike Ritter0025ca42009-04-14 13:36:43 -0700150 $(pdk_doxy_docsfiles_dir)/main.dox all_copied_pdk_templates \
151 all_copied_pdk_headers
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800152
153# Run doxygen and copy all output and templates to the final destination
154# We replace index.html with a template file so don't use the generated one
155pdk_doxygen: all_copied_pdk_headers $(pdk_doxygen_config_override_file) \
156 $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \
157 $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \
Mike Ritterdfa54942009-04-01 17:30:12 -0700158 $(pdk_doxy_docsfiles_dir)/main.dox
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800159 @echo "Files for Doxygination: $^"
160 @mkdir -p $(pdk_generated_source_dir)
161 @rm -f $(pdk_generated_source_dir)/*
162 @cd $(pdk_docs_intermediates) && $(doxygen_version) pdk_config.conf
163 @mkdir -p $(pdk_docs_dest_dir)
164 @cd $(pdk_generated_source_dir) && chmod ug+rx *
165 @rm -f $(pdk_generated_source_dir)/index.html
Mike Ritter0025ca42009-04-14 13:36:43 -0700166 # Fix a doxygen bug: in *-source.html file insert '</div>\n' after line 25
Mike Ritteraa2d9522009-04-29 09:19:32 -0700167 # @$(pdk_hosting_dir)/edoxfix.sh $(pdk_generated_source_dir)
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800168 @cp -fp $(pdk_generated_source_dir)/* $(pdk_docs_dest_dir)
Mike Ritter0025ca42009-04-14 13:36:43 -0700169 @rm $(pdk_generated_source_dir)/*
Mike Ritterdfa54942009-04-01 17:30:12 -0700170
171
172# ==== docs for the web (on the google app engine server) =======================
173# Run javadoc/droiddoc/clearsilver to get the formatting right
174
175# make droiddocs run after we make our doxygen docs
Mike Ritter0025ca42009-04-14 13:36:43 -0700176$(pdk_docs_intermediates)/pdk-timestamp: pdk_doxygen all_copied_pdk_templates
Mike Ritterdfa54942009-04-01 17:30:12 -0700177 @touch $(pdk_docs_intermediates)/pdk-timestamp
178
179$(LOCAL_PATH)/pdk-timestamp: $(pdk_docs_intermediates)/pdk-timestamp
180
181include $(CLEAR_VARS)
182
183LOCAL_SRC_FILES := pdk-timestamp samples/samplejni/src/com/example/jniexample/JNIExample.java
Mike Ritter429fbd82009-05-19 11:28:10 -0700184LOCAL_MODULE_CLASS := development/pdk/pndk/samples/samplejni/src/com/example/jniexample
Mike Ritteraa2d9522009-04-29 09:19:32 -0700185LOCAL_DROIDDOC_HTML_DIR := ../../../$(pdk_app_eng_root)
Mike Ritterdfa54942009-04-01 17:30:12 -0700186
187LOCAL_MODULE := online-pdk
188
Mike Ritteraa2d9522009-04-29 09:19:32 -0700189LOCAL_DROIDDOC_OPTIONS:= \
Dan Morrill3cd199f2009-11-06 14:04:16 -0800190 -toroot / \
David Warren2b15cf12009-04-30 17:23:42 -0700191 -hdf android.whichdoc online \
Mike Ritter925f5d22009-04-30 17:07:19 -0700192 -hdf android.whichmodule $(LOCAL_MODULE)
Mike Ritterdfa54942009-04-01 17:30:12 -0700193
194LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-pdk
Dan Morrill3cd199f2009-11-06 14:04:16 -0800195LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets
Mike Ritterdfa54942009-04-01 17:30:12 -0700196
197include $(BUILD_DROIDDOC)
198
199# The docs output dir is: out/target/common/docs/online-pdk
200DOCS_OUT_DIR := $(OUT_DOCS)/$(LOCAL_MODULE)
201
Mike Ritter0025ca42009-04-14 13:36:43 -0700202# Copy appengine server files for new system
203$(OUT_DOCS)/app.yaml: $(pdk_hosting_dir)/app.yaml
204 @echo "PDK: $@"
205 $(copy-file-to-target-with-cp)
206
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800207# Name the tar files
208name := android_pdk_docs-$(REQUESTED_PRODUCT)
209ifeq ($(TARGET_BUILD_TYPE),debug)
210 name := $(name)_debug
211endif
212name := $(name)-$(BUILD_NUMBER)
213pdk_docs_tarfile := $(pdk_docs_intermediates)/$(name).tar
214pdk_docs_tarfile_zipped := $(pdk_docs_tarfile).gz
215
Mike Ritterdfa54942009-04-01 17:30:12 -0700216.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 -0800217
Mike Ritter0025ca42009-04-14 13:36:43 -0700218pdk_docs: $(pdk_docs_tarfile_zipped) $(pdk_docs_tarfile)
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800219 @echo "PDK: Docs tarred and zipped"
220
221# Put the pdk_docs zip files in the distribution directory
222$(call dist-for-goals,pdk_docs,$(pdk_docs_tarfile_zipped))
223
224# zip up tar files
225%.tar.gz: %.tar
Mike Ritterdfa54942009-04-01 17:30:12 -0700226 @echo "PDK docs: zipped $<"
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800227 $(hide) gzip -cf $< > $@
228
229# tar up all the files to make the pdk docs.
Dan Morrill3cd199f2009-11-06 14:04:16 -0800230$(pdk_docs_tarfile): $(DOCS_OUT_DIR)-timestamp $(OUT_DOCS)/app.yaml
Mike Ritterdfa54942009-04-01 17:30:12 -0700231 @echo "PDK docs: $@"
232 @mkdir -p $(dir $@)
233 @rm -f $@
Dan Morrill3cd199f2009-11-06 14:04:16 -0800234 $(hide) tar rf $@ -C $(OUT_DOCS) $(LOCAL_MODULE) app.yaml
Mike Ritterdfa54942009-04-01 17:30:12 -0700235
The Android Open Source Project52d4c302009-03-03 19:29:09 -0800236# Debugging reporting can go here, add it as a target to get output.
237pdk_debug:
238 @echo "You are here: $@"
239 @echo "pdk headers copied: $(all_copied_pdk_headers)"
240 @echo "pdk headers: $(pdk_headers)"
241 @echo "pdk docs dest: $(pdk_docs_dest_dir)"
242 @echo "config dest: $(pdk_doxygen_config_file)"
243 @echo "config src: $(pdk_config_dir)/pdk_config.conf"
244 @echo "pdk templates: $(pdk_templates_dir)"