summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-04-11 01:28:40 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2021-01-12 23:34:17 +0100
commit84a9cf9f8bdc7a81e742ae95cd76446d5926ef70 (patch)
tree7fe95f6d261dc0f1fc0a794300fdf299a40362fe /Makefile.in
parentfdfeec129ad893da265bb1d18335bbc9a808c9ba (diff)
Configure: Support building as static library
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index f3b47053..7e24a34e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,6 +16,7 @@ DAEMON_LIBS=@DAEMON_LIBS@
CLIENT_LIBS=@CLIENT_LIBS@
CC=@CC@
M4=@M4@
+AR=@AR@
BISON=@BISON@
FLEX=@FLEX@
RANLIB=@RANLIB@
@@ -25,6 +26,7 @@ INSTALL_DATA=@INSTALL_DATA@
client=$(addprefix $(exedir)/,@CLIENT@)
daemon=$(exedir)/bird
+static_lib=$(exedir)/libbird.a
protocols=@protocols@
prefix=@prefix@
@@ -67,10 +69,11 @@ testgoals := check test tests tests_run
cleangoals := clean distclean testsclean
.PHONY: all daemon cli $(docgoals) $(testgoals) $(cleangoals) tags cscope prepare
-all: daemon cli
+all: daemon cli static-lib
daemon: $(daemon)
cli: $(client)
+static-lib: $(static_lib)
$(daemon): LIBS += $(DAEMON_LIBS)
@@ -85,7 +88,7 @@ cf-local = $(conf-y-targets): $(s)config.Y
src-o-files = $(patsubst %.c,$(o)%.o,$(src))
tests-target-files = $(patsubst %.c,$(o)%,$(tests_src))
-all-daemon = $(daemon): $(obj)
+all-daemon = $(daemon) $(static_lib): $(obj)
all-client = $(client): $(obj)
s = $(dir $(lastword $(MAKEFILE_LIST)))
@@ -159,6 +162,11 @@ $(client) $(daemon):
$(E)echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+$(static_lib):
+ $(E)echo AR $(ARFLAGS) $@ $^
+ $(Q)$(AR) $(ARFLAGS) $@ $^
+ $(Q)$(RANLIB) $@
+
$(objdir)/sysdep/paths.h: Makefile
echo >$@ "/* Generated by Makefile, don't edit manually! */"
echo >>$@ "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""