2000-09-10 00:57:48 +00:00
|
|
|
# Copyright (c) 2000 IBM, Inc. and others
|
2002-05-10 20:32:34 +00:00
|
|
|
# udata sample code $Revision: 1.4 $
|
2000-09-10 00:57:48 +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-10 00:57:48 +00:00
|
|
|
# - do 'make' in this directory
|
|
|
|
|
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
# Include ICU standard definitions
|
|
|
|
include ../defs.mk
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
# look for the ICU_PATH variable, guess if not there
|
|
|
|
ICU_DEFAULT_PATH=../../..
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
ifeq ($(strip $(ICU_PATH)),)
|
|
|
|
ICU_PATH=$(ICU_DEFAULT_PATH)
|
|
|
|
endif
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
# Name of your target
|
|
|
|
TARGET1=reader
|
|
|
|
TARGET2=writer
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
# All object files (C or C++)
|
|
|
|
OBJECTS1=reader.o
|
|
|
|
OBJECTS2=writer.o
|
|
|
|
OBJECTS=$(OBJECTS1) $(OBJECTS2)
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
CLEANFILES=*~ $(TARGET).out
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2002-04-15 23:32:30 +00:00
|
|
|
all: $(TARGET1) $(TARGET2)
|
|
|
|
|
2002-05-10 20:32:34 +00:00
|
|
|
# The following lines are to make sure ICU_PATH is set properly.
|
2002-04-15 23:32:30 +00:00
|
|
|
writer.o: $(ICU_PATH)/source/tools/toolutil/uoptions.h
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
$(ICU_PATH)/source/tools/toolutil/uoptions.h:
|
2002-04-15 23:32:30 +00:00
|
|
|
@echo
|
|
|
|
@echo "*** Please read the directions at the top of this file (Makefile)"
|
|
|
|
@echo "*** Can't open $@ - check ICU_PATH"
|
|
|
|
@echo
|
2000-09-10 00:57:48 +00:00
|
|
|
@false
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
# Only the writer needs these, actually.
|
|
|
|
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)
|
2000-09-06 22:31:28 +00:00
|
|
|
|
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
.PHONY: all clean distclean check report
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
distclean clean:
|
|
|
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
|
|
|
-$(RMV) $(OBJECTS) $(TARGET1) $(TARGET2)
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
# Can change this to LINK.c if it is a C only program
|
|
|
|
# Can add more libraries here.
|
|
|
|
$(TARGET1): $(OBJECTS1)
|
2002-05-10 20:32:34 +00:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
$(TARGET2): $(OBJECTS2)
|
2002-05-10 20:32:34 +00:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2000-09-06 22:31:28 +00:00
|
|
|
|
2000-09-10 00:57:48 +00:00
|
|
|
# Make check: simply runs the sample, logged to a file
|
|
|
|
check: $(TARGET1) $(TARGET2)
|
2002-04-15 23:32:30 +00:00
|
|
|
$(INVOKE) ./$(TARGET2) | tee $(TARGET2).out
|
|
|
|
$(INVOKE) ./$(TARGET1) | tee $(TARGET1).out
|
2000-09-06 22:31:28 +00:00
|
|
|
|
|
|
|
|