2000-09-11 05:59:51 +00:00
|
|
|
# Copyright (c) 2000 IBM, Inc. and others
|
2002-05-10 20:32:34 +00:00
|
|
|
# conversion sample code $Revision: 1.6 $
|
2000-09-11 05:59:51 +00:00
|
|
|
# Usage:
|
2002-05-10 20:32:34 +00:00
|
|
|
# - configure, build, install ICU
|
|
|
|
# - ensure that 'icu-config' is in the PATH (PREFIX/bin/icu-config)
|
|
|
|
# - if ICU is not built relative to this directory,
|
|
|
|
# set the variable ICU_PATH to the 'icu' directory
|
|
|
|
# (i.e. /foo/icu )
|
2000-09-11 05:59:51 +00:00
|
|
|
# - do 'make' in this directory
|
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
include ../defs.mk
|
2000-09-11 05:59:51 +00:00
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
ICU_DEFAULT_PATH=../../..
|
2000-09-11 05:59:51 +00:00
|
|
|
|
|
|
|
ifeq ($(strip $(ICU_PATH)),)
|
|
|
|
ICU_PATH=$(ICU_DEFAULT_PATH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
GENRBOPT = -s. -d.
|
|
|
|
|
|
|
|
# Name of your target
|
|
|
|
TARGET=uresb
|
|
|
|
RESOURCES = root.res en.res sr.res
|
|
|
|
|
|
|
|
# All object files (C or C++)
|
|
|
|
OBJECTS=uresb.o
|
|
|
|
|
|
|
|
CLEANFILES=*~ $(TARGET).out
|
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
all: $(RESOURCES) $(TARGET)
|
2002-04-15 23:32:30 +00:00
|
|
|
|
|
|
|
uresb.o: $(ICU_PATH)/source/tools/toolutil/uoptions.h
|
2000-09-11 05:59:51 +00:00
|
|
|
|
|
|
|
$(ICU_PATH)/source/tools/toolutil/uoptions.h:
|
|
|
|
@echo "Please read the directions at the top of this file (Makefile)"
|
|
|
|
@echo "Can't open $@ - check ICU_PATH"
|
|
|
|
@false
|
|
|
|
|
|
|
|
CPPFLAGS += -I$(ICU_PATH)/source/tools/toolutil
|
2002-05-10 20:32:34 +00:00
|
|
|
LDFLAGS += -L$(ICU_PATH)/source/tools/toolutil $(shell icu-config --ldflags-toolutil --ldflags-ustdio)
|
2000-09-11 05:59:51 +00:00
|
|
|
|
|
|
|
.PHONY: all clean distclean check report
|
|
|
|
|
|
|
|
distclean clean:
|
|
|
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
|
|
|
-$(RMV) $(OBJECTS) $(TARGET)
|
|
|
|
|
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
## resources
|
|
|
|
%.res: %.txt
|
2002-04-15 23:32:30 +00:00
|
|
|
@echo "generating $@"
|
2002-05-10 20:32:34 +00:00
|
|
|
$(GENRB) $(GENRBOPT) $^
|
2000-09-11 05:59:51 +00:00
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
## Special for a special codepage
|
2000-09-11 05:59:51 +00:00
|
|
|
sr.res : sr.txt
|
2002-04-15 23:32:30 +00:00
|
|
|
@echo "generating $@"
|
2000-09-11 05:59:51 +00:00
|
|
|
$(GENRB) $(GENRBOPT) -e cp1251 $?
|
|
|
|
|
|
|
|
# Can change this to LINK.c if it is a C only program
|
|
|
|
# Can add more libraries here.
|
|
|
|
$(TARGET): $(OBJECTS)
|
2002-05-10 20:32:34 +00:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2000-09-11 05:59:51 +00:00
|
|
|
|
|
|
|
# Make check: simply runs the sample, logged to a file
|
2002-04-15 23:32:30 +00:00
|
|
|
check: $(TARGET) $(RESOURCES)
|
|
|
|
$(INVOKE) ./$(TARGET) en | tee $(TARGET).out
|
2000-09-11 05:59:51 +00:00
|
|
|
|
|
|
|
# Make report: creates a 'report file' with both source and sample run
|
|
|
|
report: $(TARGET).report
|
|
|
|
|
|
|
|
$(TARGET).report: check $(TARGET).cpp
|
|
|
|
more $(TARGET).cpp $(TARGET).out > $@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|