Makefile revision 9838
##
# Makefile for generateing .po tarballs for Sun UI strings.
#
# Generates : $(PACKAGE)-po-sun-$(PO_VERSION).tar.bz2
# e.g. po-sun-tarballs/*.tar.bz2
#
# Usage :
# "make clean" : Remove previous tarballs
#
# "make" : Update all .po tarballs
#
# "make check-used" : Outputs list of .po not being used.
#
# "make check-version" : Prints current .po tarball version
#
# "make $(PACKAGE)-po-sun-$(PO_VERSION).tar.bz2
# e.g. "make gnome-panel-po-sun-0.1.tar.bz2"
# will only generate gnome-panel's .po tarball
#
# For each package that contains .po files.
# - Ensure all .po files for your package are located under the
# correct .po package dir i.e.
# $package/ja.po
#
# - Add Package name to PACKAGES Variable
# e.g. PACKAGES = \
# gnome-panel \
# your-package
#
# - Add two package specific variables
# PACKAGE_PAGES - Full path of all po for this package
# e.g. gnome-panel_PAGES = gnome-panel
# PACKAGE.PAGES - Assigned to $(PACKAGE_PAGES).
# e.g. gnome-panel.PAGES: $(gnome-panel_PAGES)
#
#
# To Add new .po files to existing packages
# -----------------------------------------
# Put very simply, all that is required from engineers is to make some changes
# and commit in SVN.
#
# - Ensure the .po file exists in SVN under the relevant package dir
# - Add .po files to the <package> directory
# e.g. For a new gnome-panel de.po file it would be added in
# gnome-panel/de.po
# - Remake tarballs
# $ make clean
# $ make
# This will re-generate all .po tarballs.
# - Copy newly generated tarball from po-sun-tarballs to package build
# sources e.g. /jds/packages/SOURCES, and ensure package builds and po
# install correctly.
# - New .po tarball will be generated by RE for each nightly, and for each
# milestone build.
# - Commit change back to subverison, e.g. new/amended man pagees,
# po-sun/Makefile, po-sun/package/*.po files if affected.
#
#
# PO_VERSION is maintained by L10N and only gets bumped when spec-files gets
# branched. PLEASE do not change this.
# %po_sun_version is also updated in l10n.inc
#
PO_VERSION=0.1
PO_DIR=po-sun
TARBALL_DIR=po-sun-tarballs
BZIP2=/usr/bin/bzip2
TAR=/usr/bin/tar
AWK=/usr/bin/awk
MAKE=/usr/sfw/bin/gmake
PACKAGES = \
gnome-menus \
gnome-panel \
gnome-utils \
metacity
all: TARBALLS
gnome-menus_PAGES = gnome-menus/po-sun
gnome-menus.PAGES: $(gnome-menus_PAGES)
gnome-panel_PAGES = gnome-panel/po-sun
gnome-panel.PAGES: $(gnome-panel_PAGES)
gnome-utils_PAGES = gnome-utils/po-sun
gnome-utils.PAGES: $(gnome-utils_PAGES)
metacity_PAGES = metacity/po-sun
metacity.PAGES: $(metacity_PAGES)
TARBALL_DIR_SUFFIX = po-sun-$(PO_VERSION)
.SUFFIXES: -$(TARBALL_DIR_SUFFIX).tar.bz2 .PAGES
.SUFFIXES: .check-used .PAGES
TARBALLS = $(TARBALL_DIR)/$(addsuffix -$(TARBALL_DIR_SUFFIX).tar.bz2, $(PACKAGES))
TARBALLS:
@test -d $(TARBALL_DIR) || mkdir -p "$(TARBALL_DIR)"
@test -x $(BZIP2) || echo "bzip2 utility not found"
@for package in $(PACKAGES); do \
if test ! -f $(TARBALL_DIR)/$$package-$(TARBALL_DIR_SUFFIX).tar.bz2; then \
$(MAKE) MAKE=\"$(MAKE)\" $$package-$(TARBALL_DIR_SUFFIX).tar.bz2; \
fi; \
done
%-$(TARBALL_DIR_SUFFIX).tar.bz2: %.PAGES
@test -d $(TARBALL_DIR) || mkdir -p "$(TARBALL_DIR)"
@if test -f $(TARBALL_DIR)/$@; then \
rm -f $(TARBALL_DIR)/$@; \
fi
@test -d $(PO_DIR) || mkdir -p "$(PO_DIR)"
@rm -rf $(PO_DIR)/*
@for po_dir in $($(subst .PAGES,_PAGES,$<)); do \
cp -R $$po_dir "$(PO_DIR)"; \
base_po_dir=`basename $$po_dir`; \
cp Makefile.template "$(PO_DIR)"/$$base_po_dir/Makefile; \
done;
@cd "$(PO_DIR)"; \
tarball=`basename "$@" .bz2`; echo "Making tarball $$tarball"; \
$(TAR) -cf ../$(TARBALL_DIR)/$$tarball *; \
$(BZIP2) ../$(TARBALL_DIR)/$$tarball; \
cd ..
@rm -rf $(PO_DIR)
check-used:
@test -d check-used-po-sun || mkdir -p "check-used-po-sun"
@test -d check-all-po-sun || mkdir -p "check-all-po-sun"
@rm -f unused-po-sun.txt
@for package in $(PACKAGES); do \
$(MAKE) MAKE=\"$(MAKE)\" $$package.check-used; \
done
@rm -rf check-all-po-sun
@rm -rf check-used-po-sun
%.check-used: %.PAGES
@for package in $($(subst .PAGES,_PAGES,$<)); do \
touch check-used-po-sun/$$package; \
done
check-version:
@echo $(PO_VERSION)
clean:
rm -rf $(PO_DIR)
rm -rf $(TARBALL_DIR)