xref: /trunk/main/oox/source/token/Makefile (revision b63233d8)
1###############################################################
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20###############################################################
21
22
23
24# generate source and header files from text files ----------------------------
25
26SRCDIR_TOKEN := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
27WORKDIR_TOKEN := .
28
29include $(GBUILDDIR)/Output.mk
30include $(GBUILDDIR)/BuildDirs.mk
31include $(GBUILDDIR)/Helper.mk
32
33# XML namespace identifiers and names
34
35$(WORKDIR_TOKEN)/namespaces.hxx : $(SRCDIR_TOKEN)/namespaces.hxx.head $(WORKDIR_TOKEN)/namespaceids.inc $(SRCDIR_TOKEN)/namespaces.hxx.tail
36	$(call gb_Output_announce,$@,build,CAT,1)
37	$(call gb_Helper_abbreviate_dirs,cat $^ > $@)
38
39$(WORKDIR_TOKEN)/namespaceids.inc : $(SRCDIR_TOKEN)/namespaces.txt $(SRCDIR_TOKEN)/namespaces.pl
40	$(call gb_Output_announce,$@,build,PRL,1)
41	$(call gb_Helper_abbreviate_dirs, \
42		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/namespaces.pl 1 < $< > $@ \
43	)
44
45$(WORKDIR_TOKEN)/namespacenames.inc : $(SRCDIR_TOKEN)/namespaces.txt $(SRCDIR_TOKEN)/namespaces.pl
46	$(call gb_Output_announce,$@,build,PRL,1)
47	$(call gb_Helper_abbreviate_dirs, \
48		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/namespaces.pl 2 < $< > $@ \
49	)
50
51$(WORKDIR_TOKEN)/namespaces.txt : $(SRCDIR_TOKEN)/namespaces.txt $(SRCDIR_TOKEN)/namespaces.pl
52	$(call gb_Output_announce,$@,build,PRL,1)
53	$(call gb_Helper_abbreviate_dirs, \
54		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/namespaces.pl 3 < $< > $@ \
55	)
56
57# XML token identifiers and names
58
59$(WORKDIR_TOKEN)/tokens.hxx : $(SRCDIR_TOKEN)/tokens.hxx.head $(WORKDIR_TOKEN)/tokenids.inc $(SRCDIR_TOKEN)/tokens.hxx.tail
60	$(call gb_Output_announce,$@,build,CAT,1)
61	$(call gb_Helper_abbreviate_dirs,cat $^ > $@)
62
63$(WORKDIR_TOKEN)/tokenids.inc : $(SRCDIR_TOKEN)/tokens.txt $(SRCDIR_TOKEN)/tokens.pl
64	$(call gb_Output_announce,$@,build,PRL,1)
65	$(call gb_Helper_abbreviate_dirs, \
66		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/tokens.pl 1 < $< > $@ \
67	)
68
69$(WORKDIR_TOKEN)/tokennames.inc : $(SRCDIR_TOKEN)/tokens.txt $(SRCDIR_TOKEN)/tokens.pl
70	$(call gb_Output_announce,$@,build,PRL,1)
71	$(call gb_Helper_abbreviate_dirs, \
72		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/tokens.pl 2 < $< > $@ \
73	)
74
75$(WORKDIR_TOKEN)/tokenhash.inc : $(WORKDIR_TOKEN)/tokenhash.gperf
76	$(call gb_Output_announce,$@,build,GPF,3)
77	$(call gb_Helper_abbreviate_dirs, \
78		gperf $< | $(gb_AWK) -- '{ if ($$0 !~ /^#line/){ gsub("\\(char\\*\\)0", "0", $$0); print; } }' > $@ \
79	)
80
81$(WORKDIR_TOKEN)/tokenhash.gperf : $(SRCDIR_TOKEN)/tokens.txt $(SRCDIR_TOKEN)/tokens.pl
82	$(call gb_Output_announce,$@,build,PRL,1)
83	$(call gb_Helper_abbreviate_dirs, \
84		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/tokens.pl 3 < $< > $@ \
85	)
86
87# UNO property identifiers and names
88
89$(WORKDIR_TOKEN)/properties.hxx : $(SRCDIR_TOKEN)/properties.hxx.head $(WORKDIR_TOKEN)/propertyids.inc $(SRCDIR_TOKEN)/properties.hxx.tail
90	$(call gb_Output_announce,$@,build,CAT,1)
91	$(call gb_Helper_abbreviate_dirs,cat $^ > $@)
92
93$(WORKDIR_TOKEN)/propertyids.inc : $(SRCDIR_TOKEN)/properties.txt $(SRCDIR_TOKEN)/properties.pl
94	$(call gb_Output_announce,$@,build,PRL,1)
95	$(call gb_Helper_abbreviate_dirs, \
96		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/properties.pl 1 < $< > $@ \
97	)
98
99$(WORKDIR_TOKEN)/propertynames.inc : $(SRCDIR_TOKEN)/properties.txt $(SRCDIR_TOKEN)/properties.pl
100	$(call gb_Output_announce,$@,build,PRL,1)
101	$(call gb_Helper_abbreviate_dirs, \
102		mkdir -p $(dir $@) && $(PERL) $(SRCDIR_TOKEN)/properties.pl 2 < $< > $@ \
103	)
104
105.DEFAULT_GOAL:=all
106.PHONY: all
107all : \
108		namespaces.hxx \
109		namespaceids.inc \
110		namespacenames.inc \
111		namespaces.txt \
112		tokens.hxx \
113		tokenids.inc \
114		tokennames.inc \
115		tokenhash.inc \
116		tokenhash.gperf \
117		properties.hxx \
118		propertyids.inc \
119		propertynames.inc \
120
121
122# vim: set noet sw=4 ts=4:
123