|
|
@ -5,6 +5,7 @@ MAKE=make |
|
|
|
AR?=ar |
|
|
|
CC?=gcc |
|
|
|
INSTALL=install |
|
|
|
FIND=find |
|
|
|
|
|
|
|
# compiler settings
|
|
|
|
CFLAGS ?= -O2 |
|
|
@ -17,7 +18,7 @@ UCFLAGS = $(CFLAGS) $(PICFLAG) $(C99FLAG) $(WCFLAGS) -DUTF8PROC_EXPORTS |
|
|
|
# from the utf8proc version number because it indicates ABI compatibility,
|
|
|
|
# not API compatibility: MAJOR should be incremented whenever *binary*
|
|
|
|
# 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 |
|
|
|
MINOR=3 |
|
|
|
PATCH=0 |
|
|
@ -38,12 +39,17 @@ includedir=$(prefix)/include |
|
|
|
|
|
|
|
# meta targets
|
|
|
|
|
|
|
|
.PHONY: all, clean, update, data |
|
|
|
.PHONY: all clean data update manifest install |
|
|
|
|
|
|
|
all: libutf8proc.a libutf8proc.$(SHLIB_EXT) |
|
|
|
|
|
|
|
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 data clean |
|
|
|
|
|
|
@ -52,6 +58,8 @@ data: data/utf8proc_data.c.new |
|
|
|
update: data/utf8proc_data.c.new |
|
|
|
cp -f data/utf8proc_data.c.new utf8proc_data.c |
|
|
|
|
|
|
|
manifest: MANIFEST.new |
|
|
|
|
|
|
|
# real targets
|
|
|
|
|
|
|
|
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) |
|
|
|
$(INSTALL) -m 644 libutf8proc.a $(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) |
|
|
|
ln -f -s $(libdir)/libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR) |
|
|
|
ln -f -s $(libdir)/libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR).$(MINOR) |
|
|
|
ln -f -s libutf8proc.$(SHLIB_VERS_EXT) $(DESTDIR)$(libdir)/libutf8proc.so.$(MAJOR) |
|
|
|
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
|
|
|
|
|
|
|
|
data/NormalizationTest.txt: |
|
|
@ -98,26 +111,29 @@ data/NormalizationTest.txt: |
|
|
|
data/GraphemeBreakTest.txt: |
|
|
|
$(MAKE) -C data GraphemeBreakTest.txt |
|
|
|
|
|
|
|
test/normtest: test/normtest.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/normtest.c utf8proc.o -o $@ |
|
|
|
test/tests.o: test/tests.c test/tests.h utf8proc.h |
|
|
|
$(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 |
|
|
|
$(CC) $(UCFLAGS) test/graphemetest.c utf8proc.o -o $@ |
|
|
|
test/graphemetest: test/graphemetest.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/graphemetest.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
test/printproperty: test/printproperty.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/printproperty.c utf8proc.o -o $@ |
|
|
|
test/printproperty: test/printproperty.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/printproperty.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
test/charwidth: test/charwidth.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/charwidth.c utf8proc.o -o $@ |
|
|
|
test/charwidth: test/charwidth.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/charwidth.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
test/valid: test/valid.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/valid.c utf8proc.o -o $@ |
|
|
|
test/valid: test/valid.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/valid.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
test/iterate: test/iterate.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/iterate.c utf8proc.o -o $@ |
|
|
|
test/iterate: test/iterate.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/iterate.c test/tests.o utf8proc.o -o $@ |
|
|
|
|
|
|
|
test/case: test/case.c utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(CC) $(UCFLAGS) test/case.c utf8proc.o -o $@ |
|
|
|
test/case: test/case.c test/tests.o utf8proc.o utf8proc.h test/tests.h |
|
|
|
$(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 |
|
|
|
$(MAKE) -C bench |
|
|
|