6b5bc77c9b
Stefan thinks they don't add value. Command used: sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool) The exceptions are for: - crossgcc (patch file) - gcov (imported from gcc) - elf.h (imported from GNU's libc) - nvramtool (more complicated header) The removed lines are: - fmt.Fprintln(f, "/* This file is part of the coreboot project. */") -# This file is part of a set of unofficial pre-commit hooks available -/* This file is part of coreboot */ -# This file is part of msrtool. -/* This file is part of msrtool. */ - * This file is part of ncurses, designed to be appended after curses.h.in -/* This file is part of pgtblgen. */ - * This file is part of the coreboot project. - /* This file is part of the coreboot project. */ -# This file is part of the coreboot project. -# This file is part of the coreboot project. -## This file is part of the coreboot project. --- This file is part of the coreboot project. -/* This file is part of the coreboot project */ -/* This file is part of the coreboot project. */ -;## This file is part of the coreboot project. -# This file is part of the coreboot project. It originated in the - * This file is part of the coreinfo project. -## This file is part of the coreinfo project. - * This file is part of the depthcharge project. -/* This file is part of the depthcharge project. */ -/* This file is part of the ectool project. */ - * This file is part of the GNU C Library. - * This file is part of the libpayload project. -## This file is part of the libpayload project. -/* This file is part of the Linux kernel. */ -## This file is part of the superiotool project. -/* This file is part of the superiotool project */ -/* This file is part of uio_usbdebug */ Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
108 lines
2.9 KiB
Makefile
108 lines
2.9 KiB
Makefile
##
|
|
## 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
|
|
## the Free Software Foundation; either version 2 of the License, or
|
|
## (at your option) any later version.
|
|
##
|
|
## This program is distributed in the hope that it will be useful,
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
## GNU General Public License for more details.
|
|
##
|
|
|
|
PROGRAM = superiotool
|
|
|
|
CC ?= gcc
|
|
INSTALL ?= /usr/bin/env install
|
|
PREFIX ?= /usr/local
|
|
|
|
# Set the superiotool version string to the output of 'git describe'.
|
|
|
|
VERSION := -D'SUPERIOTOOL_VERSION="$(shell git describe 2>/dev/null)"'
|
|
|
|
CFLAGS += -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \
|
|
-Werror-implicit-function-declaration -ansi -pedantic $(VERSION)
|
|
LDFLAGS += -lz
|
|
|
|
OBJS = superiotool.o serverengines.o ali.o exar.o fintek.o ite.o nsc.o \
|
|
nuvoton.o smsc.o winbond.o infineon.o aspeed.o
|
|
|
|
OS_ARCH = $(shell uname)
|
|
ifeq ($(OS_ARCH), Darwin)
|
|
LIBS = -framework IOKit -framework DirectHW -lpci -lz
|
|
endif
|
|
ifeq ($(OS_ARCH), FreeBSD)
|
|
CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \
|
|
-Werror-implicit-function-declaration -ansi $(VERSION) \
|
|
-I/usr/local/include
|
|
LDFLAGS += -L/usr/local/lib
|
|
LIBS = -lz
|
|
endif
|
|
ifeq ($(OS_ARCH), NetBSD)
|
|
CFLAGS += -I/usr/pkg/include
|
|
LDFLAGS += -L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib
|
|
LIBS = -lz -l$(shell uname -p)
|
|
endif
|
|
|
|
# Support for PCI-attached "Super I/Os" (e.g. in VIA VT82686A/B).
|
|
CONFIG_PCI = yes
|
|
|
|
ifeq ($(CONFIG_PCI), yes)
|
|
CFLAGS += -DPCI_SUPPORT
|
|
OBJS += pci.o via.o amd.o
|
|
LIBS += -lpci
|
|
ifeq ($(OS_ARCH),NetBSD)
|
|
LIBS += -lpciutils
|
|
endif
|
|
endif
|
|
|
|
all: pciutils $(PROGRAM)
|
|
|
|
superiotool.o: *.c superiotool.h
|
|
|
|
$(PROGRAM): $(OBJS) superiotool.h
|
|
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
|
|
|
|
install: $(PROGRAM)
|
|
mkdir -p $(DESTDIR)$(PREFIX)/sbin
|
|
$(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
|
|
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
|
|
$(INSTALL) -p -m644 $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
|
|
|
|
clean:
|
|
rm -f $(PROGRAM) *.o junit.xml
|
|
|
|
distclean: clean
|
|
|
|
.PHONY: all install clean distclean
|
|
|
|
ifeq ($(CONFIG_PCI), yes)
|
|
define LIBPCI_TEST
|
|
/* Avoid a failing test due to libpci header symbol shadowing breakage */
|
|
#define index shadow_workaround_index
|
|
#ifdef __NetBSD__
|
|
#include <pciutils/pci.h>
|
|
#else
|
|
#include <pci/pci.h>
|
|
#endif
|
|
struct pci_access *pacc;
|
|
int main(int argc, char **argv)
|
|
{
|
|
(void) argc;
|
|
(void) argv;
|
|
pacc = pci_alloc();
|
|
return 0;
|
|
}
|
|
endef
|
|
export LIBPCI_TEST
|
|
|
|
pciutils:
|
|
@printf "\nChecking for pciutils and zlib... "
|
|
@echo "$$LIBPCI_TEST" > .test.c
|
|
@$(CC) $(CFLAGS) .test.c -o .test $(LIBS) $(LDFLAGS) >/dev/null 2>&1 && \
|
|
printf "found.\n" || ( printf "not found.\n\n"; \
|
|
printf "Please install pciutils-devel and zlib-devel.\n"; \
|
|
printf "See README for more information.\n\n"; \
|
|
rm -f .test.c .test; exit 1)
|
|
@rm -rf .test.c .test .test.dSYM
|
|
endif
|