* Add OSX/Darwin support
authorStefan Reinauer <stepan@coresystems.de>
Tue, 1 Sep 2009 09:57:55 +0000 (09:57 +0000)
committerStefan Reinauer <stepan@openbios.org>
Tue, 1 Sep 2009 09:57:55 +0000 (09:57 +0000)
* Add DESTDIR support

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4623 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/superiotool/Makefile
util/superiotool/superiotool.h

index d8ac62c1f355efd47f89e960cf006d55f864cd3c..6cb304273930a2882c7c1bb56507ebeae8c67d65 100644 (file)
@@ -34,17 +34,23 @@ CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \
 
 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
+endif
+
 all: $(PROGRAM)
 
 superiotool.o: *.c superiotool.h
 
 $(PROGRAM): $(OBJS) superiotool.h
-       $(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS)
+       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS)
 
 install: $(PROGRAM)
-       $(INSTALL) $(PROGRAM) $(PREFIX)/sbin
-       mkdir -p $(PREFIX)/share/man/man8
-       $(INSTALL) $(PROGRAM).8 $(PREFIX)/share/man/man8
+       mkdir -p $(DESTDIR)$(PREFIX)/sbin
+       $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
+       mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
+       $(INSTALL) $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
 
 clean:
        rm -f $(PROGRAM) *.o
index 5df60a785dcc67bc14ca5ba4d18088966d80f21d..f9a38a1d5ab59b3113b0af4bce78509379c71cc1 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2007 Carl-Daniel Hailfinger
  * Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
  * Copyright (C) 2008 Robinson P. Tryon <bishop.robinson@gmail.com>
+ * Copyright (C) 2008-2009 coresystems GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #if defined(__GLIBC__)
 #include <sys/io.h>
 #endif
+#if (defined(__MACH__) && defined(__APPLE__))
+/* DirectIO is available here: http://www.coresystems.de/en/directio */
+#include <DirectIO/darwinio.h>
+#endif
 
 #if defined(__FreeBSD__)
 #include <sys/types.h>