nvramtool:
* Add OSX/Darwin support * Add $DESTDIR support * Clean up make install/spec Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4622 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
f7f2f258d8
commit
4db6cbd26c
|
@ -18,6 +18,11 @@ OBJS = cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \
|
||||||
hexdump.o input_file.o layout.o layout_file.o lbtable.o \
|
hexdump.o input_file.o layout.o layout_file.o lbtable.o \
|
||||||
nvramtool.o opts.o reg_expr.o
|
nvramtool.o opts.o reg_expr.o
|
||||||
|
|
||||||
|
OS_ARCH = $(shell uname)
|
||||||
|
ifeq ($(OS_ARCH), Darwin)
|
||||||
|
LDFLAGS = -framework DirectIO
|
||||||
|
endif
|
||||||
|
|
||||||
all: dep $(PROGRAM)
|
all: dep $(PROGRAM)
|
||||||
|
|
||||||
$(PROGRAM): $(OBJS)
|
$(PROGRAM): $(OBJS)
|
||||||
|
@ -34,9 +39,10 @@ dep:
|
||||||
@$(CC) -MM *.c > .dependencies
|
@$(CC) -MM *.c > .dependencies
|
||||||
|
|
||||||
install: $(PROGRAM)
|
install: $(PROGRAM)
|
||||||
$(INSTALL) $(PROGRAM) $(PREFIX)/sbin
|
mkdir -p $(DESTDIR)$(PREFIX)/sbin
|
||||||
mkdir -p $(PREFIX)/share/man/man1
|
$(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
|
||||||
$(INSTALL) $(PROGRAM).8 $(PREFIX)/share/man/man8
|
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
|
||||||
|
$(INSTALL) $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
|
||||||
|
|
||||||
.PHONY: all clean distclean dep
|
.PHONY: all clean distclean dep
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,12 @@
|
||||||
#define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); })
|
#define INW(x) __extension__ ({ u_int tmp = (x); inw(tmp); })
|
||||||
#define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); })
|
#define INL(x) __extension__ ({ u_int tmp = (x); inl(tmp); })
|
||||||
#else
|
#else
|
||||||
|
#if defined(__GLIBC__)
|
||||||
#include <sys/io.h>
|
#include <sys/io.h>
|
||||||
|
#endif
|
||||||
|
#if (defined(__MACH__) && defined(__APPLE__))
|
||||||
|
#include <DirectIO/darwinio.h>
|
||||||
|
#endif
|
||||||
#define OUTB outb
|
#define OUTB outb
|
||||||
#define OUTW outw
|
#define OUTW outw
|
||||||
#define OUTL outl
|
#define OUTL outl
|
||||||
|
|
|
@ -33,9 +33,9 @@ make
|
||||||
%install
|
%install
|
||||||
rm -rf "$RPM_BUILD_ROOT"
|
rm -rf "$RPM_BUILD_ROOT"
|
||||||
mkdir -p "$RPM_BUILD_ROOT/usr/bin"
|
mkdir -p "$RPM_BUILD_ROOT/usr/bin"
|
||||||
mkdir -p "$RPM_BUILD_ROOT/usr/man/man1"
|
mkdir -p "$RPM_BUILD_ROOT/usr/man/man8"
|
||||||
cp nvramtool "$RPM_BUILD_ROOT/usr/bin"
|
cp nvramtool "$RPM_BUILD_ROOT/usr/bin"
|
||||||
cp nvramtool.1.gz $RPM_BUILD_ROOT/usr/man/man1
|
cp nvramtool.8.gz $RPM_BUILD_ROOT/usr/man/man8
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf "$RPM_BUILD_ROOT"
|
rm -rf "$RPM_BUILD_ROOT"
|
||||||
|
@ -45,4 +45,4 @@ rm -rf "$RPM_BUILD_ROOT"
|
||||||
%doc ChangeLog README
|
%doc ChangeLog README
|
||||||
%doc README
|
%doc README
|
||||||
/usr/bin/nvramtool
|
/usr/bin/nvramtool
|
||||||
/usr/man/man1/nvramtool.1.gz
|
/usr/man/man8/nvramtool.8.gz
|
||||||
|
|
Loading…
Reference in New Issue