From: František Dvořák Date: Thu, 18 Oct 2012 09:29:15 +0000 (+0200) Subject: Initial import. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7237799bd60af6cb864d90d47d8f470c840f25de;p=libtool-test.git Initial import. --- 7237799bd60af6cb864d90d47d8f470c840f25de diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01ae45a --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +CC=gcc +COMPILE=libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) +LINK=libtool --mode=link $(CC) $(LDFLAGS) + +MAJOR=2 +MINOR=4 +REVISION=6 +OFFSET=0 +LT_CURRENT=$(shell let a=$(MAJOR)+$(MINOR); echo $$a) +LT_AGE=$(MINOR) +LT_REVISION=$(REVISION) +LT_MAJ=$(shell let a=$(MAJOR)+$(OFFSET); echo $$a) +LT_VER=$(LT_MAJ).$(LT_AGE).$(LT_REVISION) + +lib=libtest.la + +all: libtool + +libtool: libtest.la + +raw: libtest.so + +clean: + rm -rfv .libs + rm -fv *.so *.so.* *.o *.la *.lo + +libtest.la: module.lo + $(LINK) -shared -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -rpath /usr/lib $< -o $@ + +libtest.so: module.o + $(CC) $(LDFLAGS) -shared -fPIC -DPIC -Wl,-soname -Wl,libtest.so.$(LT_MAJ) $< -o $@.$(LT_VER) + ln -s $@.$(LT_VER) $@ + +%.lo: %.c + $(COMPILE) -c $< + +.c.o: %.o: %c + $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -DPIC -c $< + +.PHONY: all libtool raw clean diff --git a/module.c b/module.c new file mode 100644 index 0000000..e300c67 --- /dev/null +++ b/module.c @@ -0,0 +1,3 @@ +int func1() { + return 1; +}