From nobody Sun Nov 9 21:54:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551960096624999.086855619218; Thu, 7 Mar 2019 04:01:36 -0800 (PST) Received: from localhost ([127.0.0.1]:49889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1riN-0007hO-LU for importer@patchew.org; Thu, 07 Mar 2019 07:01:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1rZ7-0008Ty-UO for qemu-devel@nongnu.org; Thu, 07 Mar 2019 06:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1rZ6-0003Zy-QE for qemu-devel@nongnu.org; Thu, 07 Mar 2019 06:51:57 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55874) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1rZ6-0003ZL-Io for qemu-devel@nongnu.org; Thu, 07 Mar 2019 06:51:56 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id A0576B160; Thu, 7 Mar 2019 12:51:55 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jmTB7orcxbfZ; Thu, 7 Mar 2019 12:51:54 +0100 (CET) Received: from function (dhcp-13-128.lip.ens-lyon.fr [140.77.13.128]) by hera.aquilenet.fr (Postfix) with ESMTPSA id EF7C9B16A; Thu, 7 Mar 2019 12:51:44 +0100 (CET) Received: from samy by function with local (Exim 4.92) (envelope-from ) id 1h1rYt-0000E7-LB; Thu, 07 Mar 2019 12:51:43 +0100 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 12:51:41 +0100 Message-Id: <20190307115143.780-12-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307115143.780-1-samuel.thibault@ens-lyon.org> References: <20190307115143.780-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULLv2 10/12] slirp: add a standalone Makefile X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Samuel Thibault , stefanha@redhat.com, jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Add a simple Makefile to build libslirp.a, a static library version of libslirp, to be used by QEMU during a transition period, until a shared library is available. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190212162524.31504-6-marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault --- slirp/Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 slirp/Makefile diff --git a/slirp/Makefile b/slirp/Makefile new file mode 100644 index 0000000000..6d48f626ba --- /dev/null +++ b/slirp/Makefile @@ -0,0 +1,47 @@ +ROOT_DIR :=3D $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +BUILD_DIR ?=3D . + +LIBSLIRP =3D $(BUILD_DIR)/libslirp.a + +all: $(LIBSLIRP) + +SRCS :=3D $(wildcard src/*.c) +OBJS :=3D $(SRCS:%.c=3D$(BUILD_DIR)/%.o) +DEPS :=3D $(OBJS:%.o=3D%.d) + +INC_DIRS :=3D $(BUILD_DIR)/src +INC_FLAGS :=3D $(addprefix -I,$(INC_DIRS)) + +override CFLAGS +=3D \ + -DG_LOG_DOMAIN=3D'"Slirp"' \ + $(shell $(PKG_CONFIG) --cflags glib-2.0) \ + $(INC_FLAGS) \ + -MMD -MP +override LDFLAGS +=3D $(shell $(PKG_CONFIG) --libs glib-2.0) + +$(LIBSLIRP): $(OBJS) + +.PHONY: clean + +clean: + rm -r $(OBJS) $(DEPS) $(LIBSLIRP) + +$(BUILD_DIR)/src/%.o: $(ROOT_DIR)/src/%.c + @$(MKDIR_P) $(dir $@) + $(call quiet-command,$(CC) $(CFLAGS) -c -o $@ $<,"CC","$@") + +%.a: + $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^,"AR","$@") + +PKG_CONFIG ?=3D pkg-config +MKDIR_P ?=3D mkdir -p +quiet-command-run =3D $(if $(V),,$(if $2,printf " %-7s %s\n" $2 $3 && ))$1 +quiet-@ =3D $(if $(V),,@) +quiet-command =3D $(quiet-@)$(call quiet-command-run,$1,$2,$3) + +print-%: + @echo '$*=3D$($*)' + +.SUFFIXES: + +-include $(DEPS) --=20 2.20.1