Move WebCore into Source
[WebKit-https.git] / Source / WebCore / Android.derived.mk
1 ##
2 ## Copyright 2009, The Android Open Source Project
3 ##
4 ## Redistribution and use in source and binary forms, with or without
5 ## modification, are permitted provided that the following conditions
6 ## are met:
7 ##  * Redistributions of source code must retain the above copyright
8 ##    notice, this list of conditions and the following disclaimer.
9 ##  * Redistributions in binary form must reproduce the above copyright
10 ##    notice, this list of conditions and the following disclaimer in the
11 ##    documentation and/or other materials provided with the distribution.
12 ##
13 ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14 ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 ## PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 ##
25
26 # CSS property names and value keywords
27
28 GEN := $(intermediates)/css/CSSPropertyNames.h
29 $(GEN): SCRIPT := $(LOCAL_PATH)/css/makeprop.pl
30 $(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.in $(LOCAL_PATH)/css/SVGCSSPropertyNames.in
31         @echo "Generating CSSPropertyNames.h <= CSSPropertyNames.in"
32         @mkdir -p $(dir $@)
33         @cat $< > $(dir $@)/$(notdir $<)
34 ifeq ($(ENABLE_SVG),true)
35         @cat $^ > $(@:%.h=%.in)
36 endif
37         @cp -f $(SCRIPT) $(dir $@)
38         @cd $(dir $@) ; perl ./$(notdir $(SCRIPT))
39 LOCAL_GENERATED_SOURCES += $(GEN)
40
41 GEN := $(intermediates)/css/CSSValueKeywords.h
42 $(GEN): SCRIPT := $(LOCAL_PATH)/css/makevalues.pl
43 $(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.in $(LOCAL_PATH)/css/SVGCSSValueKeywords.in
44         @echo "Generating CSSValueKeywords.h <= CSSValueKeywords.in"
45         @mkdir -p $(dir $@)
46         @cp -f $(SCRIPT) $(dir $@)
47 ifeq ($(ENABLE_SVG),true)    
48         @perl -ne 'print lc' $^ > $(@:%.h=%.in)
49 else
50         @perl -ne 'print lc' $< > $(@:%.h=%.in)
51 endif
52         @cd $(dir $@); perl makevalues.pl
53 LOCAL_GENERATED_SOURCES += $(GEN)
54
55
56 # DOCTYPE strings
57
58 GEN := $(intermediates)/html/DocTypeStrings.cpp
59 $(GEN): PRIVATE_CUSTOM_TOOL = gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards $< > $@
60 $(GEN): $(LOCAL_PATH)/html/DocTypeStrings.gperf
61         $(transform-generated-source)
62 # we have to do this dep by hand:
63 $(intermediates)/html/HTMLDocument.o : $(GEN)
64
65
66 # color names
67
68 GEN := $(intermediates)/platform/ColorData.c
69 $(GEN): PRIVATE_CUSTOM_TOOL = gperf -CDEot -L ANSI-C -k '*' -N findColor -D -s 2 $< > $@
70 $(GEN): $(LOCAL_PATH)/platform/ColorData.gperf
71         $(transform-generated-source)
72 LOCAL_GENERATED_SOURCES += $(GEN)
73
74
75 # CSS tokenizer
76
77 GEN := $(intermediates)/css/tokenizer.cpp
78 $(GEN): PRIVATE_CUSTOM_TOOL = $(OLD_FLEX) -t $< | perl $(dir $<)/maketokenizer > $@
79 $(GEN): $(LOCAL_PATH)/css/tokenizer.flex $(LOCAL_PATH)/css/maketokenizer
80         $(transform-generated-source)
81 # we have to do this dep by hand:
82 $(intermediates)/css/CSSParser.o : $(GEN)
83
84 # CSS grammar
85
86 GEN := $(intermediates)/CSSGrammar.cpp
87 $(GEN) : PRIVATE_YACCFLAGS := -p cssyy
88 $(GEN): $(LOCAL_PATH)/css/CSSGrammar.y
89         $(call local-transform-y-to-cpp,.cpp)
90 $(GEN): $(LOCAL_BISON)
91
92 LOCAL_GENERATED_SOURCES += $(GEN)
93
94 # user agent style sheets
95
96 style_sheets := $(LOCAL_PATH)/css/html.css $(LOCAL_PATH)/css/quirks.css $(LOCAL_PATH)/css/view-source.css $(LOCAL_PATH)/css/mediaControls.css
97 ifeq ($(ENABLE_SVG), true)
98 style_sheets := $(style_sheets) $(LOCAL_PATH)/css/svg.css
99 endif
100 GEN := $(intermediates)/css/UserAgentStyleSheets.h
101 make_css_file_arrays := $(LOCAL_PATH)/css/make-css-file-arrays.pl
102 $(GEN): PRIVATE_CUSTOM_TOOL = $< $@ $(basename $@).cpp $(filter %.css,$^)
103 $(GEN): $(make_css_file_arrays) $(style_sheets)
104         $(transform-generated-source)
105 LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp)
106
107 # character set name table
108
109 #gen_inputs := \
110                 $(LOCAL_PATH)/platform/make-charset-table.pl \
111                 $(LOCAL_PATH)/platform/character-sets.txt \
112                 $(LOCAL_PATH)/platform/android/android-encodings.txt
113 #GEN := $(intermediates)/platform/CharsetData.cpp
114 #$(GEN): PRIVATE_CUSTOM_TOOL = $^ "android::Encoding::ENCODING_" > $@
115 #$(GEN): $(gen_inputs)
116 #       $(transform-generated-source)
117 #LOCAL_GENERATED_SOURCES += $(GEN)
118
119 # the above rule will make this build too
120 $(intermediates)/css/UserAgentStyleSheets.cpp : $(GEN)
121
122 # XML attribute names
123
124 GEN:= $(intermediates)/XMLNSNames.cpp
125 $(GEN): PRIVATE_PATH := $(LOCAL_PATH)
126 $(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --attrs $(xmlns_attrs) --output $(dir $@) 
127 $(GEN): xmlns_attrs := $(LOCAL_PATH)/xml/xmlnsattrs.in
128 $(GEN): $(LOCAL_PATH)/dom/make_names.pl $(xmlns_attrs)
129         $(transform-generated-source)
130 LOCAL_GENERATED_SOURCES += $(GEN)
131
132 GEN:= $(intermediates)/XMLNames.cpp
133 $(GEN): PRIVATE_PATH := $(LOCAL_PATH)
134 $(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --attrs $(xml_attrs) --output $(dir $@) 
135 $(GEN): xml_attrs := $(LOCAL_PATH)/xml/xmlattrs.in
136 $(GEN): $(LOCAL_PATH)/dom/make_names.pl $(xml_attrs)
137         $(transform-generated-source)
138 LOCAL_GENERATED_SOURCES += $(GEN)
139
140 # XLink attribute names
141
142 ifeq ($(ENABLE_SVG), true)
143 GEN:= $(intermediates)/XLinkNames.cpp
144 $(GEN): PRIVATE_PATH := $(LOCAL_PATH)
145 $(GEN): PRIVATE_CUSTOM_TOOL = perl -I $(PRIVATE_PATH)/bindings/scripts $< --attrs $(xlink_attrs) --output $(dir $@) 
146 $(GEN): xlink_attrs := $(LOCAL_PATH)/svg/xlinkattrs.in
147 $(GEN): $(LOCAL_PATH)/dom/make_names.pl $(xlink_attrs)
148         $(transform-generated-source)
149 LOCAL_GENERATED_SOURCES += $(GEN)
150 endif