From: Mike Engel Date: Mon, 28 Jun 2021 18:45:20 +0200 Subject: [PATCH] Makefile: change Makefile to build swupdate library statically Signed-off-by: Mike Engel --- Makefile | 4 +++- ipc-static/Makefile | 6 ++++++ ipc-static/network_ipc-if.c | 1 + ipc-static/network_ipc.c | 1 + ipc-static/progress_ipc.c | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ipc-static/Makefile create mode 120000 ipc-static/network_ipc-if.c create mode 120000 ipc-static/network_ipc.c create mode 120000 ipc-static/progress_ipc.c diff --git a/Makefile b/Makefile index bf534e110ac3..8b704798501f 100644 --- a/Makefile +++ b/Makefile @@ -364,6 +364,7 @@ include $(srctree)/Makefile.flags objs-y := core handlers bootloader libs-y := corelib mongoose parser suricatta fs +libs-y += ipc-static bindings-y := bindings tools-y := tools @@ -437,7 +438,7 @@ quiet_cmd_shared = LD $@ "-shared -Wl,-soname,$@" \ "$(KBUILD_CFLAGS) $(CFLAGS_swupdate)" \ "$(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_swupdate) -L$(objtree)" \ - "$(2)" \ + "$(2) ipc-static/lib.a" \ "" \ "$(LDLIBS)" @@ -480,6 +481,7 @@ install: all install -m 0644 $(srctree)/include/progress_ipc.h ${DESTDIR}/${INCLUDEDIR} install -m 0755 $(objtree)/${swupdate-ipc-lib} ${DESTDIR}/${LIBDIR} ln -sfr ${DESTDIR}/${LIBDIR}/${swupdate-ipc-lib} ${DESTDIR}/${LIBDIR}/libswupdate.so + install -m 0755 ipc-static/lib.a ${DESTDIR}/${LIBDIR}/libswupdate.a if [ $(HAVE_LUA) = y ]; then \ install -d ${DESTDIR}/${LIBDIR}/lua/$(LUAVER); \ install -m 0755 ${lua_swupdate} $(DESTDIR)/${LIBDIR}/lua/$(LUAVER); \ diff --git a/ipc-static/Makefile b/ipc-static/Makefile new file mode 100644 index 000000000000..99cce6cc75da --- /dev/null +++ b/ipc-static/Makefile @@ -0,0 +1,6 @@ +# Copyright (C) 2021 Digi International Inc. +# +# SPDX-License-Identifier: GPL-2.0-only +lib-y += network_ipc.o network_ipc-if.o progress_ipc.o + +EXTRA_CFLAGS += -fPIC diff --git a/ipc-static/network_ipc-if.c b/ipc-static/network_ipc-if.c new file mode 120000 index 000000000000..37894e2f8207 --- /dev/null +++ b/ipc-static/network_ipc-if.c @@ -0,0 +1 @@ +../ipc/network_ipc-if.c \ No newline at end of file diff --git a/ipc-static/network_ipc.c b/ipc-static/network_ipc.c new file mode 120000 index 000000000000..0640077ec0fc --- /dev/null +++ b/ipc-static/network_ipc.c @@ -0,0 +1 @@ +../ipc/network_ipc.c \ No newline at end of file diff --git a/ipc-static/progress_ipc.c b/ipc-static/progress_ipc.c new file mode 120000 index 000000000000..7c6622ce0a30 --- /dev/null +++ b/ipc-static/progress_ipc.c @@ -0,0 +1 @@ +../ipc/progress_ipc.c \ No newline at end of file