1 # Copyright (c) 2000 IBM, Inc. and others
2 # conversion sample code $Revision: 1.1.1.1 $
4 # - configure, build, install ICU
5 # - ensure that 'icu-config' is in the PATH (PREFIX/bin/icu-config)
6 # - if ICU is not built relative to this directory,
7 # set the variable ICU_PATH to the 'icu' directory
9 # - do 'make' in this directory
13 ICU_DEFAULT_PATH=../../..
15 ifeq ($(strip $(ICU_PATH)),)
16 ICU_PATH=$(ICU_DEFAULT_PATH)
19 GENRBOPT = -s. -d. --package-name $(PKG)
24 RES_SRC=root.txt en.txt sr.txt
25 RESOURCES=$(RES_SRC:%.txt=$(PKG)_%.res)
27 # All object files (C or C++)
30 CLEANFILES=*~ $(TARGET).out
32 all: $(RESOURCES) $(TARGET)
34 uresb.o: $(ICU_PATH)/source/tools/toolutil/uoptions.h
36 $(ICU_PATH)/source/tools/toolutil/uoptions.h:
37 @echo "Please read the directions at the top of this file (Makefile)"
38 @echo "Can't open $@ - check ICU_PATH"
41 CPPFLAGS += -I$(ICU_PATH)/source/tools/toolutil
42 LDFLAGS += -L$(ICU_PATH)/source/tools/toolutil $(shell icu-config --ldflags-toolutil --ldflags-ustdio)
44 .PHONY: all clean distclean check report
47 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
48 -$(RMV) $(OBJECTS) $(TARGET)
54 $(GENRB) $(GENRBOPT) $^
56 ## Special for a special codepage
57 $(PKG)_sr.res : sr.txt
59 $(GENRB) $(GENRBOPT) -e cp1251 $?
61 # Can change this to LINK.c if it is a C only program
62 # Can add more libraries here.
64 $(CC) -o $@ $^ $(LDFLAGS)
66 # Make check: simply runs the sample, logged to a file
67 check: $(TARGET) $(RESOURCES)
68 $(INVOKE) ./$(TARGET) en | tee $(TARGET).out
70 # Make report: creates a 'report file' with both source and sample run
71 report: $(TARGET).report
73 $(TARGET).report: check $(TARGET).cpp
74 more $(TARGET).cpp $(TARGET).out > $@