From c0c00d05bc6adc2223d00222262002c811f360c4 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 25 Feb 2022 17:43:28 +0800 Subject: [PATCH] mw_debug: Add STATIC_URJTAG flag Revert to linking dynamically by default, can statically link with `make STATIC_URJTAG=1` Fixes #351 Signed-off-by: Matt Johnston --- scripts/mw_debug/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/mw_debug/Makefile b/scripts/mw_debug/Makefile index e35fffa..776d7aa 100644 --- a/scripts/mw_debug/Makefile +++ b/scripts/mw_debug/Makefile @@ -1,10 +1,16 @@ CFLAGS = -O2 -g -Wall -std=c99 # CFLAGS += -I urjtag/urjtag/include/ -L urjtag/urjtag/src/.libs/ +# +ifeq ($(STATIC_URJTAG), 1) + LIBURJTAG=-Wl,-Bstatic -lurjtag -Wl,-Bdynamic -lftdi1 -lusb-1.0 -lreadline +else + LIBURJTAG=-lurjtag +endif all: mw_debug mw_debug: mw_debug.c - $(CC) -o $@ $^ $(CFLAGS) -Wl,-Bstatic -lurjtag -Wl,-Bdynamic -lftdi1 -lusb-1.0 -lreadline + $(CC) -o $@ $^ $(CFLAGS) $(LIBURJTAG) clean: rm -f mw_debug -- 2.30.2