1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

Allow to easily set a global path prefix for libraries and include files

Gets rid of a few DOS-specific Makefile hacks.

Corresponding to flashrom svn r1863.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Stefan Tauner 2015-01-10 09:32:44 +00:00
parent d5ff845545
commit be62d3fc07
2 changed files with 9 additions and 13 deletions

View File

@ -39,7 +39,8 @@ CFLAGS ?= -Os -Wall -Wshadow
EXPORTDIR ?= . EXPORTDIR ?= .
AR ?= ar AR ?= ar
RANLIB ?= ranlib RANLIB ?= ranlib
DOSLIBS_BASE ?= .. LIBS_BASE ?= ..
# The following parameter changes the default programmer that will be used if there is no -p/--programmer # The following parameter changes the default programmer that will be used if there is no -p/--programmer
# argument given when running flashrom. The predefined setting does not enable any default so that every # argument given when running flashrom. The predefined setting does not enable any default so that every
# user has to declare the programmer he wants to use on every run. The rationale for this to be not set # user has to declare the programmer he wants to use on every run. The rationale for this to be not set
@ -66,6 +67,9 @@ ifeq ($(WARNERROR), yes)
CFLAGS += -Werror CFLAGS += -Werror
endif endif
CPPFLAGS += -I$(LIBS_BASE)/include
LDFLAGS += -L$(LIBS_BASE)/lib
############################################################################### ###############################################################################
# General OS-specific settings. # General OS-specific settings.
# 1. Prepare for later by gathering information about host and target OS # 1. Prepare for later by gathering information about host and target OS
@ -115,12 +119,9 @@ endif
ifeq ($(TARGET_OS), DOS) ifeq ($(TARGET_OS), DOS)
EXEC_SUFFIX := .exe EXEC_SUFFIX := .exe
CPPFLAGS += -I$(DOSLIBS_BASE)/libgetopt
# DJGPP has odd uint*_t definitions which cause lots of format string warnings. # DJGPP has odd uint*_t definitions which cause lots of format string warnings.
CFLAGS += -Wno-format CFLAGS += -Wno-format
# FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt
LIBS += -lgetopt LIBS += -lgetopt
LDFLAGS += -L$(DOSLIBS_BASE)/libgetopt/
# Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support). # Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support).
ifeq ($(CONFIG_BUSPIRATE_SPI), yes) ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes
@ -710,12 +711,9 @@ PCILIBS += -lpciutils -lpci
# For (i386|x86_64)_iopl(2). # For (i386|x86_64)_iopl(2).
PCILIBS += -l$(shell uname -p) PCILIBS += -l$(shell uname -p)
else else
ifeq ($(TARGET_OS), DOS)
CPPFLAGS += -I$(DOSLIBS_BASE)/libpci/include
LDFLAGS += -L$(DOSLIBS_BASE)/libpci/lib/
PCILIBS += -lpci
else
PCILIBS += -lpci PCILIBS += -lpci
ifeq ($(TARGET_OS), OpenBSD) ifeq ($(TARGET_OS), OpenBSD)
# For (i386|amd64)_iopl(2). # For (i386|amd64)_iopl(2).
PCILIBS += -l$(shell uname -m) PCILIBS += -l$(shell uname -m)
@ -723,8 +721,6 @@ else
ifeq ($(TARGET_OS), Darwin) ifeq ($(TARGET_OS), Darwin)
# DirectHW framework can be found in the DirectHW library. # DirectHW framework can be found in the DirectHW library.
PCILIBS += -framework IOKit -framework DirectHW PCILIBS += -framework IOKit -framework DirectHW
else
endif
endif endif
endif endif
endif endif

4
README
View File

@ -106,9 +106,9 @@ To cross-compile on Linux for DOS:
You will need the following library source trees containing their compiled You will need the following library source trees containing their compiled
static libraries either in the parent directory of the flashrom source or static libraries either in the parent directory of the flashrom source or
specify the base folder on compile time with the DOSLIBS_BASE parameter. specify the base folder on compile time with the LIBS_BASE parameter.
The default as described above is equal to calling The default as described above is equal to calling
'make djgpp-dos DOSLIBS_BASE=..' 'make djgpp-dos LIBS_BASE=..'
To get and build said libraries... To get and build said libraries...
Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz