# Generated automatically from Makefile.in by configure.
# Copyright (c) 2001-2002 IBM, Inc. and others
#
# File
#    icu/source/samples/ufortune/resources/Makefile
#
# Usage:
#    See the instructions in the parent Makefile,
#          icu/source/samples/ufortune/Makefile.
#          This subproject builds the ICU resource files for ufortune.
#          It is normally invoked from the parent directory,
#            although the resources can be built from here.
#
#    Two ICU tools are run from this makefile:
#      genrb    compiles a resource source file (.txt) into
#               a binary .res file.
#      pkgdata  combines all of the .res files into a single
#               shared library that can then be linked with the
#               main application.
#
#               pkgdata will recursively generate and run yet
#               another makefile, which in turn runs two more
#               icu tools.  gencmn combines the individual .res
#               files, and genccode emits the data as C source
#               code that can then be built into a .so
#

#
PLATFORM = LINUX
CC  = gcc
CXX = g++
CXXVER = 
GCC = yes
GXX = yes
CXXFLAGS =   -g -DPROJ_XMLPARSER  -DPROJ_XMLUTIL  -DPROJ_PARSERS  -DPROJ_SAX4C  -DPROJ_SAX2  -DPROJ_DOM -DPROJ_DEPRECATED_DOM -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER -DXML_USE_PTHREADS -DXML_USE_NETACCESSOR_SOCKET  
CFLAGS =   -g -DPROJ_XMLPARSER  -DPROJ_XMLUTIL  -DPROJ_PARSERS  -DPROJ_SAX4C  -DPROJ_SAX2  -DPROJ_DOM -DPROJ_DEPRECATED_DOM -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER -DXML_USE_PTHREADS -DXML_USE_NETACCESSOR_SOCKET   
PREFIX = /home/gmf/build/dbxml-2.3.11/dbxml-2.3.10/install
PREFIX_INCLUDE = ${PREFIX}/include/xercesc
LDFLAGS =    
LIBS =   -lpthread 
OSVER = 
USELIBWWW = 
MESSAGELOADER = INMEM
TRANSCODER = NATIVE
THREADS = pthread

include ../../../../../../version.incl
include ../../../../Makefile.incl

####################################################################
# Load ICU information. You can copy this to other makefiles #######
####################################################################
CC=$(shell icu-config --cc)
CXX=$(shell icu-config --cxx)
CPPFLAGS=$(shell icu-config --cppflags)
CFLAGS=$(shell icu-config --cflags)
CXXFLAGS=$(shell icu-config --cxxflags)
LDFLAGS =$(shell icu-config --ldflags)
LDFLAGS_USTDIO =$(shell icu-config --ldflags-ustdio)
INVOKE=$(shell icu-config --invoke)
#GENRB=$(shell icu-config --invoke=genrb)
GENRB=genrb
GENRBOPT=--package-name $(PKGNAME)
#PKGDATA=$(shell icu-config --invoke=pkgdata)
PKGDATA=pkgdata
SO=$(shell icu-config --so)
PKGDATAOPTS=-v -d .
# default - resources in same mode as ICU
# RESMODE=$(shell icu-config --icudata-mode)

####################################################################
### Project independent things (common) 
### We depend on gmake for the bulk of the work 

RMV=rm -rf

# No conventional target - this dir is resources only.
TARGET=
CLEANFILES += *.mak *.[co] *.lst *.a *.$(SO) $(RESFILES) *.ao README*resources.txt

RESMODE=dll

# Resource shortname
RESNAME=XercesMessages
PKGNAME=XercesMessages$(VER)

RESLDFLAGS=
CHECK_VARS= ICU_DATA=$(RESDIR)

# DLL and static modes are identical here
RESLDFLAGS= -L$(RESDIR) -l$(RESNAME)
RESCPPFLAGS=
CHECK_VARS=

# target file for resource bundle - this must be set, or 'make all' won't
# build any resources.
RESLIBNAME=lib$(RESNAME)
RESTARGET=lib$(RESNAME)$(ICUSHLIBSUFFIX)
PKGTARGET=lib$(PKGNAME)$(ICUSHLIBSUFFIX)

# Resource files.  Add new ones for additional locales here.
# keep in sync with the file RESLIST
RESFILES=$(RESNAME)_en_US.res

# list of resource bundles  - keep in sync with RESFILES
RESLIST=res-file-list-unix.txt

# list of targets that aren't actually created
.PHONY: all clean distclean check report 

all: $(ALL_SUBDIR) $(RESTARGET) $(TARGET)  

$(TARGET): $(OBJECTS)
	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(XTRALIBS)

$(RESTARGET): $(RESFILES)
	@echo building ${FQ_RESLIB_REAL_NAME}
	$(PKGDATA) --name $(PKGNAME) --mode $(RESMODE) $(PKGDATAOPTS) $(RESLIST)
	mv $(PKGTARGET) $(RESTARGET)
	mv $(RESTARGET) ${FQ_RESLIB_REAL_NAME}
	@echo symlink ${FQ_RESLIB_SO_NAME}
	ln -s ${FQ_RESLIB_REAL_NAME} ${FQ_RESLIB_SO_NAME}
	@echo symlink ${FQ_RESLIB_LINK_NAME}
	ln -s ${FQ_RESLIB_SO_NAME} ${FQ_RESLIB_LINK_NAME}
	
res-install: $(RESTARGET)
	$(PKGDATA) --name $(PKGNAME) --mode $(RESMODE) $(PKGDATAOPTS) $(RESLIST) --install $(shell icu-config --libdir)

# clean out files
distclean clean: $(CLEAN_SUBDIR)
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
	-rm $(OBJECTS) $(TARGET) $(RESTARGET) $(RESFILES)

# Make check: simply runs the sample, logged to a file
check: $(TARGET)
	$(INVOKE) $(CHECK_VARS) ./$(TARGET) $(CHECK_ARGS) | tee $(TARGET).out

## resources
$(RESNAME)_%.res: %.txt
	@echo "generating $@"
	$(GENRB) $(GENRBOPT) $^

#end of rules.mk

# for installing the library
install: res-install

