Adding side stream changes to Maemian. Working to integrate full upstream libraries...
[maemian] / nokia-lintian / testset / libbaz / Makefile
diff --git a/nokia-lintian/testset/libbaz/Makefile b/nokia-lintian/testset/libbaz/Makefile
new file mode 100644 (file)
index 0000000..4a3bf2d
--- /dev/null
@@ -0,0 +1,44 @@
+# This is the correct way to build a lib
+
+CC=gcc
+CFLAGS=-Wall -Winline -O2
+
+OBJS=baz.o extra.o
+
+all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b
+
+libbaz2.so: libbaz2.so.1.0
+       ln -sf $^ $@
+libbaz2.so.1.0: libbaz2.so.1.0.3b
+       ln -sf $^ $@
+
+# Oops, forget the soname altogether
+libbaz1.so.1.0.3b: $(OBJS)
+       $(CC) -o $@ -shared $^ -lc
+
+libbaz2.so.1.0.3b: $(OBJS:%.o=%.sho)
+       $(CC) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc
+
+# Non-PIC.
+libbaz3.so.1.0.3b: $(OBJS)
+       $(CC) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc
+
+#%.o-noreentrant: %.c
+#      $(CC) $(CFLAGS) -o $@ -c $<
+
+%.sho: %.c
+       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<
+
+%.o: %.c
+       $(CC) $(CFLAGS) -D_REENTRANT -o $@ -c $<
+
+libbaz2.a: $(OBJS)
+       ar cq $@ $(OBJS)
+       ranlib $@
+
+# The pic one in the .a (wrong), no archive table
+libbaz1.a: $(OBJS:%.o=%.sho)
+       ar cqS $@ $^
+
+clean:
+       rm -f *.a *.o *.so* *.sho