summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSteven G. Johnson <stevenj@mit.edu>2015-10-31 18:13:25 -0400
committerSteven G. Johnson <stevenj@mit.edu>2015-10-31 18:13:25 -0400
commita5c9de204717d619ddb2fa4eb994542bb3cfc157 (patch)
treedcb694a5b28a802e119c46f7bf8c2a62b45a462d /Makefile
parentf67f1a72f7bbaac8dbf08a183193ac82641cd34b (diff)
parentb10b64dc10fc4c5ca236e85a620ee78e503e201c (diff)
downloadlibutf8proc-a5c9de204717d619ddb2fa4eb994542bb3cfc157.tar.gz
libutf8proc-a5c9de204717d619ddb2fa4eb994542bb3cfc157.tar.bz2
Merge pull request #58 from petercolberg/master
Fix build warnings
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile56
1 files changed, 36 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 61e723a..ffb1cba 100644
--- a/Makefile
+++ b/Makefile
@@ -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