build: At least honor the LDFLAGS from the environment

When not honoring the environment we end up linking it without the
GNU_HASH for symbol look-up. Put the content into LIBS and place
these options last to make it link.

We still override the CFLAGS but that seems to not cause issues yet

Fixes:

ERROR: ... No GNU_HASH in the elf binary: 'rtl8168-eeprom' [ldflags]
This commit is contained in:
Holger Hans Peter Freyther 2017-04-02 14:14:11 +02:00
parent e62e515ce3
commit 47e0b24d7a
1 changed files with 2 additions and 2 deletions

View File

@ -1,11 +1,11 @@
CFLAGS=-Wall -g `pkg-config --cflags libpci` CFLAGS=-Wall -g `pkg-config --cflags libpci`
LDFLAGS=`pkg-config --libs libpci` LIBS=`pkg-config --libs libpci`
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -o $@ -c $^ $(CC) $(CFLAGS) -o $@ -c $^
rtl8168-eeprom: rtl8168-eeprom.o rtl8168-eeprom: rtl8168-eeprom.o
$(CC) $(LDFLAGS) -o $@ $^ $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
clean: clean:
rm -f rtl8168-eeprom rtl8168-eeprom.o rm -f rtl8168-eeprom rtl8168-eeprom.o