From 25eb50e9cb1e653aa9683b72abb9c78c2859d5d6 Mon Sep 17 00:00:00 2001 From: Oleksii Bidnichenko Date: Tue, 7 Sep 2021 11:08:49 +0300 Subject: [PATCH] Enable LDFLAGS flag override In case of the project cross-compilation, dependent libraries (libcrypt) are located outside of the default library locations. --- examples/Gertboard/Makefile | 2 +- examples/Makefile | 2 +- examples/PiFace/Makefile | 2 +- examples/PiGlow/Makefile | 2 +- examples/q2w/Makefile | 2 +- examples/scrollPhat/Makefile | 2 +- gpio/.Makefile.swp | Bin 0 -> 12288 bytes gpio/Makefile | 2 +- wiringPi/Makefile | 3 ++- wiringPiD/Makefile | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 gpio/.Makefile.swp diff --git a/examples/Gertboard/Makefile b/examples/Gertboard/Makefile index 01a3cc3..6355624 100644 --- a/examples/Gertboard/Makefile +++ b/examples/Gertboard/Makefile @@ -15,7 +15,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm # Should not alter anything below this line diff --git a/examples/Makefile b/examples/Makefile index 5813ca0..925f33d 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -32,7 +32,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt # Should not alter anything below this line diff --git a/examples/PiFace/Makefile b/examples/PiFace/Makefile index a5c7c72..9a7e70b 100644 --- a/examples/PiFace/Makefile +++ b/examples/PiFace/Makefile @@ -32,7 +32,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm # Should not alter anything below this line diff --git a/examples/PiGlow/Makefile b/examples/PiGlow/Makefile index 10b7bd7..3f89ec6 100644 --- a/examples/PiGlow/Makefile +++ b/examples/PiGlow/Makefile @@ -32,7 +32,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm # Should not alter anything below this line diff --git a/examples/q2w/Makefile b/examples/q2w/Makefile index 7dc0e55..f96cd7d 100644 --- a/examples/q2w/Makefile +++ b/examples/q2w/Makefile @@ -32,7 +32,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm ############################################################################### diff --git a/examples/scrollPhat/Makefile b/examples/scrollPhat/Makefile index ac384d8..22a0ca3 100644 --- a/examples/scrollPhat/Makefile +++ b/examples/scrollPhat/Makefile @@ -32,7 +32,7 @@ CC ?= gcc INCLUDE = -I/usr/local/include CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L/usr/local/lib +LDFLAGS ?= -L/usr/local/lib LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm # Should not alter anything below this line diff --git a/gpio/.Makefile.swp b/gpio/.Makefile.swp new file mode 100644 index 0000000000000000000000000000000000000000..118f5d6c38afcdc6f5ad275c3d802b32fe9807cd GIT binary patch literal 12288 zcmeI2O^hQ)6~}8432{CM3Hdlhd6^l39gVwZCi@Xg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+If8s)Z#5ZCQn6hJqd%j8;O9pH;($)`AHq&suAIL zNG?_)UYsBf;aH`-JDThcJ@j*3?BmRj`r2#!3L<=(;7<98R-<@vGAY=k9Zcn| zqlS~7?G7EmN+s=5&$by#Pt8;|5kL!{YFU9kV%Sc)B1bS@M zbd}9rn2C!8&QbBNd*bHjkvbgQRmjmuMtyuFJ9P~rtE*GGNTCq)NI#1Ff@zLMBctaH z4HfiESK7i0MQA>1BxZKhkixzix(@aEzQByLh1|!4;8>;pm{b=tK+tBjO%)M_m>-+M z69IRrKJ366RT7JA;?}VZsf%Ji&;`H|5tnW_ab&C9D4i`a}JW@iq}B{7Yi#3?tgMT4!tR78R>Iv|Vg8U~%V*u}lhg z#lG<3c;vu$C88YhAmCo4<4kN!wbaibM}|=#VHFK!(yy;D)1p3)NJg-ViP;e}3`KY7 zE>0!L;_g@t15$p37oVJ7QRH&Hwx%^98A}Vh5g>x5>PGMcX9~|fu6r$#Kxz-V&_mNy zOaxzqLWvo8qMw#Q92iC!gwv+SCxeIN>pX^i#Ml|XUxTjpFP!*S&~cH?@yHSf;%F(j z=a_L`@l1ymHlHcdT%zS1sz)c_!8p#mj=8}@zk{d#nCcQEwseKjd&{-vK1bQWq?_iU zaJ>tkUO$-*2#=?R}{L5AdINe%G2>L5(i L<7A6HezW%g{iTsV literal 0 HcmV?d00001 diff --git a/gpio/Makefile b/gpio/Makefile index 6b8f838..9fb6084 100644 --- a/gpio/Makefile +++ b/gpio/Makefile @@ -36,7 +36,7 @@ CC ?= gcc INCLUDE = -I$(DESTDIR)$(PREFIX)/include CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib +LDFLAGS ?= -L$(DESTDIR)$(PREFIX)/lib LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt # May not need to alter anything below this line diff --git a/wiringPi/Makefile b/wiringPi/Makefile index 3b825da..9ebb203 100644 --- a/wiringPi/Makefile +++ b/wiringPi/Makefile @@ -42,6 +42,7 @@ DEFS = -D_GNU_SOURCE CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC $(EXTRA_CFLAGS) #CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Wconversion -Winline $(INCLUDE) -pipe -fPIC +LDFLAGS ?= -L/usr/local/lib LIBS = -lm -lpthread -lrt -lcrypt ############################################################################### @@ -75,7 +76,7 @@ static: $(DYNAMIC): $(OBJ) $Q echo "[Link (Dynamic)]" - $Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(OBJ) $(LIBS) + $Q $(CC) -shared -Wl,-soname,libwiringPi.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPi.so.$(VERSION) $(OBJ) $(LDFLAGS) $(LIBS) .c.o: $Q echo [Compile] $< diff --git a/wiringPiD/Makefile b/wiringPiD/Makefile index e050207..6757c0b 100644 --- a/wiringPiD/Makefile +++ b/wiringPiD/Makefile @@ -35,7 +35,7 @@ CC ?= gcc INCLUDE = -I$(DESTDIR)$(PREFIX)/include CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe $(EXTRA_CFLAGS) -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib +LDFLAGS ?= -L$(DESTDIR)$(PREFIX)/lib LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt # May not need to alter anything below this line