Home | History | Annotate | Download | only in config
      1 #******************************************************************************
      2 #
      3 #   Copyright (C) 2010-2011, International Business Machines Corporation and others.  All Rights Reserved.
      4 #
      5 #******************************************************************************
      6 # This is to be called from ../Makefile.in
      7 #
      8 # This will only work if subversion is installed.
      9 
     10 top_builddir = .
     11 
     12 include $(top_builddir)/icudefs.mk
     13 
     14 
     15 DISTY_TMP=dist/tmp
     16 DISTY_ICU=$(DISTY_TMP)/icu
     17 DISTY_DATA=$(DISTY_ICU)/source/data
     18 DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone
     19 DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%)
     20 DISTY_IN=$(DISTY_DATA)/in
     21 DOCZIP=icu-docs.zip
     22 
     23 SVNTOP=$(top_srcdir)/..
     24 SVNDOT=$(SVNTOP)/.svn
     25 SVNVER=$(shell svnversion $(SVNTOP) | cut -d: -f1 | tr -cd 'a-zA-Z0-9')
     26 SVNURL=$(shell svn info $(SVNTOP) | grep '^URL:' | cut -d: -f2-)
     27 DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' )
     28 DISTY_PREFIX=icu4c
     29 DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR)
     30 DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).tgz
     31 DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).zip
     32 DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-docs-$(DISTY_VER)-r$(SVNVER).zip
     33 DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-data-$(DISTY_VER)-r$(SVNVER).zip
     34 DISTY_DAT=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat))
     35 
     36 DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP)
     37 DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP)
     38 
     39 $(SVNDOT):
     40 	@echo "ERROR: 'dist' will not work unless the parent of the top_srcdir ( $(SVNTOP) ) is checked out from svn, and svn is installed."
     41 	false
     42 
     43 $(DISTY_FILE_DIR):
     44 	$(MKINSTALLDIRS) $(DISTY_FILE_DIR)
     45 
     46 $(DISTY_TMP):
     47 	$(MKINSTALLDIRS) $(DISTY_TMP)
     48 
     49 $(DISTY_DOC_ZIP): $(SVNDOT) $(DOCZIP) $(DISTY_FILE_DIR)
     50 	cp $(DOCZIP) $(DISTY_DOC_ZIP)
     51 
     52 $(DISTY_DAT): 
     53 	echo Missing $@
     54 	/bin/false
     55 
     56 $(DOCZIP):
     57 	$(MAKE) -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@
     58 
     59 $(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP): $(SVNDOT) $(DISTY_DAT) $(DISTY_TMP)
     60 	@echo "svnversion of $(SVNTOP) is as follows (if this fails, make sure svn is installed..)"
     61 	svnversion $(SVNTOP)
     62 	-$(RMV) $(DISTY_FILE) $(DISTY_TMP)
     63 	$(MKINSTALLDIRS) $(DISTY_TMP)
     64 	svn export -r $(shell echo $(SVNVER) | tr -d 'a-zA-Z' ) $(SVNURL) "$(DISTY_TMP)/icu"
     65 	( cd $(DISTY_TMP)/icu/source ; zip -rlq $(DISTY_DATA_ZIP) data )
     66 	$(RMV) $(DISTY_RMDIR)
     67 	$(MKINSTALLDIRS) $(DISTY_IN)
     68 	cp $(DISTY_DAT) $(DISTY_IN)
     69 	( cd $(DISTY_TMP)/icu ; python as_is/bomlist.py > as_is/bomlist.txt || rm -f as_is/bomlist.txt )
     70 	( cd $(DISTY_TMP) ; tar cfpz $(DISTY_FILE_TGZ) icu )
     71 	( cd $(DISTY_TMP) ; zip -rlq $(DISTY_FILE_ZIP) icu )
     72 	ls -l $(DISTY_FILE)
     73 
     74 dist-local: $(DISTY_FILES)
     75 
     76 distcheck: distcheck-tgz
     77 
     78 DISTY_CHECK=$(DISTY_TMP)/check
     79 
     80 distcheck-tgz: $(DISTY_FILE_TGZ)
     81 	@echo Checking $(DISTY_FILE_TGZ)
     82 	@-$(RMV) $(DISTY_CHECK)
     83 	@$(MKINSTALLDIRS) $(DISTY_CHECK)
     84 	@(cd $(DISTY_CHECK) && tar xfpz $(DISTY_FILE_TGZ) && cd icu/source && $(SHELL) ./configure $(DISTCHECK_CONFIG_OPTIONS) && $(MAKE) check $(DISTCHECK_MAKE_OPTIONS) ) && (echo "!!! PASS: $(DISTY_FILE_TGZ)" )
     85