From cd40ce74660f52b377ecb892e10cc89e1e916592 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Thu, 31 Aug 2023 11:54:06 +0200 Subject: [PATCH] Makefile: allow building against an oFono variant --- Makefile | 7 +++++-- lib/Makefile | 7 +++++-- unit/common/Makefile | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 313f44f..b28587c 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ .PHONY: print_debug_lib print_release_lib print_coverage_lib .PHONY: debug_ext_so release_ext_so +# Allow building against an oFono variant. +OFONO_PKG ?= ofono + # # Required packages # @@ -13,7 +16,7 @@ # LDPKGS = libgbinder-radio libgbinder libmce-glib libglibutil gobject-2.0 glib-2.0 -PKGS = ofono $(LDPKGS) +PKGS = $(OFONO_PKG) $(LDPKGS) # # Default target @@ -231,7 +234,7 @@ $(COVERAGE_LIB): $(COVERAGE_OBJS) # Install # -PLUGINDIR ?= $$(pkg-config ofono --variable=plugindir) +PLUGINDIR ?= $$(pkg-config $(OFONO_PKG) --variable=plugindir) ABS_PLUGINDIR := $(shell echo /$(PLUGINDIR) | sed -r 's|/+|/|g') INSTALL = install diff --git a/lib/Makefile b/lib/Makefile index e18b43c..67e3fbb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -6,12 +6,15 @@ .PHONY: print_debug_lib print_release_lib print_coverage_lib .PHONY: pkgconfig install install-dev +# Allow building against an oFono variant. +OFONO_PKG ?= ofono # # Required packages # -PKGS = libgbinder-radio libglibutil glib-2.0 gobject-2.0 +LDPKGS = libgbinder-radio libglibutil glib-2.0 gobject-2.0 +PKGS = $(OFONO_PKG) $(LDPKGS) # # Default target @@ -78,7 +81,7 @@ BASE_FLAGS = -fPIC FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \ -MMD -MP $(shell pkg-config --cflags $(PKGS)) FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) \ - $(shell pkg-config --libs $(PKGS)) -lpthread + $(shell pkg-config --libs $(LDPKGS)) -lpthread DEBUG_FLAGS = -g RELEASE_FLAGS = COVERAGE_FLAGS = -g diff --git a/unit/common/Makefile b/unit/common/Makefile index 4d3d477..26b5e87 100644 --- a/unit/common/Makefile +++ b/unit/common/Makefile @@ -16,12 +16,15 @@ endif SRC ?= $(EXE).c # COMMON_SRC += test_main.c +# Allow building against an oFono variant. +OFONO_PKG ?= ofono + # # Required packages # LINK_PKGS += libglibutil glib-2.0 gobject-2.0 -PKGS += $(LINK_PKGS) libgbinder libgbinder-radio +PKGS += $(OFONO_PKG) $(LINK_PKGS) libgbinder libgbinder-radio # # Default target