From 23c221835f1df2479027237c11fe584cc2469eb4 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 12 Nov 2014 00:59:58 +0100 Subject: [PATCH] Added a (failing) test for generating Windows libraries --- Makefile | 1 + tests/Makefile | 2 +- tests/library/Makefile.Windows | 41 ++++++++++++++++++++++++++++++++++ tests/project.conf | 4 ++-- tests/tests.sh | 3 ++- 5 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 tests/library/Makefile.Windows diff --git a/Makefile b/Makefile index fa17a5e..b1d8f0b 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ dist: $(PACKAGE)-$(VERSION)/tests/library/project.conf \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.Darwin \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.NetBSD \ + $(PACKAGE)-$(VERSION)/tests/library/Makefile.Windows \ $(PACKAGE)-$(VERSION)/tests/plugin/project.conf \ $(PACKAGE)-$(VERSION)/tests/plugin/Makefile.Darwin \ $(PACKAGE)-$(VERSION)/tests/plugin/Makefile.NetBSD \ diff --git a/tests/Makefile b/tests/Makefile index 0e2624e..2e11ceb 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,7 +10,7 @@ INSTALL = install all: $(TARGETS) -$(OBJDIR)tests.log: binary/project.conf binary/Makefile.Darwin binary/Makefile.NetBSD binary/Makefile.Windows library/project.conf library/Makefile.Darwin library/Makefile.NetBSD plugin/Makefile.Darwin plugin/Makefile.NetBSD tests.sh +$(OBJDIR)tests.log: binary/project.conf binary/Makefile.Darwin binary/Makefile.NetBSD binary/Makefile.Windows library/project.conf library/Makefile.Darwin library/Makefile.NetBSD library/Makefile.Windows plugin/Makefile.Darwin plugin/Makefile.NetBSD tests.sh ./tests.sh -P "$(PREFIX)" -- "$(OBJDIR)tests.log" clean: diff --git a/tests/library/Makefile.Windows b/tests/library/Makefile.Windows new file mode 100644 index 0000000..e31d9a1 --- /dev/null +++ b/tests/library/Makefile.Windows @@ -0,0 +1,41 @@ +TARGETS = $(OBJDIR)libtest.dll +OBJDIR = +PREFIX = /usr/local +DESTDIR = +LIBDIR = $(PREFIX)/lib +EXEEXT = .exe +AR = ar +RANLIB = ranlib +CCSHARED= $(CC) -shared -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc +RM = rm -f +LN = ln -f +MKDIR = mkdir -m 0755 -p +INSTALL = install + + +all: $(TARGETS) + +libtest_OBJS = $(OBJDIR)test.o +libtest_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +libtest_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) + +$(OBJDIR)libtest.dll: $(libtest_OBJS) + $(CCSHARED) -o $(OBJDIR)libtest.dll $(libtest_OBJS) $(libtest_LDFLAGS) + +$(OBJDIR)test.o: test.c + $(CC) $(libtest_CFLAGS) -o $(OBJDIR)test.o -c test.c + +clean: + $(RM) -- $(libtest_OBJS) + +distclean: clean + $(RM) -- $(TARGETS) + +install: $(TARGETS) + $(MKDIR) $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 0755 $(OBJDIR)libtest.dll $(DESTDIR)$(LIBDIR)/libtest.dll + +uninstall: + $(RM) -- $(DESTDIR)$(LIBDIR)/libtest.dll + +.PHONY: all clean distclean install uninstall diff --git a/tests/project.conf b/tests/project.conf index b3ee7ad..879b177 100644 --- a/tests/project.conf +++ b/tests/project.conf @@ -1,7 +1,7 @@ targets=tests.log -dist=Makefile,tests.sh,binary/project.conf,binary/Makefile.Darwin,binary/Makefile.NetBSD,binary/Makefile.Windows,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD +dist=Makefile,tests.sh,binary/project.conf,binary/Makefile.Darwin,binary/Makefile.NetBSD,binary/Makefile.Windows,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD,library/Makefile.Windows,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD [tests.log] type=script script=./tests.sh -depends=binary/project.conf,binary/Makefile.Darwin,binary/Makefile.NetBSD,binary/Makefile.Windows,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,tests.sh +depends=binary/project.conf,binary/Makefile.Darwin,binary/Makefile.NetBSD,binary/Makefile.Windows,library/project.conf,library/Makefile.Darwin,library/Makefile.NetBSD,library/Makefile.Windows,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,tests.sh diff --git a/tests/tests.sh b/tests/tests.sh index 4c1f387..c1b6cc6 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -102,4 +102,5 @@ _test "Darwin" "plugin" _test "NetBSD" "binary" _test "NetBSD" "library" _test "NetBSD" "plugin" -_test "Windows" "binary") > "$target" +_test "Windows" "binary" +_fail "Windows" "library") > "$target"