Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / icu / source / samples / legacy / Makefile
1 # Copyright (c) 2001-2004 IBM, Inc. and others
2 # conversion sample code
3
4
5 # Usage:
6 #  - configure and build ICU [see the docs] .. use "--prefix=" something
7 #     (I  used --prefix=/home/srl/III )
8
9 #  - do 'make install' of icu 
10 #
11 #  - set the variable ICU_PREFIX to point at $(prefix)
12 #    (will look for $(prefix)/lib/icu/Makefile.inc )
13
14 #  - set the variable ICU_LEGACY  (read the README)
15 #   ( Will look for ICU_LEGACY/include/unicode/ucol.h )
16 #  
17 #  - do 'make' in this directory
18
19 #ICU_PREFIX=/home/weiv/build/current
20 #ICU_LEGACY = /home/weiv/build/icu-1-8-1
21
22 LEGACY_INCLUDE = $(ICU_LEGACY)/include
23
24 ICU_INC=$(ICU_PREFIX)/lib/icu/Makefile.inc
25 ICUPATH=
26
27 -include $(ICU_INC)
28
29 # Name of your target
30 TARGET=legacy
31
32 # All object files (C or C++)
33 OBJECTS=legacy.o newcol.o oldcol.o
34
35 CLEANFILES=*~ $(TARGET).out
36
37 DEPS=$(OBJECTS:.o=.d)
38
39 # turn on super warnings
40 #CPPFLAGS += -Wall
41
42 all: $(TARGET) $(ICU_INC)
43
44 .PHONY: all clean distclean check report
45
46 oldcol.o : oldcol.cpp $(LEGACY_INCLUDE)/unicode/ucol.h
47         $(CXX) -I$(LEGACY_INCLUDE) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c oldcol.cpp
48
49 distclean clean:
50         -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
51         -$(RMV) $(OBJECTS) $(TARGET)
52         -$(RMV) $(DEPS)
53
54 # Can change this to LINK.c if it is a C only program
55 # Can add more libraries here. 
56 $(TARGET): $(OBJECTS)
57         $(LINK.cc) -o $@ $^ $(ICULIBS) $(ICU_PREFIX)/lib/libicuuc.so.18 $(ICU_PREFIX)/lib/libicui18n.so.18 
58
59 # Make check: simply runs the sample, logged to a file
60 check: $(TARGET)
61         $(INVOKE) ./$(TARGET) | tee $(TARGET).out
62
63 # Make report: creates a 'report file' with both source and sample run
64 report: $(TARGET).report
65
66 $(TARGET).report: check $(TARGET).cpp
67         more $(TARGET).cpp $(TARGET).out > $@
68
69 $(ICU_INC):
70         @echo ICU_PREFIX variable is not set correctly
71         @echo "Please read the directions at the top of this file (Makefile)"
72         @echo "And the README"
73         @echo "Can't open $(ICU_INC)"
74         @false
75
76 $(LEGACY_INCLUDE)/unicode/ucol.h:
77         @echo ICU_LEGACY variable is not set correctly.
78         @echo "Please read the directions at the top of this file (Makefile)"
79         @echo "And the README"
80         @echo "Can't open $@"
81         @false
82
83 ifneq ($(MAKECMDGOALS),distclean)
84 -include $(DEPS)
85 endif