1# -*- makefile -*- 2# 3# Copyright (C) 2017 and later: Unicode, Inc. and others. 4# License & terms of use: http://www.unicode.org/copyright.html 5# 6# Copyright (C) 2012 IBM Corporation and Others. All Rights Reserved. 7## Name of the app 8 9TARGET=icu4jscan 10 11all: 12 @echo To build and list "'" $(OUTFILES) "'" in "'" $(J_GOOD) "'" use "$(MAKE) check" 13 14## Setup multicu 15MULTICU_ROOT=../../ 16include $(MULTICU_ROOT)/j/Makefile-j.inc 17 18 19## The output files. Will result in: out/3_8.txt out/4_0.txt etc. 20OUT=jxml 21OUTFILES=$(J_GOOD:%=$(OUT)/%.txt) 22 23.PRECIOUS: $(C_CLEAN_TARGET) 24 25## Generate a file 26$(OUT)/%.txt: $(OUT) $(C_INS)/%/bin/$(TARGET) 27 $(shell $(C_INS)/$*/bin/icu-config --invoke) $(C_INS)/$*/bin/$(TARGET) > $@ 28 29## clean 30clean: 31 -rm -f $(C_CLEAN_TARGET) 32 -rm -f ./$(OUT)/* 33 -rmdir $(OUT) 34 35 36## Test: generate out files, and print them. 37check: $(OUTFILES) 38 @for file in $(OUTFILES); \ 39 do \ 40 echo; \ 41 sed -e "s%^%$$file: %g" < $$file; \ 42 done 43 44MULTICU_ROOT=../../ 45include $(MULTICU_ROOT)/common/Makefile-multi.inc 46 47XML=./xml 48 49JVMXML=./jvmxml 50JVM=$(MULTICU_ROOT)/j/jvm 51JVM_CFG=.sh 52JVMSH:=$(wildcard $(JVM)/[0-9]*$(JVM_CFG)) 53 54ALLICUS=$(ICUVERS:%=$(BLD)/%/$(S_BLD)) 55IICUS=$(ICUVERS:%=$(INS)/%/$(S_INS)) 56ALLAPPS=$(ICUVERS:%=$(INS)/%/bin/$(TARGET)) 57ALLXMLS=$(ICUVERS:%=$(XML)/%.xml) 58COOKED=cooked 59INPUT=input 60INTROXMLS=$(wildcard $(INPUT)/*-introduction.xml) 61FEATXMLS=$(INTROXMLS:$(INPUT)/%-introduction.xml=$(COOKED)/%-cooked.xml) $(COOKED)/characters.xml 62ALLCOOKED=cooked/features.xml 63 64JXML=./jxml 65#ICU4JVERS 66ALLICU4JS=$(ICU4JVERS:%=$(ICUS)/icu4j-%.jar) 67ALLJXMLS=$(J_GOOD:%=$(JXML)/%.xml) 68JSCAN=ScanICU 69alljxmls: $(JXML) $(ALLJXMLS) 70JSCANDIR=../icu4jscan 71JCLASSFILE=$(JSCANDIR)/bin/com/ibm/icu/dev/scan/$(JSCAN).class 72JScanPackage=com.ibm.icu.dev.scan 73ALLJVM=$(JVMSH:$(JVM)/%$(JVM_CFG)=%) 74ALLJVMXMLS=$(ALLJVM:%=$(JVMXML)/%.xml) 75JVMSCAN=ScanJava 76alljvmxmls: $(JVMXML) $(ALLJVMXMLS) 77JVMCLASSFILE=$(JSCANDIR)/bin/com/ibm/icu/dev/scan/$(JVMSCAN).class 78 79 80# java stuff 81JAVA=java 82MergerName=Merger 83PropagateName=PropagateFeatures 84PropagateCharsName=PropagateCharacters 85MergerPackage=com.ibm.icu.dev.meta 86MergerPackageSlash=$(subst .,/,$(MergerPackage)) 87## ICUMETA=/xsrl/E/data/meta (in Makefile.local) 88MergerLib=$(ICUMETA)/lib 89MergerJar=$(ICUMETA)/icumeta.jar 90#was: $(ICUMETA)/classes 91MergerClassPath=$(shell ls $(MergerLib)/*.jar | tr '\n' ':')$(MergerJar):$(OTHERJARS) 92include Makefile.local 93MergerBuild=$(ICUMETA)/build.xml 94#MergerClass=$(ICUMETA)/classes/$(MergerPackageSlash)/$(MergerName).class 95#MergerJava=$(ICUMETA)/src/$(MergerPackageSlash)/$(MergerName).java 96#BASEXMLS=$(ICUMETA)/xml/icumeta.xml 97BASEXMLS=$(ICUMETA)/input/versions.xml 98 99 100APRECIOUS=$(ICUVERS:%=$(BLD)/%/$(S_SRC)) $(ICUVERS:%=$(BLD)/%/$(S_BLD)) $(ICUVERS:%=$(INS)/%/$(S_INS)) 101 102.PRECIOUS: $(APRECIOUS) 103 104tehprecious: 105 echo $(APRECIOUS) 106 107$(MergerJar): 108 ( cd $(ICUMETA) ; ant jar ) 109 110$(BLD): 111 -mkdir $(BLD) 112 113$(INS)/%/$(S_INS): $(BLD)/%/$(S_BLD) 114 @if [ -f $(BLD)/$*/build.err ]; then echo Error for $* stored in $(BLD)/$*/build.err; false; fi 115 ( make $(MAKE_OPTS) -C $(BLD)/$*/icu/source 2>&1 all install | tee $(BLD)/$*/build.log ) || ( mv $(BLD)/$*/build.log $(BLD)/$*/build.err ; false ) 116 touch -c $@ 117 118$(BLD)/%/$(S_SRC): $(ICUS)/icu4c-%-src.tgz 119 -mv $(BLD)/$* $(BLD)/$*.old 120 -( rm -rf ./$(BLD)/$*.old& ) 121 mkdir -p $(BLD)/$* 122 ( cd $(BLD)/$* ; tar xfpz $(DOT)/$^ ) 123 ([ -f patch/$* ] && patch -d $(BLD)/$* -p1 < $(DOT)/patch/$*) || true 124 touch -c $@ 125 126$(BLD)/%/$(S_BLD): $(BLD)/%/$(S_SRC) 127 -mkdir -p $(INS) 128 ( cd $(BLD)/$*/icu/source ; ./configure --disable-renaming --enable-shared --disable-static --enable-release --disable-debug --prefix=$(DOT)/$(INS)/$* ) 129 touch -c $@ 130 131$(INS)/%/bin/$(TARGET): $(INS)/%/$(S_INS) $(SRCS) 132 -rm -rf ./$(BLD)/$*/tmp 133 mkdir ./$(BLD)/$*/tmp 134 @for file in $(OBJECTS); \ 135 do \ 136 what=`basename $$file .o` ; \ 137 echo compiling $*/$$what ; \ 138 $(CXX) -c -o ./$(BLD)/$*/tmp/$$what.o $$what.cpp -I $(INS)/$*/include -I $(BLD)/$*/icu/source/tools/toolutil ; \ 139 done 140 $(CXX) -o $@ $(OBJECTS:%.o=./$(BLD)/$*/tmp/%.o) -licudata -licuuc -licutu -licui18n -L$(INS)/$*/lib 141 142$(XML): 143 mkdir $(XML) 144 145$(JXML): 146 mkdir $(JXML) 147 148ifeq ($(JVMSH),) 149JVMSH_WARN=warn-jvmsh 150warn-jvmsh: 151 @echo "Note: No $(JVM)/*$(JVM_CFG) files found, see $(JVM)/readme.txt" 152endif 153 154 155$(JVMXML): 156 mkdir $(JVMXML) 157 158$(XML)/%.xml: $(INS)/%/bin/$(TARGET) $(XML) 159 $(shell $(INS)/$*/bin/icu-config --invoke) $(INS)/$*/bin/$(TARGET) > $@ 160 161allxmls: $(ALLXMLS) | $(OUT) 162 163alljvmxmls: $(ALLJVMXMLS) $(JVMSH_WARN) | $(JVMXML) 164 165allapps: $(BLD) $(ALLAPPS) 166 167allicus: $(BLD) $(ALLICUS) 168 169clean-allapps: 170 -rm -f $(ALLAPPS) 171 172iicus: $(BLD) $(IICUS) 173 174DTDCACHE=$(shell pwd)/dtdcache 175DTDTMP=$(shell pwd)/dtdtmp 176DTDOVR=$(ICUMETA)/dtd 177JAVADEBUG=-DCLDR_DTD_CACHE_DEBUG=n -DCLDR_DTD_CACHE_ADEBUG=n 178JAVAPROPS= -DCLDR_DTD_CACHE=$(DTDCACHE) -DCLDR_DTD_OVERRIDE=$(DTDOVR) -DICU_DTD_CACHE=$(DTDCACHE) -DICU_DTD_OVERRIDE=$DTDOVR 179 180#//$(DTD)/Makefile: $(ICUMETA)/dtd/Makfile 181#// ln -s $^ $@ 182#// 183#//dtd/icucaps.dtd: $(DTD)/Makefile dtd/icucaps.rnc 184#// make -C $(DTD) 185 186ICUMETA_XML=$(ICUMETA)/xml/icumeta.xml 187 188#$(ICUMETA)/xml/icumeta.xml: $(MergerBuild) 189# ( cd $(ICUMETA) ; ant xml ) 190 191featxmls: $(FEATXMLS) 192 193allcooked: $(ALLCOOKED) 194 195$(ALLCOOKED): $(FEATXMLS) $(MergerJar) 196 -rm -rf ./dtdcache 197 mkdir dtdcache 198 $(JAVA) $(JAVAPROPS) -classpath $(MergerClassPath) $(MergerPackage).$(MergerName) -v -o:$@ $(FEATXMLS) 199 200$(COOKED)/%-cooked.xml: $(ICUMETA_XML) $(INPUT)/%-introduction.xml $(MergerJar) 201 -rm -rf ./dtdcache 202 mkdir dtdcache 203 $(JAVA) $(JAVAPROPS) -classpath $(MergerClassPath) $(MergerPackage).$(PropagateName) $(ICUMETA_XML) $(INPUT)/$*-introduction.xml > $(COOKED)/$*-cooked.xml 204 205$(COOKED)/characters.xml: $(ALLJXMLS) $(ALLXMLS) $(MergerJar) 206 $(JAVA) $(JAVAPROPS) -classpath $(MergerClassPath) $(MergerPackage).$(PropagateCharsName) > $@ $(ALLJXMLS) $(ALLXMLS) || (rm ./$@ ; false) 207 208 209icucaps.xml: $(BASEXMLS) $(ALLJXMLS) $(ALLXMLS) $(MergerJar) $(ALLCOOKED) 210 -rm -rf ./dtdcache 211 mkdir dtdcache 212# -rm -rf ./dtdtmp 213# mkdir dtdtmp 214# ln -s $(ICUMETA)/dtd/*.dtd ./dtdtmp/ 215# ln -s ./dtd/*.dtd ./dtdtmp/ 216 $(JAVA) $(JAVAPROPS) -classpath $(MergerClassPath) $(MergerPackage).$(MergerName) -v -o:$@ $(BASEXMLS) $(ALLXMLS) $(ALLJXMLS) $(ALLCOOKED) 217 218# --- J 219 220$(JXML)/%.xml: $(JCLASSFILE) $(ICUS)/icu4j-%.jar | $(JXML) 221 $(JAVA) -classpath $(JSCANDIR)/bin:$(ICUS)/icu4j-$*.jar:$(JSCANDIR)/lib/icumeta.jar:$(JSCANDIR)/lib/xalan.jar:$(JSCANDIR)/lib/cldr.jar:$(JSCANDIR)/lib/utilities.jar:$(MergerJar):$(MergerLib)/utilities.jar:$(MergerLib)/cldr.jar:$(JSCANDIR)/lib/xerces.jar:$(OTHERJARS) $(JScanPackage).$(JSCAN) > $@ || (rm -f ./$@ ; false) 222 223$(JVMXML)/%.xml: $(JVMCLASSFILE) $(JVM)/%$(JVM_CFG) | $(JVMXML) 224 $(JVM)/invoke.sh $(JVM)/$*$(JVM_CFG) $(JSCANDIR)/bin:$(ICUS)/icu4j-$*.jar:$(JSCANDIR)/lib/icumeta.jar:$(JSCANDIR)/lib/xalan.jar:$(JSCANDIR)/lib/cldr.jar:$(MergerJar):$(MergerJar):$(MergerLib)/utilities.jar:$(MergerLib)/cldr.jar:$(JSCANDIR)/lib/utilities.jar:$(JSCANDIR)/lib/xerces.jar:$(OTHERJARS) $(JScanPackage).$(JVMSCAN) > $@ || (rm ./$@ ; false) 225 226## Just generate 227outfiles: $(XML) $(JXML) $(ALLJXMLS) $(ALLJVMXMLS) 228