blob: 7d3da083ec69e0bbf84f374ba2f3bd0f111dac39 [file] [log] [blame]
Ollie Lho184a4042005-11-26 21:55:36 +00001#
Uwe Hermannf78cff12009-06-12 14:05:25 +00002# This file is part of the flashrom project.
3#
4# Copyright (C) 2005 coresystems GmbH <stepan@coresystems.de>
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +00005# Copyright (C) 2009,2010,2012 Carl-Daniel Hailfinger
Uwe Hermannf78cff12009-06-12 14:05:25 +00006#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; version 2 of the License.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Ollie Lho184a4042005-11-26 21:55:36 +000019#
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000020
Ollie Lho184a4042005-11-26 21:55:36 +000021PROGRAM = flashrom
Ronald G. Minnicheaab50b2003-09-12 22:41:53 +000022
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000023###############################################################################
24# Defaults for the toolchain.
25
26# If you want to cross-compile, just run e.g.
27# make CC=i586-pc-msdosdjgpp-gcc
28# You may have to specify STRIP/AR/RANLIB as well.
Carl-Daniel Hailfingerb7bce8a2012-08-14 21:36:11 +000029#
30# Note for anyone editing this Makefile: gnumake will happily ignore any
31# changes in this Makefile to variables set on the command line.
Uwe Hermannc2a9c9c2009-05-14 14:51:14 +000032CC ?= gcc
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000033STRIP ?= strip
Christian Ruppertdb9d9f42009-05-14 14:17:07 +000034INSTALL = install
Paul Fox05dfbe62009-06-16 21:08:06 +000035DIFF = diff
Christian Ruppertdb9d9f42009-05-14 14:17:07 +000036PREFIX ?= /usr/local
Uwe Hermann56b2cb02009-05-21 15:59:58 +000037MANDIR ?= $(PREFIX)/share/man
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000038CFLAGS ?= -Os -Wall -Wshadow
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +000039EXPORTDIR ?= .
Patrick Georgi97bc95c2011-03-08 07:17:44 +000040AR ?= ar
41RANLIB ?= ranlib
Stefan Taunerbe62d3f2015-01-10 09:32:44 +000042LIBS_BASE ?= ..
43
Stefan Taunerfd0d4132012-09-25 21:24:55 +000044# The following parameter changes the default programmer that will be used if there is no -p/--programmer
45# argument given when running flashrom. The predefined setting does not enable any default so that every
46# user has to declare the programmer he wants to use on every run. The rationale for this to be not set
47# (to e.g. the internal programmer) is that forgetting to specify this when working with another programmer
48# easily puts the system attached to the default programmer at risk (e.g. you want to flash coreboot to another
49# system attached to an external programmer while the default programmer is set to the internal programmer, and
50# you forget to use the -p parameter. This would (try to) overwrite the existing firmware of the computer
51# running flashrom). Please do not enable this without thinking about the possible consequences. Possible
52# values are those specified in enum programmer in programmer.h (which depend on other CONFIG_* options
53# evaluated below, namely those that enable/disable the various programmers).
54# Compilation will fail for unspecified values.
55CONFIG_DEFAULT_PROGRAMMER ?= PROGRAMMER_INVALID
Stefan Tauner265fcac2014-06-02 00:12:23 +000056# The following adds a default parameter for the default programmer set above (only).
57CONFIG_DEFAULT_PROGRAMMER_ARGS ?= ''
58# Example: compiling with
59# make CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_SERPROG CONFIG_DEFAULT_PROGRAMMER_ARGS="dev=/dev/ttyUSB0:1500000"
60# would make executing './flashrom' (almost) equivialent to './flashrom -p serprog:dev=/dev/ttyUSB0:1500000'.
Christian Ruppertdb9d9f42009-05-14 14:17:07 +000061
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000062# If your compiler spits out excessive warnings, run make WARNERROR=no
63# You shouldn't have to change this flag.
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000064WARNERROR ?= yes
65
66ifeq ($(WARNERROR), yes)
67CFLAGS += -Werror
68endif
69
Stefan Taunerbe62d3f2015-01-10 09:32:44 +000070CPPFLAGS += -I$(LIBS_BASE)/include
71LDFLAGS += -L$(LIBS_BASE)/lib
72
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000073###############################################################################
Stefan Tauner037cd842013-08-25 00:10:56 +000074# General OS-specific settings.
75# 1. Prepare for later by gathering information about host and target OS
76# 2. Set compiler flags and parameters according to OSes
77# 3. Likewise verify user-supplied CONFIG_* variables.
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000078
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +000079# HOST_OS is only used to work around local toolchain issues.
Stefan Tauner037cd842013-08-25 00:10:56 +000080HOST_OS ?= $(shell uname)
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +000081ifeq ($(HOST_OS), MINGW32_NT-5.1)
82# Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found".
83CC = gcc
84endif
85ifneq ($(HOST_OS), SunOS)
Adam Kaufman064b1f22007-02-06 19:47:50 +000086STRIP_ARGS = -s
87endif
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +000088
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000089# Determine the destination OS.
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +000090# IMPORTANT: The following line must be placed before TARGET_OS is ever used
91# (of course), but should come after any lines setting CC because the line
92# below uses CC itself.
93override TARGET_OS := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
94
95ifeq ($(TARGET_OS), Darwin)
Stefan Reinauer2fea3f32010-01-21 20:26:30 +000096CPPFLAGS += -I/opt/local/include -I/usr/local/include
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000097LDFLAGS += -L/opt/local/lib -L/usr/local/lib
Stefan Reinauerf79edb92009-01-26 01:23:31 +000098endif
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000099
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000100ifeq ($(TARGET_OS), FreeBSD)
Stefan Reinauer2fea3f32010-01-21 20:26:30 +0000101CPPFLAGS += -I/usr/local/include
Andriy Gapon65c1b862008-05-22 13:22:45 +0000102LDFLAGS += -L/usr/local/lib
103endif
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000104
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000105ifeq ($(TARGET_OS), OpenBSD)
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +0000106CPPFLAGS += -I/usr/local/include
107LDFLAGS += -L/usr/local/lib
108endif
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000109
Stefan Taunerc65b8552013-09-12 15:48:39 +0000110ifeq ($(TARGET_OS), NetBSD)
111CPPFLAGS += -I/usr/pkg/include
112LDFLAGS += -L/usr/pkg/lib
113endif
114
115ifeq ($(TARGET_OS), DragonFlyBSD)
116CPPFLAGS += -I/usr/pkg/include
117LDFLAGS += -L/usr/pkg/lib
118endif
119
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000120ifeq ($(TARGET_OS), DOS)
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000121EXEC_SUFFIX := .exe
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000122# DJGPP has odd uint*_t definitions which cause lots of format string warnings.
Carl-Daniel Hailfingerb7bce8a2012-08-14 21:36:11 +0000123CFLAGS += -Wno-format
Stefan Tauner449abe22013-09-11 23:34:57 +0000124LIBS += -lgetopt
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000125# Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support).
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000126ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
127UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes
128else
129override CONFIG_BUSPIRATE_SPI = no
130endif
131ifeq ($(CONFIG_SERPROG), yes)
132UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes
133else
134override CONFIG_SERPROG = no
135endif
Stefan Taunerd94d25d2012-07-28 03:17:15 +0000136ifeq ($(CONFIG_PONY_SPI), yes)
137UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes
138else
139override CONFIG_PONY_SPI = no
140endif
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000141# Dediprog and FT2232 are not supported under DOS (missing USB support).
142ifeq ($(CONFIG_DEDIPROG), yes)
143UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes
144else
145override CONFIG_DEDIPROG = no
146endif
147ifeq ($(CONFIG_FT2232_SPI), yes)
148UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes
149else
150override CONFIG_FT2232_SPI = no
151endif
James Lairdc60de0e2013-03-27 13:00:23 +0000152ifeq ($(CONFIG_USBBLASTER_SPI), yes)
153UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes
154else
155override CONFIG_USBBLASTER_SPI = no
156endif
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000157endif
Ollie Lho184a4042005-11-26 21:55:36 +0000158
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000159# FIXME: Should we check for Cygwin/MSVC as well?
160ifeq ($(TARGET_OS), MinGW)
161EXEC_SUFFIX := .exe
Uwe Hermannd5e85d62011-07-03 19:44:12 +0000162# MinGW doesn't have the ffs() function, but we can use gcc's __builtin_ffs().
Carl-Daniel Hailfingera8da2242012-08-15 23:06:32 +0000163FLASHROM_CFLAGS += -Dffs=__builtin_ffs
Carl-Daniel Hailfinger11990da2013-07-13 23:21:05 +0000164# Some functions provided by Microsoft do not work as described in C99 specifications. This macro fixes that
165# for MinGW. See http://sourceforge.net/apps/trac/mingw-w64/wiki/printf%20and%20scanf%20family */
166FLASHROM_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
Uwe Hermannd5e85d62011-07-03 19:44:12 +0000167# libusb-win32/libftdi stuff is usually installed in /usr/local.
168CPPFLAGS += -I/usr/local/include
169LDFLAGS += -L/usr/local/lib
Uwe Hermannd5e85d62011-07-03 19:44:12 +0000170# For now we disable all PCI-based programmers on Windows/MinGW (no libpci).
171ifeq ($(CONFIG_INTERNAL), yes)
172UNSUPPORTED_FEATURES += CONFIG_INTERNAL=yes
173else
174override CONFIG_INTERNAL = no
175endif
176ifeq ($(CONFIG_RAYER_SPI), yes)
177UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes
178else
179override CONFIG_RAYER_SPI = no
180endif
181ifeq ($(CONFIG_NIC3COM), yes)
182UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes
183else
184override CONFIG_NIC3COM = no
185endif
186ifeq ($(CONFIG_GFXNVIDIA), yes)
187UNSUPPORTED_FEATURES += CONFIG_GFXNVIDIA=yes
188else
189override CONFIG_GFXNVIDIA = no
190endif
191ifeq ($(CONFIG_SATASII), yes)
192UNSUPPORTED_FEATURES += CONFIG_SATASII=yes
193else
194override CONFIG_SATASII = no
195endif
196ifeq ($(CONFIG_ATAHPT), yes)
197UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes
198else
199override CONFIG_ATAHPT = no
200endif
Jonathan Kollasch7f0f3fa2014-06-01 10:26:23 +0000201ifeq ($(CONFIG_ATAVIA), yes)
202UNSUPPORTED_FEATURES += CONFIG_ATAVIA=yes
203else
204override CONFIG_ATAVIA = no
205endif
Kyösti Mälkki72d42f82014-06-01 23:48:31 +0000206ifeq ($(CONFIG_IT8212), yes)
207UNSUPPORTED_FEATURES += CONFIG_IT8212=yes
208else
209override CONFIG_IT8212 = no
210endif
Uwe Hermannd5e85d62011-07-03 19:44:12 +0000211ifeq ($(CONFIG_DRKAISER), yes)
212UNSUPPORTED_FEATURES += CONFIG_DRKAISER=yes
213else
214override CONFIG_DRKAISER = no
215endif
216ifeq ($(CONFIG_NICREALTEK), yes)
217UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes
218else
219override CONFIG_NICREALTEK = no
220endif
221ifeq ($(CONFIG_NICNATSEMI), yes)
222UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes
223else
224override CONFIG_NICNATSEMI = no
225endif
226ifeq ($(CONFIG_NICINTEL), yes)
227UNSUPPORTED_FEATURES += CONFIG_NICINTEL=yes
228else
229override CONFIG_NICINTEL = no
230endif
Ricardo Ribalda Delgado2a41f0a2014-07-28 20:35:21 +0000231ifeq ($(CONFIG_NICINTEL_EEPROM), yes)
232UNSUPPORTED_FEATURES += CONFIG_NICINTEL_EEPROM=yes
233else
234override CONFIG_NICINTEL_EEPROM = no
235endif
Uwe Hermannd5e85d62011-07-03 19:44:12 +0000236ifeq ($(CONFIG_NICINTEL_SPI), yes)
237UNSUPPORTED_FEATURES += CONFIG_NICINTEL_SPI=yes
238else
239override CONFIG_NICINTEL_SPI = no
240endif
241ifeq ($(CONFIG_OGP_SPI), yes)
242UNSUPPORTED_FEATURES += CONFIG_OGP_SPI=yes
243else
244override CONFIG_OGP_SPI = no
245endif
246ifeq ($(CONFIG_SATAMV), yes)
247UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes
248else
249override CONFIG_SATAMV = no
250endif
251endif
252
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000253ifeq ($(TARGET_OS), libpayload)
Stefan Tauner8e19b042013-08-28 09:55:04 +0000254ifeq ($(MAKECMDGOALS),)
255.DEFAULT_GOAL := libflashrom.a
256$(info Setting default goal to libflashrom.a)
257endif
Carl-Daniel Hailfingera8da2242012-08-15 23:06:32 +0000258FLASHROM_CFLAGS += -DSTANDALONE
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000259ifeq ($(CONFIG_DUMMY), yes)
260UNSUPPORTED_FEATURES += CONFIG_DUMMY=yes
261else
262override CONFIG_DUMMY = no
263endif
Carl-Daniel Hailfinger11990da2013-07-13 23:21:05 +0000264# Bus Pirate, Serprog and PonyProg are not supported with libpayload (missing serial support).
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000265ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
266UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes
267else
268override CONFIG_BUSPIRATE_SPI = no
269endif
270ifeq ($(CONFIG_SERPROG), yes)
271UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes
272else
273override CONFIG_SERPROG = no
274endif
Carl-Daniel Hailfinger11990da2013-07-13 23:21:05 +0000275ifeq ($(CONFIG_PONY_SPI), yes)
276UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes
277else
278override CONFIG_PONY_SPI = no
279endif
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000280# Dediprog and FT2232 are not supported with libpayload (missing libusb support)
281ifeq ($(CONFIG_DEDIPROG), yes)
282UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes
283else
284override CONFIG_DEDIPROG = no
285endif
286ifeq ($(CONFIG_FT2232_SPI), yes)
287UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes
288else
289override CONFIG_FT2232_SPI = no
290endif
James Lairdc60de0e2013-03-27 13:00:23 +0000291ifeq ($(CONFIG_USBBLASTER_SPI), yes)
292UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes
293else
294override CONFIG_USBBLASTER_SPI = no
295endif
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000296endif
297
Carl-Daniel Hailfinger8541d232012-02-16 21:00:27 +0000298ifneq ($(TARGET_OS), Linux)
299ifeq ($(CONFIG_LINUX_SPI), yes)
300UNSUPPORTED_FEATURES += CONFIG_LINUX_SPI=yes
301else
302override CONFIG_LINUX_SPI = no
303endif
Alexandre Boeglin80e64712014-12-20 20:25:19 +0000304ifeq ($(CONFIG_MSTARDDC_SPI), yes)
305UNSUPPORTED_FEATURES += CONFIG_MSTARDDC_SPI=yes
306else
307override CONFIG_MSTARDDC_SPI = no
308endif
Carl-Daniel Hailfinger8541d232012-02-16 21:00:27 +0000309endif
310
Stefan Tauner037cd842013-08-25 00:10:56 +0000311###############################################################################
312# General architecture-specific settings.
313# Like above for the OS, below we verify user-supplied options depending on the target architecture.
314
Uwe Hermann44ffd582011-08-20 14:16:00 +0000315# Determine the destination processor architecture.
316# IMPORTANT: The following line must be placed before ARCH is ever used
317# (of course), but should come after any lines setting CC because the line
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000318# below uses CC itself.
319override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E arch.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
Uwe Hermann44ffd582011-08-20 14:16:00 +0000320
David Hendricksb286da72012-02-13 00:35:35 +0000321# PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM.
322# Right now this means the drivers below only work on x86.
323ifneq ($(ARCH), x86)
Uwe Hermann21b10c62011-07-29 12:13:01 +0000324ifeq ($(CONFIG_NIC3COM), yes)
325UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes
326else
327override CONFIG_NIC3COM = no
328endif
329ifeq ($(CONFIG_NICREALTEK), yes)
330UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes
331else
332override CONFIG_NICREALTEK = no
333endif
334ifeq ($(CONFIG_NICNATSEMI), yes)
335UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes
336else
337override CONFIG_NICNATSEMI = no
338endif
339ifeq ($(CONFIG_RAYER_SPI), yes)
340UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes
341else
342override CONFIG_RAYER_SPI = no
343endif
344ifeq ($(CONFIG_ATAHPT), yes)
345UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes
346else
347override CONFIG_ATAHPT = no
348endif
349ifeq ($(CONFIG_SATAMV), yes)
350UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes
351else
352override CONFIG_SATAMV = no
353endif
354endif
355
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000356###############################################################################
357# Flash chip drivers and bus support infrastructure.
358
Stefan Tauner4404f732013-09-12 08:28:56 +0000359CHIP_OBJS = jedec.o stm50.o w39.o w29ee011.o \
Carl-Daniel Hailfingera8cf3622014-08-08 08:33:01 +0000360 sst28sf040.o 82802ab.o \
Stefan Tauner6ee37e22012-12-29 15:03:51 +0000361 sst49lfxxxc.o sst_fwhub.o flashchips.o spi.o spi25.o spi25_statusreg.o \
Aidan Thorntondb4e87d2013-08-27 18:01:53 +0000362 opaque.o sfdp.o en29lv640b.o at45db.o
Sean Nelson5d134642009-12-24 16:54:21 +0000363
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000364###############################################################################
365# Library code.
Sean Nelson5d134642009-12-24 16:54:21 +0000366
Stefan Tauner6ad6e012014-06-12 00:04:32 +0000367LIB_OBJS = layout.o flashrom.o udelay.o programmer.o helpers.o
Sean Nelson5d134642009-12-24 16:54:21 +0000368
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000369###############################################################################
370# Frontend related stuff.
Ollie Lho184a4042005-11-26 21:55:36 +0000371
Stefan Tauner9b32de92014-08-08 23:52:33 +0000372CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
Ollie Lho184a4042005-11-26 21:55:36 +0000373
Stefan Taunerec7a35f2013-08-29 00:38:14 +0000374# Set the flashrom version string from the highest revision number of the checked out flashrom files.
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +0000375# Note to packagers: Any tree exported with "make export" or "make tarball"
376# will not require subversion. The downloadable snapshots are already exported.
Stefan Taunerd5ff8452015-01-10 09:32:07 +0000377SVNVERSION := $(shell ./util/getrevision.sh -u 2>/dev/null )
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +0000378
Stefan Tauner241e9d52013-08-13 22:13:01 +0000379RELEASE := 0.9.7
Stefan Taunerec7a35f2013-08-29 00:38:14 +0000380VERSION := $(RELEASE)-$(SVNVERSION)
Carl-Daniel Hailfinger48e5e092009-08-31 16:25:08 +0000381RELEASENAME ?= $(VERSION)
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +0000382
383SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
Bernhard Walle201bde32008-01-21 15:24:22 +0000384
Stefan Taunerd5ff8452015-01-10 09:32:07 +0000385# Inform user if there is no meaningful version string. If there is version information from a VCS print
386# something anyway because $(info...) will print a line break in any case which would look suspicious.
387$(info $(shell ./util/getrevision.sh -c 2>/dev/null || echo "Files don't seem to be under version control." ; \
388 echo "Replacing all version templates with $(VERSION)." ))
389
Stefan Tauner037cd842013-08-25 00:10:56 +0000390###############################################################################
391# Default settings of CONFIG_* variables.
392
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000393# Always enable internal/onboard support for now.
394CONFIG_INTERNAL ?= yes
395
Stefan Tauner52b6e9d2013-04-01 00:46:05 +0000396# Always enable serprog for now.
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000397CONFIG_SERPROG ?= yes
398
Carl-Daniel Hailfingere7fdd6e2010-07-21 10:26:01 +0000399# RayeR SPIPGM hardware support
400CONFIG_RAYER_SPI ?= yes
401
Virgil-Adrian Teacada7c5452012-04-30 23:11:06 +0000402# PonyProg2000 SPI hardware support
403CONFIG_PONY_SPI ?= yes
404
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000405# Always enable 3Com NICs for now.
406CONFIG_NIC3COM ?= yes
407
Carl-Daniel Hailfingerbf3af292010-07-29 14:41:46 +0000408# Enable NVIDIA graphics cards. Note: write and erase do not work properly.
409CONFIG_GFXNVIDIA ?= yes
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000410
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000411# Always enable SiI SATA controllers for now.
412CONFIG_SATASII ?= yes
413
Uwe Hermannddd5c9e2010-02-21 21:17:00 +0000414# Highpoint (HPT) ATA/RAID controller support.
415# IMPORTANT: This code is not yet working!
416CONFIG_ATAHPT ?= no
417
Jonathan Kollasch7f0f3fa2014-06-01 10:26:23 +0000418# VIA VT6421A LPC memory support
419CONFIG_ATAVIA ?= yes
420
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000421# Always enable FT2232 SPI dongles for now.
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000422CONFIG_FT2232_SPI ?= yes
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000423
James Lairdc60de0e2013-03-27 13:00:23 +0000424# Always enable Altera USB-Blaster dongles for now.
425CONFIG_USBBLASTER_SPI ?= yes
426
Alexandre Boeglin80e64712014-12-20 20:25:19 +0000427# MSTAR DDC support needs more tests/reviews/cleanups.
428CONFIG_MSTARDDC_SPI ?= no
429
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000430# Always enable dummy tracing for now.
431CONFIG_DUMMY ?= yes
432
433# Always enable Dr. Kaiser for now.
434CONFIG_DRKAISER ?= yes
Carl-Daniel Hailfinger6be74112009-08-12 16:17:41 +0000435
Joerg Fischer5665ef32010-05-21 21:54:07 +0000436# Always enable Realtek NICs for now.
437CONFIG_NICREALTEK ?= yes
438
Andrew Morganc29c2e72010-06-07 22:37:54 +0000439# Disable National Semiconductor NICs until support is complete and tested.
440CONFIG_NICNATSEMI ?= no
441
Carl-Daniel Hailfingerb713d2e2011-05-08 00:24:18 +0000442# Always enable Intel NICs for now.
443CONFIG_NICINTEL ?= yes
444
Idwer Vollering004f4b72010-09-03 18:21:21 +0000445# Always enable SPI on Intel NICs for now.
446CONFIG_NICINTEL_SPI ?= yes
447
Ricardo Ribalda Delgado2a41f0a2014-07-28 20:35:21 +0000448# Always enable EEPROM on Intel NICs for now.
449CONFIG_NICINTEL_EEPROM ?= yes
450
Mark Marshall90021f22010-12-03 14:48:11 +0000451# Always enable SPI on OGP cards for now.
452CONFIG_OGP_SPI ?= yes
453
Carl-Daniel Hailfinger5cca01f2009-11-24 00:20:03 +0000454# Always enable Bus Pirate SPI for now.
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000455CONFIG_BUSPIRATE_SPI ?= yes
Carl-Daniel Hailfinger5cca01f2009-11-24 00:20:03 +0000456
Carl-Daniel Hailfingerd38fac82010-01-19 11:15:48 +0000457# Disable Dediprog SF100 until support is complete and tested.
458CONFIG_DEDIPROG ?= no
459
Carl-Daniel Hailfinger9a1105c2011-02-04 21:37:59 +0000460# Always enable Marvell SATA controllers for now.
461CONFIG_SATAMV ?= yes
462
Carl-Daniel Hailfinger8541d232012-02-16 21:00:27 +0000463# Enable Linux spidev interface by default. We disable it on non-Linux targets.
464CONFIG_LINUX_SPI ?= yes
465
Kyösti Mälkki72d42f82014-06-01 23:48:31 +0000466# Always enable ITE IT8212F PATA controllers for now.
467CONFIG_IT8212 ?= yes
468
Carl-Daniel Hailfinger6161ff12009-11-16 21:22:24 +0000469# Disable wiki printing by default. It is only useful if you have wiki access.
Uwe Hermann2db77a02010-06-04 17:07:39 +0000470CONFIG_PRINT_WIKI ?= no
Carl-Daniel Hailfinger9c8476b2009-09-16 12:19:03 +0000471
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000472# Bitbanging SPI infrastructure, default off unless needed.
473ifeq ($(CONFIG_RAYER_SPI), yes)
474override CONFIG_BITBANG_SPI = yes
475else
Virgil-Adrian Teacada7c5452012-04-30 23:11:06 +0000476ifeq ($(CONFIG_PONY_SPI), yes)
477override CONFIG_BITBANG_SPI = yes
478else
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000479ifeq ($(CONFIG_INTERNAL), yes)
480override CONFIG_BITBANG_SPI = yes
481else
482ifeq ($(CONFIG_NICINTEL_SPI), yes)
483override CONFIG_BITBANG_SPI = yes
484else
Mark Marshall90021f22010-12-03 14:48:11 +0000485ifeq ($(CONFIG_OGP_SPI), yes)
486override CONFIG_BITBANG_SPI = yes
487else
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000488CONFIG_BITBANG_SPI ?= no
489endif
490endif
491endif
Mark Marshall90021f22010-12-03 14:48:11 +0000492endif
Virgil-Adrian Teacada7c5452012-04-30 23:11:06 +0000493endif
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000494
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000495###############################################################################
Sean Nelson4c6d3a42013-09-11 23:35:03 +0000496# Handle CONFIG_* variables that depend on others set (and verified) above.
497
498# The external DMI decoder (dmidecode) does not work in libpayload. Bail out if the internal one got disabled.
499ifeq ($(TARGET_OS), libpayload)
500ifeq ($(CONFIG_INTERNAL), yes)
501ifeq ($(CONFIG_INTERNAL_DMI), no)
502UNSUPPORTED_FEATURES += CONFIG_INTERNAL_DMI=no
503else
504override CONFIG_INTERNAL_DMI = yes
505endif
506endif
507endif
508
509# Use internal DMI/SMBIOS decoder by default instead of relying on dmidecode.
510CONFIG_INTERNAL_DMI ?= yes
511
512###############################################################################
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000513# Programmer drivers and programmer support infrastructure.
Stefan Tauner037cd842013-08-25 00:10:56 +0000514# Depending on the CONFIG_* variables set and verified above we set compiler flags and parameters below.
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000515
Stefan Taunerfd0d4132012-09-25 21:24:55 +0000516FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER=$(CONFIG_DEFAULT_PROGRAMMER)'
Stefan Tauner265fcac2014-06-02 00:12:23 +0000517FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"'
Stefan Taunerfd0d4132012-09-25 21:24:55 +0000518
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000519ifeq ($(CONFIG_INTERNAL), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000520FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1'
Sean Nelson4c6d3a42013-09-11 23:35:03 +0000521PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o internal.o
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000522ifeq ($(ARCH), x86)
Rudolf Marek70e14592013-07-25 22:58:56 +0000523PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o amd_imc.o wbsio_spi.o mcp6x_spi.o
Sean Nelson4c6d3a42013-09-11 23:35:03 +0000524PROGRAMMER_OBJS += ichspi.o ich_descriptors.o dmi.o
525ifeq ($(CONFIG_INTERNAL_DMI), yes)
526FEATURE_CFLAGS += -D'CONFIG_INTERNAL_DMI=1'
527endif
Carl-Daniel Hailfinger91199a12011-07-07 06:59:18 +0000528else
529endif
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000530NEED_PCI := yes
531endif
532
Carl-Daniel Hailfinger6be74112009-08-12 16:17:41 +0000533ifeq ($(CONFIG_SERPROG), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000534FEATURE_CFLAGS += -D'CONFIG_SERPROG=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000535PROGRAMMER_OBJS += serprog.o
Carl-Daniel Hailfinger5bdf2982010-06-14 12:42:05 +0000536NEED_SERIAL := yes
537NEED_NET := yes
Carl-Daniel Hailfinger6be74112009-08-12 16:17:41 +0000538endif
539
Carl-Daniel Hailfingere7fdd6e2010-07-21 10:26:01 +0000540ifeq ($(CONFIG_RAYER_SPI), yes)
541FEATURE_CFLAGS += -D'CONFIG_RAYER_SPI=1'
542PROGRAMMER_OBJS += rayer_spi.o
543# Actually, NEED_PCI is wrong. NEED_IOPORT_ACCESS would be more correct.
544NEED_PCI := yes
545endif
546
Virgil-Adrian Teacada7c5452012-04-30 23:11:06 +0000547ifeq ($(CONFIG_PONY_SPI), yes)
548FEATURE_CFLAGS += -D'CONFIG_PONY_SPI=1'
549PROGRAMMER_OBJS += pony_spi.o
550NEED_SERIAL := yes
551endif
552
Carl-Daniel Hailfinger547872b2009-09-28 13:15:16 +0000553ifeq ($(CONFIG_BITBANG_SPI), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000554FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000555PROGRAMMER_OBJS += bitbang_spi.o
Carl-Daniel Hailfinger547872b2009-09-28 13:15:16 +0000556endif
557
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000558ifeq ($(CONFIG_NIC3COM), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000559FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000560PROGRAMMER_OBJS += nic3com.o
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000561NEED_PCI := yes
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000562endif
Carl-Daniel Hailfinger6be74112009-08-12 16:17:41 +0000563
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000564ifeq ($(CONFIG_GFXNVIDIA), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000565FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000566PROGRAMMER_OBJS += gfxnvidia.o
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000567NEED_PCI := yes
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000568endif
569
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000570ifeq ($(CONFIG_SATASII), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000571FEATURE_CFLAGS += -D'CONFIG_SATASII=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000572PROGRAMMER_OBJS += satasii.o
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000573NEED_PCI := yes
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000574endif
575
Uwe Hermannddd5c9e2010-02-21 21:17:00 +0000576ifeq ($(CONFIG_ATAHPT), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000577FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1'
Uwe Hermannddd5c9e2010-02-21 21:17:00 +0000578PROGRAMMER_OBJS += atahpt.o
579NEED_PCI := yes
580endif
581
Jonathan Kollasch7f0f3fa2014-06-01 10:26:23 +0000582ifeq ($(CONFIG_ATAVIA), yes)
583FEATURE_CFLAGS += -D'CONFIG_ATAVIA=1'
584PROGRAMMER_OBJS += atavia.o
585NEED_PCI := yes
586endif
587
Kyösti Mälkki72d42f82014-06-01 23:48:31 +0000588ifeq ($(CONFIG_IT8212), yes)
589FEATURE_CFLAGS += -D'CONFIG_IT8212=1'
590PROGRAMMER_OBJS += it8212.o
591NEED_PCI := yes
592endif
593
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000594ifeq ($(CONFIG_FT2232_SPI), yes)
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000595# This is a totally ugly hack.
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000596FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'")
James Lairdc60de0e2013-03-27 13:00:23 +0000597NEED_FTDI := yes
598PROGRAMMER_OBJS += ft2232_spi.o
599endif
600
601ifeq ($(CONFIG_USBBLASTER_SPI), yes)
602# This is a totally ugly hack.
603FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_USBBLASTER_SPI=1'")
604NEED_FTDI := yes
605PROGRAMMER_OBJS += usbblaster_spi.o
606endif
607
608ifeq ($(NEED_FTDI), yes)
609FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb")
Ilya A. Volynets-Evenbakh2c714ab2012-09-26 00:47:09 +0000610FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FT232H := yes" .features && printf "%s" "-D'HAVE_FT232H=1'")
Jörg Mayer8776db22009-11-16 14:05:13 +0000611FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)")
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000612# We can't set NEED_USB here because that would transform libftdi auto-enabling
613# into a hard requirement for libusb, defeating the purpose of auto-enabling.
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000614endif
615
616ifeq ($(CONFIG_DUMMY), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000617FEATURE_CFLAGS += -D'CONFIG_DUMMY=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000618PROGRAMMER_OBJS += dummyflasher.o
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000619endif
620
621ifeq ($(CONFIG_DRKAISER), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000622FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000623PROGRAMMER_OBJS += drkaiser.o
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000624NEED_PCI := yes
Carl-Daniel Hailfinger4740c6f2009-09-16 10:09:21 +0000625endif
Carl-Daniel Hailfinger6be74112009-08-12 16:17:41 +0000626
Joerg Fischer5665ef32010-05-21 21:54:07 +0000627ifeq ($(CONFIG_NICREALTEK), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000628FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1'
Joerg Fischer5665ef32010-05-21 21:54:07 +0000629PROGRAMMER_OBJS += nicrealtek.o
630NEED_PCI := yes
631endif
632
Andrew Morganc29c2e72010-06-07 22:37:54 +0000633ifeq ($(CONFIG_NICNATSEMI), yes)
634FEATURE_CFLAGS += -D'CONFIG_NICNATSEMI=1'
635PROGRAMMER_OBJS += nicnatsemi.o
636NEED_PCI := yes
637endif
638
Carl-Daniel Hailfingerb713d2e2011-05-08 00:24:18 +0000639ifeq ($(CONFIG_NICINTEL), yes)
640FEATURE_CFLAGS += -D'CONFIG_NICINTEL=1'
641PROGRAMMER_OBJS += nicintel.o
642NEED_PCI := yes
643endif
644
Idwer Vollering004f4b72010-09-03 18:21:21 +0000645ifeq ($(CONFIG_NICINTEL_SPI), yes)
646FEATURE_CFLAGS += -D'CONFIG_NICINTEL_SPI=1'
647PROGRAMMER_OBJS += nicintel_spi.o
648NEED_PCI := yes
649endif
650
Ricardo Ribalda Delgado2a41f0a2014-07-28 20:35:21 +0000651ifeq ($(CONFIG_NICINTEL_EEPROM), yes)
652FEATURE_CFLAGS += -D'CONFIG_NICINTEL_EEPROM=1'
653PROGRAMMER_OBJS += nicintel_eeprom.o
654NEED_PCI := yes
655endif
656
Mark Marshall90021f22010-12-03 14:48:11 +0000657ifeq ($(CONFIG_OGP_SPI), yes)
658FEATURE_CFLAGS += -D'CONFIG_OGP_SPI=1'
659PROGRAMMER_OBJS += ogp_spi.o
660NEED_PCI := yes
661endif
662
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000663ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
664FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000665PROGRAMMER_OBJS += buspirate_spi.o
Carl-Daniel Hailfinger5bdf2982010-06-14 12:42:05 +0000666NEED_SERIAL := yes
Carl-Daniel Hailfinger5cca01f2009-11-24 00:20:03 +0000667endif
668
Carl-Daniel Hailfingerd38fac82010-01-19 11:15:48 +0000669ifeq ($(CONFIG_DEDIPROG), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000670FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
Carl-Daniel Hailfingerd38fac82010-01-19 11:15:48 +0000671PROGRAMMER_OBJS += dediprog.o
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000672NEED_USB := yes
Carl-Daniel Hailfingerd38fac82010-01-19 11:15:48 +0000673endif
674
Carl-Daniel Hailfinger9a1105c2011-02-04 21:37:59 +0000675ifeq ($(CONFIG_SATAMV), yes)
676FEATURE_CFLAGS += -D'CONFIG_SATAMV=1'
677PROGRAMMER_OBJS += satamv.o
678NEED_PCI := yes
679endif
680
Carl-Daniel Hailfinger8541d232012-02-16 21:00:27 +0000681ifeq ($(CONFIG_LINUX_SPI), yes)
Stefan Tauner8868db32012-03-13 00:18:19 +0000682# This is a totally ugly hack.
683FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "LINUX_SPI_SUPPORT := yes" .features && printf "%s" "-D'CONFIG_LINUX_SPI=1'")
Carl-Daniel Hailfinger8541d232012-02-16 21:00:27 +0000684PROGRAMMER_OBJS += linux_spi.o
685endif
686
Alexandre Boeglin80e64712014-12-20 20:25:19 +0000687ifeq ($(CONFIG_MSTARDDC_SPI), yes)
688# This is a totally ugly hack.
689FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "LINUX_I2C_SUPPORT := yes" .features && printf "%s" "-D'CONFIG_MSTARDDC_SPI=1'")
690NEED_LINUX_I2C := yes
691PROGRAMMER_OBJS += mstarddc_spi.o
692endif
693
Carl-Daniel Hailfinger5bdf2982010-06-14 12:42:05 +0000694ifeq ($(NEED_SERIAL), yes)
Sean Nelson5d134642009-12-24 16:54:21 +0000695LIB_OBJS += serial.o
Carl-Daniel Hailfinger5bdf2982010-06-14 12:42:05 +0000696endif
697
698ifeq ($(NEED_NET), yes)
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000699ifeq ($(TARGET_OS), SunOS)
Carl-Daniel Hailfinger5bdf2982010-06-14 12:42:05 +0000700LIBS += -lsocket
Carl-Daniel Hailfinger5cca01f2009-11-24 00:20:03 +0000701endif
Carl-Daniel Hailfingere51ea102009-11-23 19:20:11 +0000702endif
703
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000704ifeq ($(NEED_PCI), yes)
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000705CHECK_LIBPCI = yes
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000706FEATURE_CFLAGS += -D'NEED_PCI=1'
Carl-Daniel Hailfingerfb0828f2010-02-12 19:35:25 +0000707PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000708ifeq ($(TARGET_OS), NetBSD)
Carl-Daniel Hailfinger460b2822010-06-04 23:24:57 +0000709# The libpci we want is called libpciutils on NetBSD and needs NetBSD libpci.
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000710PCILIBS += -lpciutils -lpci
Carl-Daniel Hailfinger460b2822010-06-04 23:24:57 +0000711# For (i386|x86_64)_iopl(2).
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000712PCILIBS += -l$(shell uname -p)
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000713else
Stefan Taunerbe62d3f2015-01-10 09:32:44 +0000714
Stefan Tauner449abe22013-09-11 23:34:57 +0000715PCILIBS += -lpci
Stefan Taunerbe62d3f2015-01-10 09:32:44 +0000716
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000717ifeq ($(TARGET_OS), OpenBSD)
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +0000718# For (i386|amd64)_iopl(2).
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000719PCILIBS += -l$(shell uname -m)
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000720else
721ifeq ($(TARGET_OS), Darwin)
722# DirectHW framework can be found in the DirectHW library.
Stefan Taunere34e3e82013-01-01 00:06:51 +0000723PCILIBS += -framework IOKit -framework DirectHW
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +0000724endif
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000725endif
Jonathan A. Kollasch3646c8f2010-01-08 21:18:08 +0000726endif
Carl-Daniel Hailfinger66ef4e52009-12-13 22:28:00 +0000727endif
728
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000729ifeq ($(NEED_USB), yes)
730CHECK_LIBUSB0 = yes
731FEATURE_CFLAGS += -D'NEED_USB=1'
732USBLIBS := $(shell pkg-config --libs libusb 2>/dev/null || printf "%s" "-lusb")
733endif
734
Carl-Daniel Hailfinger9c8476b2009-09-16 12:19:03 +0000735ifeq ($(CONFIG_PRINT_WIKI), yes)
Carl-Daniel Hailfinger71127722010-05-31 15:27:27 +0000736FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1'
Sean Nelson5d134642009-12-24 16:54:21 +0000737CLI_OBJS += print_wiki.o
Carl-Daniel Hailfinger9c8476b2009-09-16 12:19:03 +0000738endif
739
Carl-Daniel Hailfinger132e2ec2010-03-27 16:36:40 +0000740FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "UTSNAME := yes" .features && printf "%s" "-D'HAVE_UTSNAME=1'")
741
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000742# We could use PULLED_IN_LIBS, but that would be ugly.
743FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%s" "-lz")
744
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000745LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
Stefan Taunerd94d25d2012-07-28 03:17:15 +0000746OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
Sean Nelson5d134642009-12-24 16:54:21 +0000747
Joerg Mayera93d9dc2013-08-29 00:38:19 +0000748all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000749ifeq ($(ARCH), x86)
750 @+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX)
751endif
752
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000753$(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
Carl-Daniel Hailfinger11990da2013-07-13 23:21:05 +0000754 $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LIBS) $(PCILIBS) $(FEATURE_LIBS) $(USBLIBS)
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +0000755
Patrick Georgi97bc95c2011-03-08 07:17:44 +0000756libflashrom.a: $(LIBFLASHROM_OBJS)
757 $(AR) rcs $@ $^
758 $(RANLIB) $@
759
Carl-Daniel Hailfinger8ef7dce2009-07-10 20:19:48 +0000760# TAROPTIONS reduces information leakage from the packager's system.
761# If other tar programs support command line arguments for setting uid/gid of
762# stored files, they can be handled here as well.
763TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root")
Carl-Daniel Hailfingerb18ecbc2009-06-19 14:20:34 +0000764
Paul Fox05dfbe62009-06-16 21:08:06 +0000765%.o: %.c .features
Carl-Daniel Hailfingera8da2242012-08-15 23:06:32 +0000766 $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
Clark Rawlins02016f72008-02-14 23:22:20 +0000767
Carl-Daniel Hailfingera0020df2010-05-30 22:35:14 +0000768# Make sure to add all names of generated binaries here.
769# This includes all frontends and libflashrom.
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000770# We don't use EXEC_SUFFIX here because we want to clean everything.
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +0000771clean:
Joerg Mayera93d9dc2013-08-29 00:38:19 +0000772 rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000773 @+$(MAKE) -C util/ich_descriptors_tool/ clean
Ronald G. Minnicheaab50b2003-09-12 22:41:53 +0000774
Ollie Lho184a4042005-11-26 21:55:36 +0000775distclean: clean
Stefan Reinauere2f01582010-06-07 11:08:07 +0000776 rm -f .features .libdeps
Christian Ruppertdb9d9f42009-05-14 14:17:07 +0000777
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000778strip: $(PROGRAM)$(EXEC_SUFFIX)
779 $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)
Ronald G. Minnicheaab50b2003-09-12 22:41:53 +0000780
Stefan Tauner56787082011-08-18 02:27:19 +0000781# to define test programs we use verbatim variables, which get exported
782# to environment variables and are referenced with $$<varname> later
783
784define COMPILER_TEST
785int main(int argc, char **argv)
786{
787 (void) argc;
788 (void) argv;
789 return 0;
790}
791endef
792export COMPILER_TEST
793
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000794compiler: featuresavailable
Paul Fox05dfbe62009-06-16 21:08:06 +0000795 @printf "Checking for a C compiler... "
Stefan Tauner56787082011-08-18 02:27:19 +0000796 @echo "$$COMPILER_TEST" > .test.c
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000797 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test.c -o .test$(EXEC_SUFFIX) >/dev/null && \
Carl-Daniel Hailfinger4cb7a962009-06-16 09:31:51 +0000798 echo "found." || ( echo "not found."; \
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000799 rm -f .test.c .test$(EXEC_SUFFIX); exit 1)
800 @rm -f .test.c .test$(EXEC_SUFFIX)
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000801 @printf "Target arch is "
Carl-Daniel Hailfinger91199a12011-07-07 06:59:18 +0000802 @# FreeBSD wc will output extraneous whitespace.
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000803 @echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
Carl-Daniel Hailfinger91199a12011-07-07 06:59:18 +0000804 ( echo "unknown. Aborting."; exit 1)
805 @printf "%s\n" '$(ARCH)'
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +0000806 @printf "Target OS is "
807 @# FreeBSD wc will output extraneous whitespace.
808 @echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
809 ( echo "unknown. Aborting."; exit 1)
810 @printf "%s\n" '$(TARGET_OS)'
Stefan Taunerd6c17f62013-09-12 14:04:31 +0000811ifeq ($(TARGET_OS), libpayload)
812 @$(CC) --version 2>&1 | grep -q coreboot || \
813 ( echo "Warning: It seems you are not using coreboot's reference compiler."; \
814 echo "This might work but usually does not, please beware." )
815endif
Carl-Daniel Hailfinger4cb7a962009-06-16 09:31:51 +0000816
Stefan Tauner56787082011-08-18 02:27:19 +0000817define LIBPCI_TEST
818/* Avoid a failing test due to libpci header symbol shadowing breakage */
819#define index shadow_workaround_index
Stefan Taunerc65b8552013-09-12 15:48:39 +0000820#if !defined __NetBSD__ && !defined __DragonFly__
Stefan Tauner56787082011-08-18 02:27:19 +0000821#include <pci/pci.h>
Stefan Taunerc65b8552013-09-12 15:48:39 +0000822#else
823#include <pciutils/pci.h>
824#endif
Stefan Tauner56787082011-08-18 02:27:19 +0000825struct pci_access *pacc;
826int main(int argc, char **argv)
827{
828 (void) argc;
829 (void) argv;
830 pacc = pci_alloc();
831 return 0;
832}
833endef
834export LIBPCI_TEST
835
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000836define LIBUSB0_TEST
837#include <usb.h>
838int main(int argc, char **argv)
839{
840 (void) argc;
841 (void) argv;
842 usb_init();
843 return 0;
844}
845endef
846export LIBUSB0_TEST
847
848hwlibs: compiler
849 @printf "" > .libdeps
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000850ifeq ($(CHECK_LIBPCI), yes)
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000851 @printf "Checking for libpci headers... "
Stefan Tauner56787082011-08-18 02:27:19 +0000852 @echo "$$LIBPCI_TEST" > .test.c
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000853 @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000854 echo "found." || ( echo "not found."; echo; \
855 echo "Please install libpci headers (package pciutils-devel)."; \
856 echo "See README for more information."; echo; \
857 rm -f .test.c .test.o; exit 1)
Carl-Daniel Hailfinger9979eac2010-03-22 12:29:45 +0000858 @printf "Checking if libpci is present and sufficient... "
Carl-Daniel Hailfinger26148ae2012-11-29 22:22:04 +0000859 @$(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(PCILIBS) >/dev/null && \
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000860 echo "yes." || ( echo "no."; \
Carl-Daniel Hailfinger9979eac2010-03-22 12:29:45 +0000861 printf "Checking if libz+libpci are present and sufficient..."; \
Carl-Daniel Hailfinger26148ae2012-11-29 22:22:04 +0000862 $(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(PCILIBS) -lz >/dev/null && \
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000863 ( echo "yes."; echo "NEEDLIBZ := yes" > .libdeps ) || ( echo "no."; echo; \
Carl-Daniel Hailfinger9979eac2010-03-22 12:29:45 +0000864 echo "Please install libpci (package pciutils) and/or libz."; \
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000865 echo "See README for more information."; echo; \
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000866 rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) )
867 @rm -f .test.c .test.o .test$(EXEC_SUFFIX)
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000868endif
869ifeq ($(CHECK_LIBUSB0), yes)
870 @printf "Checking for libusb-0.1/libusb-compat headers... "
871 @echo "$$LIBUSB0_TEST" > .test.c
872 @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \
873 echo "found." || ( echo "not found."; echo; \
874 echo "Please install libusb-0.1 headers or libusb-compat headers."; \
875 echo "See README for more information."; echo; \
876 rm -f .test.c .test.o; exit 1)
877 @printf "Checking if libusb-0.1 is usable... "
Carl-Daniel Hailfinger26148ae2012-11-29 22:22:04 +0000878 @$(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(USBLIBS) >/dev/null && \
Carl-Daniel Hailfingere7a39bf2012-11-20 21:06:16 +0000879 echo "yes." || ( echo "no."; \
880 echo "Please install libusb-0.1 or libusb-compat."; \
881 echo "See README for more information."; echo; \
882 rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1)
883 @rm -f .test.c .test.o .test$(EXEC_SUFFIX)
Carl-Daniel Hailfinger8a59ff02009-12-24 03:33:11 +0000884endif
Stefan Reinauer53e96252005-12-01 16:19:24 +0000885
Carl-Daniel Hailfingerb18ecbc2009-06-19 14:20:34 +0000886.features: features
887
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000888# If a user does not explicitly request a non-working feature, we should
889# silently disable it. However, if a non-working (does not compile) feature
890# is explicitly requested, we should bail out with a descriptive error message.
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000891# We also have to check that at least one programmer driver is enabled.
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000892featuresavailable:
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000893ifeq ($(PROGRAMMER_OBJS),)
894 @echo "You have to enable at least one programmer driver!"
895 @false
896endif
897ifneq ($(UNSUPPORTED_FEATURES), )
Carl-Daniel Hailfinger5d3fcb92010-06-14 18:40:59 +0000898 @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)"
899 @false
900endif
901
Stefan Tauner56787082011-08-18 02:27:19 +0000902define FTDI_TEST
903#include <ftdi.h>
904struct ftdi_context *ftdic = NULL;
905int main(int argc, char **argv)
906{
907 (void) argc;
908 (void) argv;
909 return ftdi_init(ftdic);
910}
911endef
912export FTDI_TEST
913
Ilya A. Volynets-Evenbakh2c714ab2012-09-26 00:47:09 +0000914define FTDI_232H_TEST
915#include <ftdi.h>
916enum ftdi_chip_type type = TYPE_232H;
917endef
918export FTDI_232H_TEST
919
Stefan Tauner56787082011-08-18 02:27:19 +0000920define UTSNAME_TEST
921#include <sys/utsname.h>
922struct utsname osinfo;
923int main(int argc, char **argv)
924{
925 (void) argc;
926 (void) argv;
927 uname (&osinfo);
928 return 0;
929}
930endef
931export UTSNAME_TEST
932
Stefan Tauner8868db32012-03-13 00:18:19 +0000933define LINUX_SPI_TEST
934#include <linux/types.h>
935#include <linux/spi/spidev.h>
936
937int main(int argc, char **argv)
938{
939 (void) argc;
940 (void) argv;
941 return 0;
942}
943endef
944export LINUX_SPI_TEST
945
Alexandre Boeglin80e64712014-12-20 20:25:19 +0000946define LINUX_I2C_TEST
947#include <linux/i2c-dev.h>
948#include <linux/i2c.h>
949
950int main(int argc, char **argv)
951{
952 (void) argc;
953 (void) argv;
954 return 0;
955}
956endef
957export LINUX_I2C_TEST
958
Carl-Daniel Hailfingerb18ecbc2009-06-19 14:20:34 +0000959features: compiler
960 @echo "FEATURES := yes" > .features.tmp
James Lairdc60de0e2013-03-27 13:00:23 +0000961ifeq ($(NEED_FTDI), yes)
Paul Fox05dfbe62009-06-16 21:08:06 +0000962 @printf "Checking for FTDI support... "
Stefan Tauner56787082011-08-18 02:27:19 +0000963 @echo "$$FTDI_TEST" > .featuretest.c
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +0000964 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \
Carl-Daniel Hailfingerb18ecbc2009-06-19 14:20:34 +0000965 ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) || \
966 ( echo "not found."; echo "FTDISUPPORT := no" >> .features.tmp )
Ilya A. Volynets-Evenbakh2c714ab2012-09-26 00:47:09 +0000967 @printf "Checking for FT232H support in libftdi... "
968 @echo "$$FTDI_232H_TEST" >> .featuretest.c
969 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \
970 ( echo "found."; echo "FT232H := yes" >> .features.tmp ) || \
971 ( echo "not found."; echo "FT232H := no" >> .features.tmp )
Carl-Daniel Hailfinger8a59ff02009-12-24 03:33:11 +0000972endif
Stefan Tauner8868db32012-03-13 00:18:19 +0000973ifeq ($(CONFIG_LINUX_SPI), yes)
974 @printf "Checking if Linux SPI headers are present... "
975 @echo "$$LINUX_SPI_TEST" > .featuretest.c
976 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \
977 ( echo "yes."; echo "LINUX_SPI_SUPPORT := yes" >> .features.tmp ) || \
978 ( echo "no."; echo "LINUX_SPI_SUPPORT := no" >> .features.tmp )
979endif
Alexandre Boeglin80e64712014-12-20 20:25:19 +0000980ifeq ($(NEED_LINUX_I2C), yes)
981 @printf "Checking if Linux I2C headers are present... "
982 @echo "$$LINUX_I2C_TEST" > .featuretest.c
983 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \
984 ( echo "yes."; echo "LINUX_I2C_SUPPORT := yes" >> .features.tmp ) || \
985 ( echo "no."; echo "LINUX_I2C_SUPPORT := no" >> .features.tmp )
986endif
Stefan Tauner56787082011-08-18 02:27:19 +0000987 @printf "Checking for utsname support... "
988 @echo "$$UTSNAME_TEST" > .featuretest.c
989 @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \
990 ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \
991 ( echo "not found."; echo "UTSNAME := no" >> .features.tmp )
992 @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features
993 @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)
Paul Fox05dfbe62009-06-16 21:08:06 +0000994
Joerg Mayera93d9dc2013-08-29 00:38:19 +0000995$(PROGRAM).8: $(PROGRAM).8.tmpl
Stefan Taunerd5ff8452015-01-10 09:32:07 +0000996 @sed -e '1 s#".*".*#"$(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl 2>/dev/null)" "$(VERSION)"#' <$< >$@
Joerg Mayera93d9dc2013-08-29 00:38:19 +0000997
998install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
Uwe Hermannc2a9c9c2009-05-14 14:51:14 +0000999 mkdir -p $(DESTDIR)$(PREFIX)/sbin
Uwe Hermann56b2cb02009-05-21 15:59:58 +00001000 mkdir -p $(DESTDIR)$(MANDIR)/man8
Carl-Daniel Hailfingerddbab712010-06-14 14:44:08 +00001001 $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin
Uwe Hermann56b2cb02009-05-21 15:59:58 +00001002 $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8
Uwe Hermannc113b572006-12-14 00:59:41 +00001003
Joerg Mayera93d9dc2013-08-29 00:38:19 +00001004export: $(PROGRAM).8
Carl-Daniel Hailfinger48e5e092009-08-31 16:25:08 +00001005 @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME)
1006 @svn export -r BASE . $(EXPORTDIR)/flashrom-$(RELEASENAME)
1007 @sed "s/^SVNVERSION.*/SVNVERSION := $(SVNVERSION)/" Makefile >$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile
Joerg Mayera93d9dc2013-08-29 00:38:19 +00001008 @cp $(PROGRAM).8 "$(EXPORTDIR)/flashrom-$(RELEASENAME)/$(PROGRAM).8"
Carl-Daniel Hailfinger48e5e092009-08-31 16:25:08 +00001009 @LC_ALL=C svn log >$(EXPORTDIR)/flashrom-$(RELEASENAME)/ChangeLog
1010 @echo Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +00001011
1012tarball: export
Carl-Daniel Hailfinger48e5e092009-08-31 16:25:08 +00001013 @tar cjf $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2 -C $(EXPORTDIR)/ $(TAROPTIONS) flashrom-$(RELEASENAME)/
1014 @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME)
1015 @echo Created $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +00001016
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +00001017djgpp-dos: clean
Carl-Daniel Hailfinger33a65a02011-12-20 00:51:44 +00001018 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
1019libpayload: clean
1020 make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +00001021
Joerg Mayera93d9dc2013-08-29 00:38:19 +00001022.PHONY: all install clean distclean compiler hwlibs features export tarball dos featuresavailable
Ollie Lho184a4042005-11-26 21:55:36 +00001023
Stefan Reinauere2f01582010-06-07 11:08:07 +00001024-include $(OBJS:.o=.d)