Don't abuse LDFLAGS and fix linking with -Wl,--as-needed.
authorChristian Ruppert <idl0r@gentoo.org>
Sun, 21 Mar 2010 21:22:51 +0000 (21:22 +0000)
committerStefan Reinauer <stepan@openbios.org>
Sun, 21 Mar 2010 21:22:51 +0000 (21:22 +0000)
Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5263 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/superiotool/Makefile

index 6a6b69762f01c7bf0a3cd1d2406494694cfe81fb..f871fb7073f15f199b5a45767c44238d6043ed8a 100644 (file)
@@ -36,7 +36,7 @@ OBJS = superiotool.o ali.o fintek.o ite.o nsc.o smsc.o winbond.o
 
 OS_ARCH = $(shell uname)
 ifeq ($(OS_ARCH), Darwin)
-LDFLAGS = -framework IOKit -framework DirectIO -lpci -lz
+LIBS = -framework IOKit -framework DirectIO -lpci -lz
 endif
 
 # Support for PCI-attached "Super I/Os" (e.g. in VIA VT82686A/B).
@@ -44,7 +44,7 @@ CONFIG_PCI = yes
 
 ifeq ($(CONFIG_PCI), yes)
 CFLAGS += -DPCI_SUPPORT
-LDFLAGS += -lpci
+LIBS += -lpci
 OBJS += pci.o via.o
 endif
 
@@ -53,7 +53,7 @@ all: $(PROGRAM)
 superiotool.o: *.c superiotool.h
 
 $(PROGRAM): $(OBJS) superiotool.h
-       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS)
+       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
 
 install: $(PROGRAM)
        mkdir -p $(DESTDIR)$(PREFIX)/sbin