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) |
Mike Ritter | 429fbd8 | 2009-05-19 11:28:10 -0700 | [diff] [blame] | 18 | # (TODO) Figure out why $(ACP) builds with target pndk but not pdk_docs |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 19 | |
| 20 | pdk: |
Mike Ritter | 429fbd8 | 2009-05-19 11:28:10 -0700 | [diff] [blame] | 21 | @echo "Package: $@ has targets pndk, pdk_docs and pdk_all" |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 22 | |
Mike Ritter | 429fbd8 | 2009-05-19 11:28:10 -0700 | [diff] [blame] | 23 | pdk_all: pndk pdk_docs |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 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. |
Mike Ritter | 429fbd8 | 2009-05-19 11:28:10 -0700 | [diff] [blame] | 31 | # This include adds /pndk to LOCAL_PATH, so can't use it afterwards... |
| 32 | include $(LOCAL_PATH)/pndk/Pndk.mk |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 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 |
Reena Lee | c3c7479 | 2009-05-18 22:34:25 -0700 | [diff] [blame] | 53 | pdk_hardware_dir := hardware/libhardware/include/hardware |
Dan Morrill | eeb7923 | 2010-03-25 14:33:53 -0700 | [diff] [blame] | 54 | pdk_camera_dir := frameworks/base/include/camera |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 55 | |
| 56 | # Destination directory for docs (templates + doxygenated headers) |
Dan Morrill | 3cd199f | 2009-11-06 14:04:16 -0800 | [diff] [blame] | 57 | pdk_docs_dest_dir := $(pdk_docs_intermediates)/docs/porting |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 58 | pdk_app_eng_root := $(pdk_docs_intermediates)/docs |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 59 | |
| 60 | # Working directory for source to be doxygenated |
| 61 | pdk_doxy_source_dir := $(pdk_docs_intermediates)/sources |
| 62 | |
| 63 | # Working directory for html, et al. after doxygination |
| 64 | pdk_generated_source_dir := $(pdk_docs_intermediates)/generatedDocs/html |
| 65 | |
| 66 | # Working directory for .dox files |
| 67 | pdk_doxy_docsfiles_dir := $(pdk_docs_intermediates)/docsfiles |
| 68 | |
| 69 | # 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] | 70 | # doxygen 1.5.6 working, the latest version get-apt installable on ghardy. |
| 71 | # with bug fix for </div> error. |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 72 | doxygen_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. |
| 78 | pdk_headers := \ |
| 79 | $(pdk_legacy_hardware_dir)/AudioHardwareInterface.h \ |
Dan Morrill | f797796 | 2010-04-13 16:24:08 -0700 | [diff] [blame] | 80 | $(pdk_hardware_dir)/gps.h \ |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 81 | $(pdk_legacy_hardware_dir)/wifi.h \ |
Reena Lee | c3c7479 | 2009-05-18 22:34:25 -0700 | [diff] [blame] | 82 | $(pdk_camera_dir)/CameraHardwareInterface.h \ |
Reena Lee | e557a73 | 2009-05-20 08:04:39 -0700 | [diff] [blame] | 83 | $(pdk_hardware_dir)/sensors.h \ |
| 84 | $(pdk_hardware_dir)/lights.h |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 85 | |
| 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 | |
| 102 | pdk_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 Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 108 | $(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] | 109 | $(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.) |
| 116 | pdk_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.) |
| 122 | pdk_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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 146 | # All the files that we depend upon |
| 147 | all_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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 150 | $(pdk_doxy_docsfiles_dir)/main.dox all_copied_pdk_templates \ |
| 151 | all_copied_pdk_headers |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 152 | |
| 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 |
| 155 | pdk_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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 158 | $(pdk_doxy_docsfiles_dir)/main.dox |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 159 | @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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 166 | # 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] | 167 | # @$(pdk_hosting_dir)/edoxfix.sh $(pdk_generated_source_dir) |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 168 | @cp -fp $(pdk_generated_source_dir)/* $(pdk_docs_dest_dir) |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 169 | @rm $(pdk_generated_source_dir)/* |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 170 | |
| 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 Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 176 | $(pdk_docs_intermediates)/pdk-timestamp: pdk_doxygen all_copied_pdk_templates |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 177 | @touch $(pdk_docs_intermediates)/pdk-timestamp |
| 178 | |
| 179 | $(LOCAL_PATH)/pdk-timestamp: $(pdk_docs_intermediates)/pdk-timestamp |
| 180 | |
| 181 | include $(CLEAR_VARS) |
| 182 | |
| 183 | LOCAL_SRC_FILES := pdk-timestamp samples/samplejni/src/com/example/jniexample/JNIExample.java |
Mike Ritter | 429fbd8 | 2009-05-19 11:28:10 -0700 | [diff] [blame] | 184 | LOCAL_MODULE_CLASS := development/pdk/pndk/samples/samplejni/src/com/example/jniexample |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 185 | LOCAL_DROIDDOC_HTML_DIR := ../../../$(pdk_app_eng_root) |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 186 | |
| 187 | LOCAL_MODULE := online-pdk |
| 188 | |
Mike Ritter | aa2d952 | 2009-04-29 09:19:32 -0700 | [diff] [blame] | 189 | LOCAL_DROIDDOC_OPTIONS:= \ |
Dan Morrill | 3cd199f | 2009-11-06 14:04:16 -0800 | [diff] [blame] | 190 | -toroot / \ |
David Warren | 2b15cf1 | 2009-04-30 17:23:42 -0700 | [diff] [blame] | 191 | -hdf android.whichdoc online \ |
Mike Ritter | 925f5d2 | 2009-04-30 17:07:19 -0700 | [diff] [blame] | 192 | -hdf android.whichmodule $(LOCAL_MODULE) |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 193 | |
| 194 | LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-pdk |
Dan Morrill | 3cd199f | 2009-11-06 14:04:16 -0800 | [diff] [blame] | 195 | LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 196 | |
| 197 | include $(BUILD_DROIDDOC) |
| 198 | |
| 199 | # The docs output dir is: out/target/common/docs/online-pdk |
| 200 | DOCS_OUT_DIR := $(OUT_DOCS)/$(LOCAL_MODULE) |
| 201 | |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 202 | # 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 Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 207 | # Name the tar files |
| 208 | name := android_pdk_docs-$(REQUESTED_PRODUCT) |
| 209 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 210 | name := $(name)_debug |
| 211 | endif |
| 212 | name := $(name)-$(BUILD_NUMBER) |
| 213 | pdk_docs_tarfile := $(pdk_docs_intermediates)/$(name).tar |
| 214 | pdk_docs_tarfile_zipped := $(pdk_docs_tarfile).gz |
| 215 | |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 216 | .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] | 217 | |
Mike Ritter | 0025ca4 | 2009-04-14 13:36:43 -0700 | [diff] [blame] | 218 | pdk_docs: $(pdk_docs_tarfile_zipped) $(pdk_docs_tarfile) |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 219 | @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 Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 226 | @echo "PDK docs: zipped $<" |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 227 | $(hide) gzip -cf $< > $@ |
| 228 | |
| 229 | # tar up all the files to make the pdk docs. |
Dan Morrill | 3cd199f | 2009-11-06 14:04:16 -0800 | [diff] [blame] | 230 | $(pdk_docs_tarfile): $(DOCS_OUT_DIR)-timestamp $(OUT_DOCS)/app.yaml |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 231 | @echo "PDK docs: $@" |
| 232 | @mkdir -p $(dir $@) |
| 233 | @rm -f $@ |
Dan Morrill | 3cd199f | 2009-11-06 14:04:16 -0800 | [diff] [blame] | 234 | $(hide) tar rf $@ -C $(OUT_DOCS) $(LOCAL_MODULE) app.yaml |
Mike Ritter | dfa5494 | 2009-04-01 17:30:12 -0700 | [diff] [blame] | 235 | |
The Android Open Source Project | 52d4c30 | 2009-03-03 19:29:09 -0800 | [diff] [blame] | 236 | # Debugging reporting can go here, add it as a target to get output. |
| 237 | pdk_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)" |