|
@ -5,6 +5,7 @@ MAKE=make |
|
|
AR?=ar |
|
|
AR?=ar |
|
|
CC?=gcc |
|
|
CC?=gcc |
|
|
INSTALL=install |
|
|
INSTALL=install |
|
|
|
|
|
FIND=find |
|
|
|
|
|
|
|
|
# compiler settings
|
|
|
# compiler settings
|
|
|
CFLAGS ?= -O2 |
|
|
CFLAGS ?= -O2 |
|
@ -17,7 +18,7 @@ UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) $(WCFLAGS) -DUTF8PROC_EXPORTS |
|
|
# from the utf8proc version number because it indicates ABI compatibility,
|
|
|
# from the utf8proc version number because it indicates ABI compatibility,
|
|
|
# not API compatibility: MAJOR should be incremented whenever *binary*
|
|
|
# not API compatibility: MAJOR should be incremented whenever *binary*
|
|
|
# compatibility is broken, even if the API is backward-compatible
|
|
|
# compatibility is broken, even if the API is backward-compatible
|
|
|
# Be sure to also update these in CMakeLists.txt!
|
|
|
# Be sure to also update these in MANIFEST and CMakeLists.txt!
|
|
|
MAJOR=1 |
|
|
MAJOR=1 |
|
|
MINOR=3 |
|
|
MINOR=3 |
|
|
PATCH=0 |
|
|
PATCH=0 |
|
@ -38,12 +39,17 @@ includedir=$(prefix)/include |
|
|
|
|
|
|
|
|
# meta targets
|
|
|
# meta targets
|
|
|
|
|
|
|
|
|
.PHONY: all, clean, update, data |
|
|
.PHONY: all clean data update manifest install |
|
|
|
|
|
|
|
|
all: libutf8proc.a libutf8proc.$(SHLIB_EXT) |
|
|
all: libutf8proc.a libutf8proc.$(SHLIB_EXT) |
|
|
|
|
|
|
|
|
clean: |
|
|
clean: |
|
|
rm -f utf8proc.o libutf8proc.a libutf8proc.$(SHLIB_VERS_EXT) libutf8proc.$(SHLIB_EXT) test/normtest test/graphemetest test/printproperty test/charwidth test/valid test/iterate |
|
|
rm -f utf8proc.o libutf8proc.a libutf8proc.$(SHLIB_VERS_EXT) libutf8proc.$(SHLIB_EXT) |
|
|
|
|
|
ifneq ($(OS),Darwin) |
|
|
|
|
|
rm -f libutf8proc.so.$(MAJOR) |
|
|
|
|
|
endif |
|
|
|
|
|
rm -f test/tests.o test/normtest test/graphemetest test/printproperty test/charwidth test/valid test/iterate test/case |
|
|
|
|
|
rm -rf MANIFEST.new tmp |
|
|
$(MAKE) -C bench clean |
|
|
$(MAKE) -C bench clean |
|
|
$(MAKE) -C data clean |
|
|
$(MAKE) -C data clean |
|
|
|
|
|
|
|
@ -52,6 +58,8 @@ data: data/utf8proc_data.c.new |
|
|
update: data/utf8proc_data.c.new |
|
|
update: data/utf8proc_data.c.new |
|
|
cp -f data/utf8proc_data.c.new utf8proc_data.c |
|
|
cp -f data/utf8proc_data.c.new utf8proc_data.c |
|
|
|
|
|
|
|
|
|
|
|
manifest: MANIFEST.new |
|
|
|
|
|
|
|
|
# real targets
|
|
|
# real targets
|
|
|
|
|
|
|
|
|
data/utf8proc_data.c.new: libutf8proc.$(SHLIB_EXT) data/data_generator.rb data/charwidths.jl |
|
|
data/utf8proc_data.c.new: libutf8proc.$(SHLIB_EXT) data/data_generator.rb data/charwidths.jl |
|
@ -84,12 +92,17 @@ install: libutf8proc.a libutf8proc.$(SHLIB_EXT) libutf8proc.$(SHLIB_VERS_EXT) |
|
|
mkdir -m 755 -p $(DESTDIR)$(libdir) |
|
|
mkdir -m 755 -p $(DESTDIR)$(libdir) |
|
|
$(INSTALL) -m 644 libutf8proc.a $(DESTDIR)$(libdir) |
|
|
$(INSTALL) -m 644 libutf8proc.a $(DESTDIR)$(libdir) |
|
|
$(INSTALL) -m 755 libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir) |
|
|
$(INSTALL) -m 755 libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir) |
|
|
ln -f -s $(libdir)/libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.$(SHLIB_EXT) |
|
|
ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.$(SHLIB_EXT) |
|
|
ifneq ($(OS),Darwin) |
|
|
ifneq ($(OS),Darwin) |
|
|
ln -f -s $(libdir)/libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR) |
|
|
ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR) |
|
|
ln -f -s $(libdir)/libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR).$(MINOR) |
|
|
|
|
|
endif |
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
MANIFEST.new: |
|
|
|
|
|
rm -rf tmp |
|
|
|
|
|
$(MAKE) install prefix=/usr DESTDIR=$(PWD)/tmp |
|
|
|
|
|
$(FIND) tmp/usr -mindepth 1 -type l -printf "%P -> %l\n" -or -type f -printf "%P\n" -or -type d -printf "%P/\n" | LC_ALL=C sort > $@ |
|
|
|
|
|
rm -rf tmp |
|
|
|
|
|
|
|
|
# Test programs
|
|
|
# Test programs
|
|
|
|
|
|
|
|
|
data/NormalizationTest.txt: |
|
|
data/NormalizationTest.txt: |
|
@ -98,26 +111,29 @@ data/NormalizationTest.txt: |
|
|
data/GraphemeBreakTest.txt: |
|
|
data/GraphemeBreakTest.txt: |
|
|
$(MAKE) -C data GraphemeBreakTest.txt |
|
|
$(MAKE) -C data GraphemeBreakTest.txt |
|
|
|
|
|
|
|
|
test/normtest: test/normtest.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/tests.o: test/tests.c test/tests.h utf8proc.h |
|
|
$(CC) $(UCFLAGS) test/normtest.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) -c -o test/tests.o test/tests.c |
|
|
|
|
|
|
|
|
|
|
|
test/normtest: test/normtest.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
|
|
$(CC) $(UCFLAGS) test/normtest.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/graphemetest: test/graphemetest.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/graphemetest: test/graphemetest.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/graphemetest.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/graphemetest.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/printproperty: test/printproperty.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/printproperty: test/printproperty.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/printproperty.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/printproperty.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/charwidth: test/charwidth.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/charwidth: test/charwidth.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/charwidth.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/charwidth.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/valid: test/valid.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/valid: test/valid.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/valid.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/valid.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/iterate: test/iterate.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/iterate: test/iterate.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/iterate.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/iterate.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
test/case: test/case.c utf8proc.o utf8proc.h test/tests.h |
|
|
test/case: test/case.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
$(CC) $(UCFLAGS) test/case.c utf8proc.o -o $@ |
|
|
$(CC) $(UCFLAGS) test/case.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
|
check: test/normtest data/NormalizationTest.txt test/graphemetest data/GraphemeBreakTest.txt test/printproperty test/case test/charwidth test/valid test/iterate bench/bench.c bench/util.c bench/util.h utf8proc.o |
|
|
check: test/normtest data/NormalizationTest.txt test/graphemetest data/GraphemeBreakTest.txt test/printproperty test/case test/charwidth test/valid test/iterate bench/bench.c bench/util.c bench/util.h utf8proc.o |
|
|
$(MAKE) -C bench |
|
|
$(MAKE) -C bench |
|
|