1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html#License
4 # Copyright (c) 2000-2012 IBM, Inc. and others
7 # - configure, build, install ICU
8 # - ensure that 'icu-config' is in the PATH (PREFIX/bin/icu-config)
9 # - if ICU is not built relative to this directory,
10 # set the variable ICU_PATH to the 'icu' directory
12 # - do 'make' in this directory
15 # Include ICU standard definitions
18 # look for the ICU_PATH variable, guess if not there
19 ICU_DEFAULT_PATH=../../..
21 ifeq ($(strip $(ICU_PATH)),)
22 ICU_PATH=$(ICU_DEFAULT_PATH)
29 # All object files (C or C++)
32 OBJECTS=$(OBJECTS1) $(OBJECTS2)
34 CLEANFILES=*~ $(TARGET).out $(TARGET1).out $(TARGET2).out
36 all: $(TARGET1) $(TARGET2)
38 # The following lines are to make sure ICU_PATH is set properly.
39 writer.o: $(ICU_PATH)/source/tools/toolutil/uoptions.h
41 $(ICU_PATH)/source/tools/toolutil/uoptions.h:
43 @echo "*** Please read the directions at the top of this file (Makefile)"
44 @echo "*** Can't open $@ - check ICU_PATH"
48 # Only the writer needs these, actually.
49 CPPFLAGS += -I$(ICU_PATH)/source/tools/toolutil
50 LDFLAGS += -L$(ICU_PATH)/source/tools/toolutil $(shell icu-config --ldflags-toolutil)
53 .PHONY: all clean distclean check report
56 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
57 -$(RMV) $(OBJECTS) $(TARGET1) $(TARGET2)
59 # Can change this to LINK.c if it is a C only program
60 # Can add more libraries here.
61 $(TARGET1): $(OBJECTS1)
62 $(CXX) -o $@ $(LDFLAGS)
64 $(TARGET2): $(OBJECTS2)
65 $(CXX) -o $@ $(LDFLAGS) -licui18n -licuuc
67 # Make check: simply runs the sample, logged to a file
68 check: $(TARGET1) $(TARGET2)
69 $(INVOKE) ./$(TARGET2) | tee $(TARGET2).out
70 $(INVOKE) ./$(TARGET1) | tee $(TARGET1).out