WIP: type per command #4
|
@ -47,6 +47,8 @@ CARGOFLAGS += --manifest-path=$(REPO_ROOT)/Cargo.toml \
|
||||||
--target=$(RUST_TARGET) \
|
--target=$(RUST_TARGET) \
|
||||||
--target-dir=cargo
|
--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
|
CFLAGS += -Wall -Wextra -pedantic -fwhole-program -fPIE -pie
|
||||||
_no_debug_cflags := -ffunction-sections -fdata-sections -Wl,--gc-sections
|
_no_debug_cflags := -ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||||
size_optimized_CFLAGS += -Oz \
|
size_optimized_CFLAGS += -Oz \
|
||||||
|
@ -69,7 +71,7 @@ debug_CFLAGS += -Og
|
||||||
static_CFLAGS += -static $(STATIC_LINK_LIBS)
|
static_CFLAGS += -static $(STATIC_LINK_LIBS)
|
||||||
dynamic_CFLAGS += -Wl,-Bstatic $(STATIC_LINK_LIBS) -Wl,-Bdynamic
|
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)
|
CFLAGS += $($(_libc)_CFLAGS) $($(_profile)_CFLAGS) $($(_link_type)_CFLAGS) $(_servicepoint_cflags)
|
||||||
ifeq ($(LTO), 1)
|
ifeq ($(LTO), 1)
|
||||||
CFLAGS += -flto
|
CFLAGS += -flto
|
||||||
|
@ -103,7 +105,7 @@ _unstripped_bins := $(addsuffix _unstripped, $(_bins))
|
||||||
|
|
||||||
.PHONY: all build-rust
|
.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 $@
|
$(CC) $< $(CFLAGS) -o $@
|
||||||
|
|
Loading…
Reference in a new issue