From 716d5c6a873972878c05951dc2141b90c821c962 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 11 Nov 2014 01:35:04 +0100 Subject: [PATCH] Added a test for libraries on MacOS X (Darwin) --- Makefile | 1 + tests/Makefile | 2 +- tests/library/Makefile.Darwin | 42 +++++++++++++++++++++++++++++++++++ tests/project.conf | 4 ++-- tests/tests.sh | 1 + 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 tests/library/Makefile.Darwin diff --git a/Makefile b/Makefile index 9ca50b2..2e8dcd3 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ dist: $(PACKAGE)-$(VERSION)/tests/Makefile \ $(PACKAGE)-$(VERSION)/tests/tests.sh \ $(PACKAGE)-$(VERSION)/tests/library/project.conf \ + $(PACKAGE)-$(VERSION)/tests/library/Makefile.Darwin \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.NetBSD \ $(PACKAGE)-$(VERSION)/tests/project.conf \ $(PACKAGE)-$(VERSION)/tools/pkg-config.c \ diff --git a/tests/Makefile b/tests/Makefile index c195b11..5a52dc5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -9,7 +9,7 @@ INSTALL = install all: $(TARGETS) -tests.log: ../src/configure library/project.conf library/Makefile.NetBSD tests.sh +tests.log: ../src/configure library/project.conf library/Makefile.Darwin library/Makefile.NetBSD tests.sh ./tests.sh -P "$(PREFIX)" -- "tests.log" clean: diff --git a/tests/library/Makefile.Darwin b/tests/library/Makefile.Darwin new file mode 100644 index 0000000..8c987b4 --- /dev/null +++ b/tests/library/Makefile.Darwin @@ -0,0 +1,42 @@ +TARGETS = libtest.a libtest.dylib.0.0 libtest.dylib.0 libtest.dylib +PREFIX = /usr/local +DESTDIR = +LIBDIR = $(PREFIX)/lib +AR = ar +RANLIB = ranlib +CCSHARED= $(CC) -shared +RM = rm -f +LN = ln -f +MKDIR = mkdir -m 0755 -p +INSTALL = install + + +all: $(TARGETS) + +libtest_OBJS = test.o +libtest_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +libtest_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) + +libtest.a: $(libtest_OBJS) + $(AR) -rc libtest.a $(libtest_OBJS) + $(RANLIB) libtest.a + +libtest.dylib.0.0 libtest.dylib.0 libtest.dylib: $(libtest_OBJS) + $(CCSHARED) -o libtest.dylib.0.0 $(libtest_OBJS) $(libtest_LDFLAGS) + $(LN) -s -- libtest.dylib.0.0 libtest.dylib.0 + $(LN) -s -- libtest.dylib.0.0 libtest.dylib + +test.o: test.c + $(CC) $(libtest_CFLAGS) -c test.c + +clean: + $(RM) -- $(libtest_OBJS) + +distclean: clean + $(RM) -- $(TARGETS) + +install: $(TARGETS) + +uninstall: + +.PHONY: all clean distclean install uninstall diff --git a/tests/project.conf b/tests/project.conf index db8f319..72afbb5 100644 --- a/tests/project.conf +++ b/tests/project.conf @@ -1,7 +1,7 @@ targets=tests.log -dist=Makefile,tests.sh,library/project.conf,library/Makefile.NetBSD +dist=Makefile,tests.sh,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD [tests.log] type=script script=./tests.sh -depends=../src/configure,library/project.conf,library/Makefile.NetBSD,tests.sh +depends=../src/configure,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD,tests.sh diff --git a/tests/tests.sh b/tests/tests.sh index d48bdfe..b5bc1d8 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -87,4 +87,5 @@ fi target="$1" ($DATE echo +_test "Darwin" "library" _test "NetBSD" "library") > "$target"