mw_debug: Add STATIC_URJTAG flag
authorMatt Johnston <matt@codeconstruct.com.au>
Fri, 25 Feb 2022 09:43:28 +0000 (17:43 +0800)
committerMatt Johnston <matt@codeconstruct.com.au>
Fri, 25 Feb 2022 09:43:28 +0000 (17:43 +0800)
Revert to linking dynamically by default, can statically link with
`make STATIC_URJTAG=1`

Fixes #351

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
scripts/mw_debug/Makefile

index e35fffa6af57e4df80a24baa832f5d43289f6b8f..776d7aadf1fd51c6d3afc935122d5a63b4ff30a7 100644 (file)
@@ -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