]> git.saurik.com Git - apple/icu.git/blame - icuSources/samples/uresb/Makefile
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / samples / uresb / Makefile
CommitLineData
73c04bcf 1# Copyright (c) 2000-2005 IBM, Inc. and others
374ca955 2# conversion sample code
b75a7d8f
A
3# Usage:
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
8# (i.e. /foo/icu )
9# - do 'make' in this directory
10
11include ../defs.mk
12
13ICU_DEFAULT_PATH=../../..
14
15ifeq ($(strip $(ICU_PATH)),)
16 ICU_PATH=$(ICU_DEFAULT_PATH)
17endif
18
73c04bcf 19GENRBOPT = -s. -d.
b75a7d8f
A
20
21# Name of your target
22TARGET=uresb
23PKG=$(TARGET)
24RES_SRC=root.txt en.txt sr.txt
73c04bcf 25RESOURCES=$(RES_SRC:%.txt=%.res)
b75a7d8f
A
26
27# All object files (C or C++)
28OBJECTS=uresb.o
29
30CLEANFILES=*~ $(TARGET).out
31
32all: $(RESOURCES) $(TARGET)
33
34uresb.o: $(ICU_PATH)/source/tools/toolutil/uoptions.h
35
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"
39 @false
40
41CPPFLAGS += -I$(ICU_PATH)/source/tools/toolutil
374ca955 42LDFLAGS += -L$(ICU_PATH)/source/tools/toolutil $(shell icu-config --ldflags-toolutil --ldflags-icuio)
b75a7d8f
A
43
44.PHONY: all clean distclean check report
45
46distclean clean:
47 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
73c04bcf 48 -$(RMV) $(OBJECTS) $(TARGET) $(RESOURCES)
b75a7d8f
A
49
50
51## resources
73c04bcf 52%.res: %.txt
b75a7d8f
A
53 @echo "generating $@"
54 $(GENRB) $(GENRBOPT) $^
55
56## Special for a special codepage
73c04bcf 57sr.res : sr.txt
b75a7d8f
A
58 @echo "generating $@"
59 $(GENRB) $(GENRBOPT) -e cp1251 $?
60
61# Can change this to LINK.c if it is a C only program
62# Can add more libraries here.
63$(TARGET): $(OBJECTS)
64 $(CC) -o $@ $^ $(LDFLAGS)
65
66# Make check: simply runs the sample, logged to a file
67check: $(TARGET) $(RESOURCES)
68 $(INVOKE) ./$(TARGET) en | tee $(TARGET).out
69
70# Make report: creates a 'report file' with both source and sample run
71report: $(TARGET).report
72
73$(TARGET).report: check $(TARGET).cpp
74 more $(TARGET).cpp $(TARGET).out > $@
75
76
77