2016-09-28 22:12:27 +00:00
|
|
|
# Copyright (C) 2016 and later: Unicode, Inc. and others.
|
|
|
|
# License & terms of use: http://www.unicode.org/copyright.html#License
|
|
|
|
#
|
2016-05-31 21:45:07 +00:00
|
|
|
# Copyright (c) 2001-2004 IBM, Inc. and others
|
2004-04-01 06:52:12 +00:00
|
|
|
# conversion sample code
|
2001-07-24 21:29:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Usage:
|
|
|
|
# - configure and build ICU [see the docs] .. use "--prefix=" something
|
|
|
|
# (I used --prefix=/home/srl/III )
|
|
|
|
#
|
|
|
|
# - do 'make install' of icu
|
|
|
|
#
|
2002-04-15 23:32:30 +00:00
|
|
|
# - set the variable ICU_PREFIX to point at $(prefix)
|
|
|
|
# (will look for $(prefix)/lib/icu/Makefile.inc )
|
|
|
|
#
|
|
|
|
# - set the variable ICU_LEGACY (read the README)
|
|
|
|
# ( Will look for ICU_LEGACY/include/unicode/ucol.h )
|
2001-07-24 21:29:50 +00:00
|
|
|
#
|
|
|
|
# - do 'make' in this directory
|
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
#ICU_PREFIX=/home/weiv/build/current
|
|
|
|
#ICU_LEGACY = /home/weiv/build/icu-1-8-1
|
2001-07-24 21:29:50 +00:00
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
LEGACY_INCLUDE = $(ICU_LEGACY)/include
|
2001-07-24 21:29:50 +00:00
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
ICU_INC=$(ICU_PREFIX)/lib/icu/Makefile.inc
|
2001-07-24 21:29:50 +00:00
|
|
|
ICUPATH=
|
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
-include $(ICU_INC)
|
2001-07-24 21:29:50 +00:00
|
|
|
|
|
|
|
# Name of your target
|
|
|
|
TARGET=legacy
|
|
|
|
|
|
|
|
# All object files (C or C++)
|
|
|
|
OBJECTS=legacy.o newcol.o oldcol.o
|
|
|
|
|
|
|
|
CLEANFILES=*~ $(TARGET).out
|
|
|
|
|
|
|
|
DEPS=$(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
# turn on super warnings
|
|
|
|
#CPPFLAGS += -Wall
|
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
all: $(TARGET) $(ICU_INC)
|
2001-07-24 21:29:50 +00:00
|
|
|
|
|
|
|
.PHONY: all clean distclean check report
|
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
oldcol.o : oldcol.cpp $(LEGACY_INCLUDE)/unicode/ucol.h
|
2001-07-24 21:29:50 +00:00
|
|
|
$(CXX) -I$(LEGACY_INCLUDE) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c oldcol.cpp
|
|
|
|
|
|
|
|
distclean clean:
|
|
|
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
|
|
|
-$(RMV) $(OBJECTS) $(TARGET)
|
|
|
|
-$(RMV) $(DEPS)
|
|
|
|
|
|
|
|
# Can change this to LINK.c if it is a C only program
|
|
|
|
# Can add more libraries here.
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
$(LINK.cc) -o $@ $^ $(ICULIBS) $(ICU_PREFIX)/lib/libicuuc.so.18 $(ICU_PREFIX)/lib/libicui18n.so.18
|
|
|
|
|
|
|
|
# Make check: simply runs the sample, logged to a file
|
|
|
|
check: $(TARGET)
|
2002-04-15 23:32:30 +00:00
|
|
|
$(INVOKE) ./$(TARGET) | tee $(TARGET).out
|
2001-07-24 21:29:50 +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 > $@
|
|
|
|
|
|
|
|
$(ICU_INC):
|
2002-04-15 23:32:30 +00:00
|
|
|
@echo ICU_PREFIX variable is not set correctly
|
2001-07-24 21:29:50 +00:00
|
|
|
@echo "Please read the directions at the top of this file (Makefile)"
|
2002-04-15 23:32:30 +00:00
|
|
|
@echo "And the README"
|
2001-07-24 21:29:50 +00:00
|
|
|
@echo "Can't open $(ICU_INC)"
|
|
|
|
@false
|
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
$(LEGACY_INCLUDE)/unicode/ucol.h:
|
|
|
|
@echo ICU_LEGACY variable is not set correctly.
|
|
|
|
@echo "Please read the directions at the top of this file (Makefile)"
|
|
|
|
@echo "And the README"
|
|
|
|
@echo "Can't open $@"
|
|
|
|
@false
|
|
|
|
|
2001-07-24 21:29:50 +00:00
|
|
|
ifneq ($(MAKECMDGOALS),distclean)
|
|
|
|
-include $(DEPS)
|
|
|
|
endif
|