From 7237799bd60af6cb864d90d47d8f470c840f25de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 18 Oct 2012 11:29:15 +0200 Subject: [PATCH] Initial import. --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ module.c | 3 +++ 2 files changed, 43 insertions(+) create mode 100644 Makefile create mode 100644 module.c 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; +} -- 1.8.2.3