I have a big makefile that I am trying to get my head around, this line is what is confusing me.
LDFLAGS = -Wl,-rpath-link,$(SYSROOT)/lib/arm-linux-gnueabihf,-rpath-link,$(SYSROOT)/usr/lib/arm-linux-gnueabihf --sysroot=$(SYSROOT) -L$(SYSROOT)/lib -L$(SYSROOT)/usr/lib -L$(SYSROOT)/usr/lib/arm-linux-gnueabihf -B$(SYSROOT)/usr/lib/arm-linux-gnueabihf -dynamic -lpthread
I know roughly the purpose of LDFLAGS, but I struggle following the chain of variables in this linker flag expression. It seems like there is unnecessary repetition and that confuses me slightly. I need to modify that makefile to include shared library that the manufacturer of the embedded system has made. The line below is what is only provided in the software manual for that system,
PC$ arm-linux-gnueabihf-gcc -Wall -mthumb -mthumb-interwork -D_REENTRANT -oowa4x_AN3 ./*.cpp -ldl -lpthread -lGSM_Module
I'd like to include lGSM_Module in the above LDFLAGS variable. I have tried this, but successfully.
LDFLAGS = -Wl,-rpath-link,$(SYSROOT)/lib/arm-linux-gnueabihf-gcc,-rpath-link,$(SYSROOT)/usr/lib/arm-linux-gnueabihf --sysroot=$(SYSROOT) -L$(SYSROOT)/lib -L$(SYSROOT)/usr/lib -L$(SYSROOT)/usr/lib/arm-linux-gnueabihf -B$(SYSROOT)/usr/lib/arm-linux-gnueabihf -dynamic -lpthread -shared -oowa4x_AN3 -ldl -lpthread -L/lib -lGPS2_Module