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