michael@0: ## ****************************************************************************** michael@0: ## * michael@0: ## * Copyright (C) 1999-2012, International Business Machines michael@0: ## * Corporation and others. All Rights Reserved. michael@0: ## * michael@0: ## ******************************************************************************* michael@0: ## Makefile.in for ICU - uconv michael@0: ## Steven R. Loomis michael@0: michael@0: ## Set the following to dll or static or common.. michael@0: UCONVMSG_MODE=static michael@0: ############################################################## michael@0: michael@0: srcdir=@srcdir@ michael@0: top_srcdir=@top_srcdir@ michael@0: michael@0: top_builddir = ../.. michael@0: subdir = extra/uconv michael@0: michael@0: include $(top_builddir)/icudefs.mk michael@0: michael@0: MSGNAME=uconvmsg michael@0: michael@0: # RESSRC comes from resfiles.mk michael@0: FILESEPCHAR=/ michael@0: include $(srcdir)/resfiles.mk michael@0: michael@0: RESDIR=$(MSGNAME) michael@0: RESFILES=$(RESSRC:$(RESOURCESDIR)$(FILESEPCHAR)%.txt=$(RESDIR)/%.res) michael@0: michael@0: ## michael@0: michael@0: TARGET_STUB_NAME = uconv michael@0: michael@0: SECTION = 1 michael@0: michael@0: ALL_MAN_FILES = $(TARGET_STUB_NAME).$(SECTION) michael@0: michael@0: ## Extra files to remove for 'make clean' michael@0: CLEANFILES = *~ $(DEPS) $(ALL_MAN_FILES) michael@0: michael@0: ## Target information michael@0: TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT) michael@0: michael@0: CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(srcdir)/../toolutil michael@0: LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) michael@0: michael@0: ifeq ($(PKGDATA_OPTS),) michael@0: PKGDATA_OPTS = -O pkgdata.inc michael@0: endif michael@0: michael@0: ## generic settings for data - common. michael@0: PKGMODE=common michael@0: INSTALLTO=$(DESTDIR)$(ICUDATA_DIR) michael@0: UCONVMSG_LIB=package-resfiles michael@0: michael@0: ## Static mode michael@0: ifeq ($(UCONVMSG_MODE),static) michael@0: DEFS += -DUCONVMSG_LINK=$(MSGNAME) michael@0: UCONVMSG_LIB = $(RESDIR)/$(LIBPREFIX)$(STATIC_PREFIX_WHEN_USED)$(MSGNAME).$(A) michael@0: LIBS += $(UCONVMSG_LIB) michael@0: PKGMODE=static michael@0: INSTALLTO=$(libdir) michael@0: endif michael@0: michael@0: ## DLL mode michael@0: ifeq ($(UCONVMSG_MODE),dll) michael@0: DEFS += -DUCONVMSG_LINK=$(MSGNAME) michael@0: LIBS += -L$(RESDIR) -l$(MSGNAME) michael@0: PKGMODE=dll michael@0: INSTALLTO=$(libdir) michael@0: endif michael@0: michael@0: OBJECTS = uconv.o uwmsg.o michael@0: michael@0: DEPS = $(OBJECTS:.o=.d) michael@0: michael@0: ## List of phony targets michael@0: .PHONY : all all-local install install-local clean clean-local \ michael@0: distclean resclean distclean-local dist dist-local \ michael@0: check check-local build-dir package-resfiles install-resfiles install-man michael@0: michael@0: ## Clear suffix list michael@0: .SUFFIXES : michael@0: michael@0: ## List of standard targets michael@0: all: all-local michael@0: michael@0: install: install-local michael@0: clean: clean-local michael@0: distclean : distclean-local michael@0: dist: dist-local michael@0: check: check-local michael@0: michael@0: all-local: build-dir $(TARGET) $(ALL_MAN_FILES) michael@0: michael@0: install-local: all-local install-target install-resfiles install-man michael@0: michael@0: install-target: all-local michael@0: $(MKINSTALLDIRS) $(DESTDIR)$(bindir) michael@0: $(INSTALL) $(TARGET) $(DESTDIR)$(bindir) michael@0: michael@0: dist-local: michael@0: michael@0: clean-local: resclean michael@0: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) $(RESFILES) michael@0: $(RMV) $(OBJECTS) $(TARGET) michael@0: michael@0: resclean: michael@0: @#-$(INVOKE) $(TOOLBINDIR)/pkgdata --clean -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst michael@0: $(RMV) pkgdata.inc $(RESDIR) michael@0: michael@0: distclean-local: clean-local michael@0: $(RMV) Makefile $(DEPS) michael@0: michael@0: check-local: $(TARGET) michael@0: ifneq (,$(filter $(PKGDATA_MODE),files common)) michael@0: @echo "Currently, pkgdata is in \"$(PKGDATA_MODE)\" mode." michael@0: @echo "To test uconv, run this manually after installing ICU:" michael@0: @echo "\"./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt\"" michael@0: else michael@0: $(INVOKE) ./$(TARGET) -f ibm-37 $(srcdir)/samples/ibm-37-test.txt michael@0: endif michael@0: michael@0: Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status michael@0: cd $(top_builddir) \ michael@0: && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status michael@0: michael@0: pkgdata.inc: pkgdataMakefile michael@0: $(MAKE) -f pkgdataMakefile michael@0: michael@0: build-dir: michael@0: @$(MKINSTALLDIRS) $(RESDIR) michael@0: michael@0: pkgdataMakefile: michael@0: cd $(top_builddir) \ michael@0: && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status michael@0: michael@0: $(TARGET_STUB_NAME).$(SECTION): $(srcdir)/$(TARGET_STUB_NAME).$(SECTION).in pkgdata.inc michael@0: cd $(top_builddir) \ michael@0: && CONFIG_FILES=$(subdir)/$(TARGET_STUB_NAME).$(SECTION) CONFIG_HEADERS= $(SHELL) ./config.status michael@0: michael@0: $(TARGET) : $(OBJECTS) $(UCONVMSG_LIB) michael@0: $(LINK.cc) $(OUTOPT)$@ $(OBJECTS) $(LIBS) michael@0: $(POST_BUILD_STEP) michael@0: michael@0: # The | is an order-only prerequisite. This helps when the -j option is used, michael@0: # and we don't want the files to be built before the directories are built. michael@0: ifneq ($(filter order-only,$(.FEATURES)),) michael@0: $(RESFILES) $(RESDIR)/$(RESDIR).lst: | build-dir michael@0: endif michael@0: michael@0: $(UCONVMSG_LIB): $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc michael@0: $(INVOKE) $(PKGDATA_INVOKE_OPTS) $(TOOLBINDIR)/pkgdata -p $(MSGNAME) $(PKGDATA_OPTS) -m $(PKGMODE) -s $(RESDIR) -d $(RESDIR) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst michael@0: michael@0: $(RESDIR)/$(RESDIR).lst: Makefile $(srcdir)/resfiles.mk michael@0: @-$(RMV) $@ michael@0: @for file in $(RESFILES:$(RESDIR)/%.res=%.res); do \ michael@0: echo $$file >> $@; \ michael@0: done; michael@0: michael@0: # no install for static mode michael@0: ifneq ($(UCONVMSG_MODE),static) michael@0: install-resfiles: $(RESFILES) $(RESDIR)/$(RESDIR).lst pkgdata.inc michael@0: $(MKINSTALLDIRS) $(DESTDIR)$(ICUDATA_DIR) michael@0: $(INVOKE) $(TOOLBINDIR)/pkgdata -p $(RESDIR) -O pkgdata.inc -m $(PKGMODE) -d $(RESDIR) -I $(INSTALLTO) -T $(RESDIR) $(RESDIR)/$(RESDIR).lst michael@0: else michael@0: install-resfiles: michael@0: endif michael@0: michael@0: $(MSGNAME)/%.res: $(srcdir)/$(RESOURCESDIR)/%.txt michael@0: $(INVOKE) $(TOOLBINDIR)/genrb -e UTF-8 -s $(^D) -d $(@D) $(^F) michael@0: michael@0: install-man: $(ALL_MAN_FILES) michael@0: $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) michael@0: $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) michael@0: michael@0: michael@0: