From 5e1a466bbfccba7853f00f1f62f91e5c62e4c3de Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 18 Jun 2025 17:25:11 +0200 Subject: [PATCH] fix Makefile --- example/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/Makefile b/example/Makefile index 5659216..0a56e1a 100644 --- a/example/Makefile +++ b/example/Makefile @@ -47,6 +47,8 @@ CARGOFLAGS += --manifest-path=$(REPO_ROOT)/Cargo.toml \ --target=$(RUST_TARGET) \ --target-dir=cargo +STATIC_LINK_LIBS += -lservicepoint_binding_c +_servicepoint_cflags := -I $(REPO_ROOT)/include -L $(CARGO_OBJDIR) CFLAGS += -Wall -Wextra -pedantic -fwhole-program -fPIE -pie _no_debug_cflags := -ffunction-sections -fdata-sections -Wl,--gc-sections size_optimized_CFLAGS += -Oz \ @@ -69,7 +71,7 @@ debug_CFLAGS += -Og static_CFLAGS += -static $(STATIC_LINK_LIBS) dynamic_CFLAGS += -Wl,-Bstatic $(STATIC_LINK_LIBS) -Wl,-Bdynamic -_servicepoint_cflags := $(pkg-config --libs servicepoint --cflags) +_servicepoint_cflags := $(shell pkg-config --libs servicepoint --cflags || echo -I $(REPO_ROOT)/include -L $(CARGO_OBJDIR)) CFLAGS += $($(_libc)_CFLAGS) $($(_profile)_CFLAGS) $($(_link_type)_CFLAGS) $(_servicepoint_cflags) ifeq ($(LTO), 1) CFLAGS += -flto @@ -103,9 +105,9 @@ _unstripped_bins := $(addsuffix _unstripped, $(_bins)) .PHONY: all build-rust -all: $(_bins) +all: build-rust $(_bins) -$(_unstripped_bins): %_unstripped: src/%.c src/helpers.h build-rust +$(_unstripped_bins): %_unstripped : src/%.c src/helpers.h build-rust $(CC) $< $(CFLAGS) -o $@ $(_bins): %: %_unstripped