Added a test for libraries on MacOS X (Darwin)

This commit is contained in:
Pierre Pronchery 2014-11-11 01:35:04 +01:00
parent 6e2694fce2
commit 716d5c6a87
5 changed files with 47 additions and 3 deletions

View File

@ -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 \

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -87,4 +87,5 @@ fi
target="$1"
($DATE
echo
_test "Darwin" "library"
_test "NetBSD" "library") > "$target"