diff --git a/Makefile b/Makefile index 5fb8471..9fea65d 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ dist: $(PACKAGE)-$(VERSION)/tests/binary/Makefile.Windows \ $(PACKAGE)-$(VERSION)/tests/library/project.conf \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.Darwin \ + $(PACKAGE)-$(VERSION)/tests/library/Makefile.Linux \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.NetBSD \ $(PACKAGE)-$(VERSION)/tests/library/Makefile.Windows \ $(PACKAGE)-$(VERSION)/tests/object/project.conf \ diff --git a/tests/Makefile b/tests/Makefile index 9d66ddc..c44816b 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 library/Makefile.Windows object/project.conf object/Makefile.NetBSD plugin/Makefile.Darwin plugin/Makefile.NetBSD script/project.conf script/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.Linux library/Makefile.NetBSD library/Makefile.Windows object/project.conf object/Makefile.NetBSD plugin/Makefile.Darwin plugin/Makefile.NetBSD script/project.conf script/Makefile.NetBSD tests.sh ./tests.sh -P "$(PREFIX)" -- "$(OBJDIR)tests.log" clean: diff --git a/tests/library/Makefile.Darwin b/tests/library/Makefile.Darwin index a9e89ca..6d2292f 100644 --- a/tests/library/Makefile.Darwin +++ b/tests/library/Makefile.Darwin @@ -3,6 +3,7 @@ OBJDIR = PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib +LDFLAGS = -ldl -lintl -ltest AR = ar RANLIB = ranlib CCSHARED= $(CC) -dynamiclib diff --git a/tests/library/Makefile.Linux b/tests/library/Makefile.Linux new file mode 100644 index 0000000..ae99aab --- /dev/null +++ b/tests/library/Makefile.Linux @@ -0,0 +1,53 @@ +TARGETS = $(OBJDIR)libtest.a $(OBJDIR)libtest.so.0.0 $(OBJDIR)libtest.so.0 $(OBJDIR)libtest.so +OBJDIR = +PREFIX = /usr/local +DESTDIR = +LIBDIR = $(PREFIX)/lib +LDFLAGS = -ldl -ltest +AR = ar +RANLIB = ranlib +CCSHARED= $(CC) -shared +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.a: $(libtest_OBJS) + $(AR) -rc $(OBJDIR)libtest.a $(libtest_OBJS) + $(RANLIB) $(OBJDIR)libtest.a + +$(OBJDIR)libtest.so.0.0 $(OBJDIR)libtest.so.0 $(OBJDIR)libtest.so: $(libtest_OBJS) + $(CCSHARED) -o $(OBJDIR)libtest.so.0.0 -Wl,-soname,libtest.so.0 $(libtest_OBJS) $(libtest_LDFLAGS) + $(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so.0 + $(LN) -s -- libtest.so.0.0 $(OBJDIR)libtest.so + +$(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 0644 $(OBJDIR)libtest.a $(DESTDIR)$(LIBDIR)/libtest.a + $(INSTALL) -m 0755 $(OBJDIR)libtest.so.0.0 $(DESTDIR)$(LIBDIR)/libtest.so.0.0 + $(LN) -s -- libtest.so.0.0 $(DESTDIR)$(LIBDIR)/libtest.so.0 + $(LN) -s -- libtest.so.0.0 $(DESTDIR)$(LIBDIR)/libtest.so + +uninstall: + $(RM) -- $(DESTDIR)$(LIBDIR)/libtest.a + $(RM) -- $(DESTDIR)$(LIBDIR)/libtest.so.0.0 + $(RM) -- $(DESTDIR)$(LIBDIR)/libtest.so.0 + $(RM) -- $(DESTDIR)$(LIBDIR)/libtest.so + +.PHONY: all clean distclean install uninstall diff --git a/tests/library/Makefile.NetBSD b/tests/library/Makefile.NetBSD index 0c7b1d9..82ffaab 100644 --- a/tests/library/Makefile.NetBSD +++ b/tests/library/Makefile.NetBSD @@ -3,6 +3,7 @@ OBJDIR = PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib +LDFLAGS = -lintl -lossaudio -ltest AR = ar RANLIB = ranlib CCSHARED= $(CC) -shared diff --git a/tests/library/Makefile.Windows b/tests/library/Makefile.Windows index e465165..e883f36 100644 --- a/tests/library/Makefile.Windows +++ b/tests/library/Makefile.Windows @@ -3,6 +3,7 @@ OBJDIR = PREFIX = /usr/local DESTDIR = LIBDIR = $(PREFIX)/lib +LDFLAGS = -lintl -ltest -lws2_32 EXEEXT = .exe CCSHARED= $(CC) -shared -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc RM = rm -f diff --git a/tests/library/project.conf b/tests/library/project.conf index 3cea886..e46d4ed 100644 --- a/tests/library/project.conf +++ b/tests/library/project.conf @@ -1,4 +1,5 @@ targets=libtest +ldflags=-ldl -lintl -lossaudio -ltest -lws2_32 dist=Makefile [libtest] diff --git a/tests/project.conf b/tests/project.conf index c83256c..ed72e8a 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,library/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/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.Linux,library/Makefile.NetBSD,library/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,plugin/project.conf,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/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,library/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/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.Linux,library/Makefile.NetBSD,library/Makefile.Windows,object/project.conf,object/Makefile.NetBSD,plugin/Makefile.Darwin,plugin/Makefile.NetBSD,script/project.conf,script/Makefile.NetBSD,tests.sh diff --git a/tests/tests.sh b/tests/tests.sh index d103cd8..f804fb8 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -71,6 +71,7 @@ _tests() _test "Darwin" "binary" || ret=2 _test "Darwin" "library" || ret=2 _test "Darwin" "plugin" || ret=2 + _test "Linux" "library" || ret=2 _test "NetBSD" "binary" || ret=2 _test "NetBSD" "library" || ret=2 _test "NetBSD" "object" || ret=2