The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 1 | # |
| 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 Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 19 | |
| 20 | pdk: |
| 21 | @echo "Package: $@ has targets ndk, pdk_docs and pdk_all" |
| 22 | |
| 23 | pdk_all: ndk pdk_docs |
| 24 | @echo "Package: $^" |
| 25 | |
| 26 | LOCAL_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... |
| 32 | include $(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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 40 | # Run javadocs/droiddocs/clearsilver on the generatedDocs dir to get the right |
| 41 | # styles added to the html. |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 42 | |
| 43 | |
| 44 | # Workspace directory |
| 45 | pdk_docs_intermediates := $(call intermediates-dir-for,PACKAGING,pdkdocs) |
| 46 | |
| 47 | # Source directories for appengine, templates, config & header files |
| 48 | pdk_hosting_dir := development/pdk/hosting |
| 49 | pdk_templates_dir := development/pdk/docs |
| 50 | pdk_config_dir := development/pdk/doxygen_config |
| 51 | pdk_docsfile_dir := $(pdk_config_dir)/docsfiles |
| 52 | pdk_legacy_hardware_dir := hardware/libhardware_legacy/include/hardware_legacy |
| 53 | pdk_camera_dir := frameworks/base/include/ui |
| 54 | |
| 55 | # Destination directory for docs (templates + doxygenated headers) |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 56 | pdk_docs_dest_dir := $(pdk_docs_intermediates)/docs/guide |
| 57 | pdk_app_eng_root := $(pdk_docs_intermediates)/docs |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 58 | |
| 59 | # Working directory for source to be doxygenated |
| 60 | pdk_doxy_source_dir := $(pdk_docs_intermediates)/sources |
| 61 | |
| 62 | # Working directory for html, et al. after doxygination |
| 63 | pdk_generated_source_dir := $(pdk_docs_intermediates)/generatedDocs/html |
| 64 | |
| 65 | # Working directory for .dox files |
| 66 | pdk_doxy_docsfiles_dir := $(pdk_docs_intermediates)/docsfiles |
| 67 | |
| 68 | # Doxygen version to use, so we can override it on the command line |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 69 | # doxygen 1.5.6 working, the latest version get-apt installable on ghardy. |
| 70 | # with bug fix for </div> error. |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 71 | doxygen_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. |
| 77 | pdk_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 | |
| 99 | pdk_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 Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 105 | $(eval _chTo := $(pdk_app_eng_root)/$(patsubst $(pdk_templates_dir)/%,%,$(template))) \ |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 106 | $(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.) |
| 113 | pdk_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.) |
| 119 | pdk_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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 143 | # All the files that we depend upon |
| 144 | all_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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 147 | $(pdk_doxy_docsfiles_dir)/main.dox all_copied_pdk_templates \ |
| 148 | all_copied_pdk_headers |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 149 | |
| 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 |
| 152 | pdk_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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 155 | $(pdk_doxy_docsfiles_dir)/main.dox |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 156 | @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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 163 | # Fix a doxygen bug: in *-source.html file insert '</div>\n' after line 25 |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 164 | # @$(pdk_hosting_dir)/edoxfix.sh $(pdk_generated_source_dir) |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 165 | @cp -fp $(pdk_generated_source_dir)/* $(pdk_docs_dest_dir) |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 166 | @rm $(pdk_generated_source_dir)/* |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 167 | |
| 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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 173 | $(pdk_docs_intermediates)/pdk-timestamp: pdk_doxygen all_copied_pdk_templates |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 174 | @touch $(pdk_docs_intermediates)/pdk-timestamp |
| 175 | |
| 176 | $(LOCAL_PATH)/pdk-timestamp: $(pdk_docs_intermediates)/pdk-timestamp |
| 177 | |
| 178 | include $(CLEAR_VARS) |
| 179 | |
| 180 | LOCAL_SRC_FILES := pdk-timestamp samples/samplejni/src/com/example/jniexample/JNIExample.java |
| 181 | LOCAL_MODULE_CLASS := development/pdk/ndk/samples/samplejni/src/com/example/jniexample |
| 182 | LOCAL_DROIDDOC_SOURCE_PATH := $(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH) |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 183 | LOCAL_DROIDDOC_HTML_DIR := ../../../$(pdk_app_eng_root) |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 184 | |
| 185 | LOCAL_MODULE := online-pdk |
| 186 | |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 187 | LOCAL_DROIDDOC_OPTIONS:= \ |
| 188 | -toroot /online-pdk/ \ |
David Warren | 2b15cf1 | 2009-04-30 17:23:42 -0700 | [diff] [blame] | 189 | -hdf android.whichdoc online \ |
Mike Ritter | 925f5d2 | 2009-04-30 17:07:19 -0700 | [diff] [blame] | 190 | -hdf android.whichmodule $(LOCAL_MODULE) |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 191 | |
| 192 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-pdk |
| 193 | LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets-pdk |
| 194 | |
| 195 | include $(BUILD_DROIDDOC) |
| 196 | |
| 197 | # The docs output dir is: out/target/common/docs/online-pdk |
| 198 | DOCS_OUT_DIR := $(OUT_DOCS)/$(LOCAL_MODULE) |
| 199 | |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 200 | # 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 Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 209 | # Name the tar files |
| 210 | name := android_pdk_docs-$(REQUESTED_PRODUCT) |
| 211 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 212 | name := $(name)_debug |
| 213 | endif |
| 214 | name := $(name)-$(BUILD_NUMBER) |
| 215 | pdk_docs_tarfile := $(pdk_docs_intermediates)/$(name).tar |
| 216 | pdk_docs_tarfile_zipped := $(pdk_docs_tarfile).gz |
| 217 | |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 218 | .PHONY: pdk pdk_docs pdk_doxygen all_copied_pdk_headers all_copied_pdk_templates pdk-timestamp |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 219 | |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 220 | pdk_docs: $(pdk_docs_tarfile_zipped) $(pdk_docs_tarfile) |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 221 | @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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 228 | @echo "PDK docs: zipped $<" |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 229 | $(hide) gzip -cf $< > $@ |
| 230 | |
| 231 | # tar up all the files to make the pdk docs. |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 232 | $(pdk_docs_tarfile): $(DOCS_OUT_DIR)-timestamp $(OUT_DOCS)/app.yaml $(OUT_DOCS)/pdk.py |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 233 | @echo "PDK docs: $@" |
| 234 | @mkdir -p $(dir $@) |
| 235 | @rm -f $@ |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 236 | $(hide) tar rf $@ -C $(OUT_DOCS) $(LOCAL_MODULE) pdk.py app.yaml |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 237 | |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 238 | # Debugging reporting can go here, add it as a target to get output. |
| 239 | pdk_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)" |