aboutsummaryrefslogtreecommitdiffstats
path: root/community/unibilium/build-static-lib.patch
blob: 643421f98d05ba4bdd9d7a07c024f908c241a0b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,7 @@
 
 OBJECTS=unibilium.lo uninames.lo uniutil.lo
 LIBRARY=libunibilium.la
+LIBSTATIC=libunibilium.a
 
 PODS=$(wildcard doc/*.pod)
 MANPAGES=$(addprefix man/,$(notdir $(PODS:.pod=.3.gz)))
@@ -54,7 +55,7 @@
 TESTS=$(wildcard t/*.c)
 
 .PHONY: all
-all: $(LIBRARY) build-man build-tools build-test
+all: $(LIBRARY) $(LIBSTATIC) build-man build-tools build-test
 
 %.lo: %.c unibilium.h
 	$(LIBTOOL) --mode=compile --tag=CC $(CC) -I. -Wall -std=c99 $(CFLAGS) $(CFLAGS_DEBUG) -o $@ -c $<
@@ -65,6 +66,9 @@
 $(LIBRARY): $(OBJECTS)
 	$(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -rpath '$(LIBDIR)' -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -o $@ $^
 
+$(LIBSTATIC): $(OBJECTS)
+	$(LIBTOOL) --mode=link $(CC) -o $@ $^
+
 tools/%: $(LIBRARY) tools/%.lo
 	$(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $^
 
@@ -102,6 +106,7 @@
 install-lib:
 	mkdir -p '$(DESTDIR)$(LIBDIR)'
 	$(LIBTOOL) --mode=install cp $(LIBRARY) '$(DESTDIR)$(LIBDIR)/$(LIBRARY)'
+	$(LIBTOOL) --mode=install install $(LIBSTATIC) $(DESTDIR)$(LIBDIR)/$(LIBSTATIC)
 
 .PHONY: install-man
 install-man: build-man