Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 1 | # |
Uwe Hermann | f78cff1 | 2009-06-12 14:05:25 +0000 | [diff] [blame] | 2 | # This file is part of the flashrom project. |
| 3 | # |
| 4 | # Copyright (C) 2005 coresystems GmbH <stepan@coresystems.de> |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 5 | # Copyright (C) 2009,2010,2012 Carl-Daniel Hailfinger |
Uwe Hermann | f78cff1 | 2009-06-12 14:05:25 +0000 | [diff] [blame] | 6 | # |
| 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 Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 19 | # |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 20 | |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 21 | PROGRAM = flashrom |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 22 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 23 | ############################################################################### |
| 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 Hailfinger | b7bce8a | 2012-08-14 21:36:11 +0000 | [diff] [blame] | 29 | # |
| 30 | # Note for anyone editing this Makefile: gnumake will happily ignore any |
| 31 | # changes in this Makefile to variables set on the command line. |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 32 | STRIP ?= strip |
Christian Ruppert | db9d9f4 | 2009-05-14 14:17:07 +0000 | [diff] [blame] | 33 | INSTALL = install |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 34 | DIFF = diff |
Christian Ruppert | db9d9f4 | 2009-05-14 14:17:07 +0000 | [diff] [blame] | 35 | PREFIX ?= /usr/local |
Uwe Hermann | 56b2cb0 | 2009-05-21 15:59:58 +0000 | [diff] [blame] | 36 | MANDIR ?= $(PREFIX)/share/man |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 37 | CFLAGS ?= -Os -Wall -Wshadow |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 38 | EXPORTDIR ?= . |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 39 | RANLIB ?= ranlib |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 40 | LIBS_BASE ?= .. |
| 41 | |
Stefan Tauner | fd0d413 | 2012-09-25 21:24:55 +0000 | [diff] [blame] | 42 | # The following parameter changes the default programmer that will be used if there is no -p/--programmer |
| 43 | # argument given when running flashrom. The predefined setting does not enable any default so that every |
| 44 | # user has to declare the programmer he wants to use on every run. The rationale for this to be not set |
| 45 | # (to e.g. the internal programmer) is that forgetting to specify this when working with another programmer |
| 46 | # easily puts the system attached to the default programmer at risk (e.g. you want to flash coreboot to another |
| 47 | # system attached to an external programmer while the default programmer is set to the internal programmer, and |
| 48 | # you forget to use the -p parameter. This would (try to) overwrite the existing firmware of the computer |
| 49 | # running flashrom). Please do not enable this without thinking about the possible consequences. Possible |
| 50 | # values are those specified in enum programmer in programmer.h (which depend on other CONFIG_* options |
| 51 | # evaluated below, namely those that enable/disable the various programmers). |
| 52 | # Compilation will fail for unspecified values. |
| 53 | CONFIG_DEFAULT_PROGRAMMER ?= PROGRAMMER_INVALID |
Stefan Tauner | 265fcac | 2014-06-02 00:12:23 +0000 | [diff] [blame] | 54 | # The following adds a default parameter for the default programmer set above (only). |
| 55 | CONFIG_DEFAULT_PROGRAMMER_ARGS ?= '' |
| 56 | # Example: compiling with |
| 57 | # make CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_SERPROG CONFIG_DEFAULT_PROGRAMMER_ARGS="dev=/dev/ttyUSB0:1500000" |
| 58 | # would make executing './flashrom' (almost) equivialent to './flashrom -p serprog:dev=/dev/ttyUSB0:1500000'. |
Christian Ruppert | db9d9f4 | 2009-05-14 14:17:07 +0000 | [diff] [blame] | 59 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 60 | # If your compiler spits out excessive warnings, run make WARNERROR=no |
| 61 | # You shouldn't have to change this flag. |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 62 | WARNERROR ?= yes |
| 63 | |
| 64 | ifeq ($(WARNERROR), yes) |
| 65 | CFLAGS += -Werror |
| 66 | endif |
| 67 | |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 68 | CPPFLAGS += -I$(LIBS_BASE)/include |
| 69 | LDFLAGS += -L$(LIBS_BASE)/lib |
| 70 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 71 | ############################################################################### |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 72 | # General OS-specific settings. |
| 73 | # 1. Prepare for later by gathering information about host and target OS |
| 74 | # 2. Set compiler flags and parameters according to OSes |
| 75 | # 3. Likewise verify user-supplied CONFIG_* variables. |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 76 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 77 | # HOST_OS is only used to work around local toolchain issues. |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 78 | HOST_OS ?= $(shell uname) |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 79 | ifeq ($(HOST_OS), MINGW32_NT-5.1) |
| 80 | # Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found". |
| 81 | CC = gcc |
| 82 | endif |
| 83 | ifneq ($(HOST_OS), SunOS) |
Adam Kaufman | 064b1f2 | 2007-02-06 19:47:50 +0000 | [diff] [blame] | 84 | STRIP_ARGS = -s |
| 85 | endif |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 86 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 87 | # Determine the destination OS. |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 88 | # IMPORTANT: The following line must be placed before TARGET_OS is ever used |
| 89 | # (of course), but should come after any lines setting CC because the line |
| 90 | # below uses CC itself. |
| 91 | override TARGET_OS := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) |
| 92 | |
| 93 | ifeq ($(TARGET_OS), Darwin) |
Stefan Reinauer | 2fea3f3 | 2010-01-21 20:26:30 +0000 | [diff] [blame] | 94 | CPPFLAGS += -I/opt/local/include -I/usr/local/include |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 95 | LDFLAGS += -L/opt/local/lib -L/usr/local/lib |
Stefan Reinauer | f79edb9 | 2009-01-26 01:23:31 +0000 | [diff] [blame] | 96 | endif |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 97 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 98 | ifeq ($(TARGET_OS), FreeBSD) |
Stefan Reinauer | 2fea3f3 | 2010-01-21 20:26:30 +0000 | [diff] [blame] | 99 | CPPFLAGS += -I/usr/local/include |
Andriy Gapon | 65c1b86 | 2008-05-22 13:22:45 +0000 | [diff] [blame] | 100 | LDFLAGS += -L/usr/local/lib |
| 101 | endif |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 102 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 103 | ifeq ($(TARGET_OS), OpenBSD) |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 104 | CPPFLAGS += -I/usr/local/include |
| 105 | LDFLAGS += -L/usr/local/lib |
| 106 | endif |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 107 | |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 108 | ifeq ($(TARGET_OS), NetBSD) |
| 109 | CPPFLAGS += -I/usr/pkg/include |
| 110 | LDFLAGS += -L/usr/pkg/lib |
| 111 | endif |
| 112 | |
| 113 | ifeq ($(TARGET_OS), DragonFlyBSD) |
| 114 | CPPFLAGS += -I/usr/pkg/include |
| 115 | LDFLAGS += -L/usr/pkg/lib |
| 116 | endif |
| 117 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 118 | ifeq ($(TARGET_OS), DOS) |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 119 | EXEC_SUFFIX := .exe |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 120 | # DJGPP has odd uint*_t definitions which cause lots of format string warnings. |
Carl-Daniel Hailfinger | b7bce8a | 2012-08-14 21:36:11 +0000 | [diff] [blame] | 121 | CFLAGS += -Wno-format |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 122 | LIBS += -lgetopt |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 123 | # Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support). |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 124 | ifeq ($(CONFIG_BUSPIRATE_SPI), yes) |
| 125 | UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes |
| 126 | else |
| 127 | override CONFIG_BUSPIRATE_SPI = no |
| 128 | endif |
| 129 | ifeq ($(CONFIG_SERPROG), yes) |
| 130 | UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes |
| 131 | else |
| 132 | override CONFIG_SERPROG = no |
| 133 | endif |
Stefan Tauner | d94d25d | 2012-07-28 03:17:15 +0000 | [diff] [blame] | 134 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 135 | UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes |
| 136 | else |
| 137 | override CONFIG_PONY_SPI = no |
| 138 | endif |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 139 | # Dediprog and FT2232 are not supported under DOS (missing USB support). |
| 140 | ifeq ($(CONFIG_DEDIPROG), yes) |
| 141 | UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes |
| 142 | else |
| 143 | override CONFIG_DEDIPROG = no |
| 144 | endif |
| 145 | ifeq ($(CONFIG_FT2232_SPI), yes) |
| 146 | UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes |
| 147 | else |
| 148 | override CONFIG_FT2232_SPI = no |
| 149 | endif |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 150 | ifeq ($(CONFIG_USBBLASTER_SPI), yes) |
| 151 | UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes |
| 152 | else |
| 153 | override CONFIG_USBBLASTER_SPI = no |
| 154 | endif |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 155 | endif |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 156 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 157 | # FIXME: Should we check for Cygwin/MSVC as well? |
| 158 | ifeq ($(TARGET_OS), MinGW) |
| 159 | EXEC_SUFFIX := .exe |
Uwe Hermann | d5e85d6 | 2011-07-03 19:44:12 +0000 | [diff] [blame] | 160 | # MinGW doesn't have the ffs() function, but we can use gcc's __builtin_ffs(). |
Carl-Daniel Hailfinger | a8da224 | 2012-08-15 23:06:32 +0000 | [diff] [blame] | 161 | FLASHROM_CFLAGS += -Dffs=__builtin_ffs |
Carl-Daniel Hailfinger | 11990da | 2013-07-13 23:21:05 +0000 | [diff] [blame] | 162 | # Some functions provided by Microsoft do not work as described in C99 specifications. This macro fixes that |
| 163 | # for MinGW. See http://sourceforge.net/apps/trac/mingw-w64/wiki/printf%20and%20scanf%20family */ |
| 164 | FLASHROM_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1 |
Uwe Hermann | d5e85d6 | 2011-07-03 19:44:12 +0000 | [diff] [blame] | 165 | # libusb-win32/libftdi stuff is usually installed in /usr/local. |
| 166 | CPPFLAGS += -I/usr/local/include |
| 167 | LDFLAGS += -L/usr/local/lib |
Uwe Hermann | d5e85d6 | 2011-07-03 19:44:12 +0000 | [diff] [blame] | 168 | # For now we disable all PCI-based programmers on Windows/MinGW (no libpci). |
| 169 | ifeq ($(CONFIG_INTERNAL), yes) |
| 170 | UNSUPPORTED_FEATURES += CONFIG_INTERNAL=yes |
| 171 | else |
| 172 | override CONFIG_INTERNAL = no |
| 173 | endif |
| 174 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 175 | UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes |
| 176 | else |
| 177 | override CONFIG_RAYER_SPI = no |
| 178 | endif |
| 179 | ifeq ($(CONFIG_NIC3COM), yes) |
| 180 | UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes |
| 181 | else |
| 182 | override CONFIG_NIC3COM = no |
| 183 | endif |
| 184 | ifeq ($(CONFIG_GFXNVIDIA), yes) |
| 185 | UNSUPPORTED_FEATURES += CONFIG_GFXNVIDIA=yes |
| 186 | else |
| 187 | override CONFIG_GFXNVIDIA = no |
| 188 | endif |
| 189 | ifeq ($(CONFIG_SATASII), yes) |
| 190 | UNSUPPORTED_FEATURES += CONFIG_SATASII=yes |
| 191 | else |
| 192 | override CONFIG_SATASII = no |
| 193 | endif |
| 194 | ifeq ($(CONFIG_ATAHPT), yes) |
| 195 | UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes |
| 196 | else |
| 197 | override CONFIG_ATAHPT = no |
| 198 | endif |
Jonathan Kollasch | 7f0f3fa | 2014-06-01 10:26:23 +0000 | [diff] [blame] | 199 | ifeq ($(CONFIG_ATAVIA), yes) |
| 200 | UNSUPPORTED_FEATURES += CONFIG_ATAVIA=yes |
| 201 | else |
| 202 | override CONFIG_ATAVIA = no |
| 203 | endif |
Kyösti Mälkki | 72d42f8 | 2014-06-01 23:48:31 +0000 | [diff] [blame] | 204 | ifeq ($(CONFIG_IT8212), yes) |
| 205 | UNSUPPORTED_FEATURES += CONFIG_IT8212=yes |
| 206 | else |
| 207 | override CONFIG_IT8212 = no |
| 208 | endif |
Uwe Hermann | d5e85d6 | 2011-07-03 19:44:12 +0000 | [diff] [blame] | 209 | ifeq ($(CONFIG_DRKAISER), yes) |
| 210 | UNSUPPORTED_FEATURES += CONFIG_DRKAISER=yes |
| 211 | else |
| 212 | override CONFIG_DRKAISER = no |
| 213 | endif |
| 214 | ifeq ($(CONFIG_NICREALTEK), yes) |
| 215 | UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes |
| 216 | else |
| 217 | override CONFIG_NICREALTEK = no |
| 218 | endif |
| 219 | ifeq ($(CONFIG_NICNATSEMI), yes) |
| 220 | UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes |
| 221 | else |
| 222 | override CONFIG_NICNATSEMI = no |
| 223 | endif |
| 224 | ifeq ($(CONFIG_NICINTEL), yes) |
| 225 | UNSUPPORTED_FEATURES += CONFIG_NICINTEL=yes |
| 226 | else |
| 227 | override CONFIG_NICINTEL = no |
| 228 | endif |
Ricardo Ribalda Delgado | 2a41f0a | 2014-07-28 20:35:21 +0000 | [diff] [blame] | 229 | ifeq ($(CONFIG_NICINTEL_EEPROM), yes) |
| 230 | UNSUPPORTED_FEATURES += CONFIG_NICINTEL_EEPROM=yes |
| 231 | else |
| 232 | override CONFIG_NICINTEL_EEPROM = no |
| 233 | endif |
Uwe Hermann | d5e85d6 | 2011-07-03 19:44:12 +0000 | [diff] [blame] | 234 | ifeq ($(CONFIG_NICINTEL_SPI), yes) |
| 235 | UNSUPPORTED_FEATURES += CONFIG_NICINTEL_SPI=yes |
| 236 | else |
| 237 | override CONFIG_NICINTEL_SPI = no |
| 238 | endif |
| 239 | ifeq ($(CONFIG_OGP_SPI), yes) |
| 240 | UNSUPPORTED_FEATURES += CONFIG_OGP_SPI=yes |
| 241 | else |
| 242 | override CONFIG_OGP_SPI = no |
| 243 | endif |
| 244 | ifeq ($(CONFIG_SATAMV), yes) |
| 245 | UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes |
| 246 | else |
| 247 | override CONFIG_SATAMV = no |
| 248 | endif |
| 249 | endif |
| 250 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 251 | ifeq ($(TARGET_OS), libpayload) |
Stefan Tauner | 8e19b04 | 2013-08-28 09:55:04 +0000 | [diff] [blame] | 252 | ifeq ($(MAKECMDGOALS),) |
| 253 | .DEFAULT_GOAL := libflashrom.a |
| 254 | $(info Setting default goal to libflashrom.a) |
| 255 | endif |
Carl-Daniel Hailfinger | a8da224 | 2012-08-15 23:06:32 +0000 | [diff] [blame] | 256 | FLASHROM_CFLAGS += -DSTANDALONE |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 257 | ifeq ($(CONFIG_DUMMY), yes) |
| 258 | UNSUPPORTED_FEATURES += CONFIG_DUMMY=yes |
| 259 | else |
| 260 | override CONFIG_DUMMY = no |
| 261 | endif |
Carl-Daniel Hailfinger | 11990da | 2013-07-13 23:21:05 +0000 | [diff] [blame] | 262 | # Bus Pirate, Serprog and PonyProg are not supported with libpayload (missing serial support). |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 263 | ifeq ($(CONFIG_BUSPIRATE_SPI), yes) |
| 264 | UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes |
| 265 | else |
| 266 | override CONFIG_BUSPIRATE_SPI = no |
| 267 | endif |
| 268 | ifeq ($(CONFIG_SERPROG), yes) |
| 269 | UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes |
| 270 | else |
| 271 | override CONFIG_SERPROG = no |
| 272 | endif |
Carl-Daniel Hailfinger | 11990da | 2013-07-13 23:21:05 +0000 | [diff] [blame] | 273 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 274 | UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes |
| 275 | else |
| 276 | override CONFIG_PONY_SPI = no |
| 277 | endif |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 278 | # Dediprog and FT2232 are not supported with libpayload (missing libusb support) |
| 279 | ifeq ($(CONFIG_DEDIPROG), yes) |
| 280 | UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes |
| 281 | else |
| 282 | override CONFIG_DEDIPROG = no |
| 283 | endif |
| 284 | ifeq ($(CONFIG_FT2232_SPI), yes) |
| 285 | UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes |
| 286 | else |
| 287 | override CONFIG_FT2232_SPI = no |
| 288 | endif |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 289 | ifeq ($(CONFIG_USBBLASTER_SPI), yes) |
| 290 | UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes |
| 291 | else |
| 292 | override CONFIG_USBBLASTER_SPI = no |
| 293 | endif |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 294 | endif |
| 295 | |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 296 | ifneq ($(TARGET_OS), Linux) |
| 297 | ifeq ($(CONFIG_LINUX_SPI), yes) |
| 298 | UNSUPPORTED_FEATURES += CONFIG_LINUX_SPI=yes |
| 299 | else |
| 300 | override CONFIG_LINUX_SPI = no |
| 301 | endif |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 302 | ifeq ($(CONFIG_MSTARDDC_SPI), yes) |
| 303 | UNSUPPORTED_FEATURES += CONFIG_MSTARDDC_SPI=yes |
| 304 | else |
| 305 | override CONFIG_MSTARDDC_SPI = no |
| 306 | endif |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 307 | endif |
| 308 | |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 309 | ############################################################################### |
| 310 | # General architecture-specific settings. |
| 311 | # Like above for the OS, below we verify user-supplied options depending on the target architecture. |
| 312 | |
Uwe Hermann | 44ffd58 | 2011-08-20 14:16:00 +0000 | [diff] [blame] | 313 | # Determine the destination processor architecture. |
| 314 | # IMPORTANT: The following line must be placed before ARCH is ever used |
| 315 | # (of course), but should come after any lines setting CC because the line |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 316 | # below uses CC itself. |
Stefan Tauner | b0eee9b | 2015-01-10 09:32:50 +0000 | [diff] [blame] | 317 | override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) |
Uwe Hermann | 44ffd58 | 2011-08-20 14:16:00 +0000 | [diff] [blame] | 318 | |
David Hendricks | b286da7 | 2012-02-13 00:35:35 +0000 | [diff] [blame] | 319 | # PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM. |
| 320 | # Right now this means the drivers below only work on x86. |
| 321 | ifneq ($(ARCH), x86) |
Uwe Hermann | 21b10c6 | 2011-07-29 12:13:01 +0000 | [diff] [blame] | 322 | ifeq ($(CONFIG_NIC3COM), yes) |
| 323 | UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes |
| 324 | else |
| 325 | override CONFIG_NIC3COM = no |
| 326 | endif |
| 327 | ifeq ($(CONFIG_NICREALTEK), yes) |
| 328 | UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes |
| 329 | else |
| 330 | override CONFIG_NICREALTEK = no |
| 331 | endif |
| 332 | ifeq ($(CONFIG_NICNATSEMI), yes) |
| 333 | UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes |
| 334 | else |
| 335 | override CONFIG_NICNATSEMI = no |
| 336 | endif |
| 337 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 338 | UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes |
| 339 | else |
| 340 | override CONFIG_RAYER_SPI = no |
| 341 | endif |
| 342 | ifeq ($(CONFIG_ATAHPT), yes) |
| 343 | UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes |
| 344 | else |
| 345 | override CONFIG_ATAHPT = no |
| 346 | endif |
| 347 | ifeq ($(CONFIG_SATAMV), yes) |
| 348 | UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes |
| 349 | else |
| 350 | override CONFIG_SATAMV = no |
| 351 | endif |
| 352 | endif |
| 353 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 354 | ############################################################################### |
| 355 | # Flash chip drivers and bus support infrastructure. |
| 356 | |
Stefan Tauner | 4404f73 | 2013-09-12 08:28:56 +0000 | [diff] [blame] | 357 | CHIP_OBJS = jedec.o stm50.o w39.o w29ee011.o \ |
Carl-Daniel Hailfinger | a8cf362 | 2014-08-08 08:33:01 +0000 | [diff] [blame] | 358 | sst28sf040.o 82802ab.o \ |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 359 | sst49lfxxxc.o sst_fwhub.o flashchips.o spi.o spi25.o spi25_statusreg.o \ |
Aidan Thornton | db4e87d | 2013-08-27 18:01:53 +0000 | [diff] [blame] | 360 | opaque.o sfdp.o en29lv640b.o at45db.o |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 361 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 362 | ############################################################################### |
| 363 | # Library code. |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 364 | |
Stefan Tauner | 6ad6e01 | 2014-06-12 00:04:32 +0000 | [diff] [blame] | 365 | LIB_OBJS = layout.o flashrom.o udelay.o programmer.o helpers.o |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 366 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 367 | ############################################################################### |
| 368 | # Frontend related stuff. |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 369 | |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 370 | CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 371 | |
Stefan Tauner | ec7a35f | 2013-08-29 00:38:14 +0000 | [diff] [blame] | 372 | # Set the flashrom version string from the highest revision number of the checked out flashrom files. |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 373 | # Note to packagers: Any tree exported with "make export" or "make tarball" |
| 374 | # will not require subversion. The downloadable snapshots are already exported. |
Stefan Tauner | d5ff845 | 2015-01-10 09:32:07 +0000 | [diff] [blame] | 375 | SVNVERSION := $(shell ./util/getrevision.sh -u 2>/dev/null ) |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 376 | |
Stefan Tauner | 241e9d5 | 2013-08-13 22:13:01 +0000 | [diff] [blame] | 377 | RELEASE := 0.9.7 |
Stefan Tauner | ec7a35f | 2013-08-29 00:38:14 +0000 | [diff] [blame] | 378 | VERSION := $(RELEASE)-$(SVNVERSION) |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 379 | RELEASENAME ?= $(VERSION) |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 380 | |
| 381 | SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"' |
Bernhard Walle | 201bde3 | 2008-01-21 15:24:22 +0000 | [diff] [blame] | 382 | |
Stefan Tauner | d5ff845 | 2015-01-10 09:32:07 +0000 | [diff] [blame] | 383 | # Inform user if there is no meaningful version string. If there is version information from a VCS print |
| 384 | # something anyway because $(info...) will print a line break in any case which would look suspicious. |
| 385 | $(info $(shell ./util/getrevision.sh -c 2>/dev/null || echo "Files don't seem to be under version control." ; \ |
| 386 | echo "Replacing all version templates with $(VERSION)." )) |
| 387 | |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 388 | ############################################################################### |
| 389 | # Default settings of CONFIG_* variables. |
| 390 | |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 391 | # Always enable internal/onboard support for now. |
| 392 | CONFIG_INTERNAL ?= yes |
| 393 | |
Stefan Tauner | 52b6e9d | 2013-04-01 00:46:05 +0000 | [diff] [blame] | 394 | # Always enable serprog for now. |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 395 | CONFIG_SERPROG ?= yes |
| 396 | |
Carl-Daniel Hailfinger | e7fdd6e | 2010-07-21 10:26:01 +0000 | [diff] [blame] | 397 | # RayeR SPIPGM hardware support |
| 398 | CONFIG_RAYER_SPI ?= yes |
| 399 | |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 400 | # PonyProg2000 SPI hardware support |
| 401 | CONFIG_PONY_SPI ?= yes |
| 402 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 403 | # Always enable 3Com NICs for now. |
| 404 | CONFIG_NIC3COM ?= yes |
| 405 | |
Carl-Daniel Hailfinger | bf3af29 | 2010-07-29 14:41:46 +0000 | [diff] [blame] | 406 | # Enable NVIDIA graphics cards. Note: write and erase do not work properly. |
| 407 | CONFIG_GFXNVIDIA ?= yes |
Uwe Hermann | 2bc98f6 | 2009-09-30 18:29:55 +0000 | [diff] [blame] | 408 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 409 | # Always enable SiI SATA controllers for now. |
| 410 | CONFIG_SATASII ?= yes |
| 411 | |
Uwe Hermann | ddd5c9e | 2010-02-21 21:17:00 +0000 | [diff] [blame] | 412 | # Highpoint (HPT) ATA/RAID controller support. |
| 413 | # IMPORTANT: This code is not yet working! |
| 414 | CONFIG_ATAHPT ?= no |
| 415 | |
Jonathan Kollasch | 7f0f3fa | 2014-06-01 10:26:23 +0000 | [diff] [blame] | 416 | # VIA VT6421A LPC memory support |
| 417 | CONFIG_ATAVIA ?= yes |
| 418 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 419 | # Always enable FT2232 SPI dongles for now. |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 420 | CONFIG_FT2232_SPI ?= yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 421 | |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 422 | # Always enable Altera USB-Blaster dongles for now. |
| 423 | CONFIG_USBBLASTER_SPI ?= yes |
| 424 | |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 425 | # MSTAR DDC support needs more tests/reviews/cleanups. |
| 426 | CONFIG_MSTARDDC_SPI ?= no |
| 427 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 428 | # Always enable dummy tracing for now. |
| 429 | CONFIG_DUMMY ?= yes |
| 430 | |
| 431 | # Always enable Dr. Kaiser for now. |
| 432 | CONFIG_DRKAISER ?= yes |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 433 | |
Joerg Fischer | 5665ef3 | 2010-05-21 21:54:07 +0000 | [diff] [blame] | 434 | # Always enable Realtek NICs for now. |
| 435 | CONFIG_NICREALTEK ?= yes |
| 436 | |
Andrew Morgan | c29c2e7 | 2010-06-07 22:37:54 +0000 | [diff] [blame] | 437 | # Disable National Semiconductor NICs until support is complete and tested. |
| 438 | CONFIG_NICNATSEMI ?= no |
| 439 | |
Carl-Daniel Hailfinger | b713d2e | 2011-05-08 00:24:18 +0000 | [diff] [blame] | 440 | # Always enable Intel NICs for now. |
| 441 | CONFIG_NICINTEL ?= yes |
| 442 | |
Idwer Vollering | 004f4b7 | 2010-09-03 18:21:21 +0000 | [diff] [blame] | 443 | # Always enable SPI on Intel NICs for now. |
| 444 | CONFIG_NICINTEL_SPI ?= yes |
| 445 | |
Ricardo Ribalda Delgado | 2a41f0a | 2014-07-28 20:35:21 +0000 | [diff] [blame] | 446 | # Always enable EEPROM on Intel NICs for now. |
| 447 | CONFIG_NICINTEL_EEPROM ?= yes |
| 448 | |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 449 | # Always enable SPI on OGP cards for now. |
| 450 | CONFIG_OGP_SPI ?= yes |
| 451 | |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 452 | # Always enable Bus Pirate SPI for now. |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 453 | CONFIG_BUSPIRATE_SPI ?= yes |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 454 | |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 455 | # Disable Dediprog SF100 until support is complete and tested. |
| 456 | CONFIG_DEDIPROG ?= no |
| 457 | |
Carl-Daniel Hailfinger | 9a1105c | 2011-02-04 21:37:59 +0000 | [diff] [blame] | 458 | # Always enable Marvell SATA controllers for now. |
| 459 | CONFIG_SATAMV ?= yes |
| 460 | |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 461 | # Enable Linux spidev interface by default. We disable it on non-Linux targets. |
| 462 | CONFIG_LINUX_SPI ?= yes |
| 463 | |
Kyösti Mälkki | 72d42f8 | 2014-06-01 23:48:31 +0000 | [diff] [blame] | 464 | # Always enable ITE IT8212F PATA controllers for now. |
| 465 | CONFIG_IT8212 ?= yes |
| 466 | |
Carl-Daniel Hailfinger | 6161ff1 | 2009-11-16 21:22:24 +0000 | [diff] [blame] | 467 | # Disable wiki printing by default. It is only useful if you have wiki access. |
Uwe Hermann | 2db77a0 | 2010-06-04 17:07:39 +0000 | [diff] [blame] | 468 | CONFIG_PRINT_WIKI ?= no |
Carl-Daniel Hailfinger | 9c8476b | 2009-09-16 12:19:03 +0000 | [diff] [blame] | 469 | |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 470 | # Bitbanging SPI infrastructure, default off unless needed. |
| 471 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 472 | override CONFIG_BITBANG_SPI = yes |
| 473 | else |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 474 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 475 | override CONFIG_BITBANG_SPI = yes |
| 476 | else |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 477 | ifeq ($(CONFIG_INTERNAL), yes) |
| 478 | override CONFIG_BITBANG_SPI = yes |
| 479 | else |
| 480 | ifeq ($(CONFIG_NICINTEL_SPI), yes) |
| 481 | override CONFIG_BITBANG_SPI = yes |
| 482 | else |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 483 | ifeq ($(CONFIG_OGP_SPI), yes) |
| 484 | override CONFIG_BITBANG_SPI = yes |
| 485 | else |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 486 | CONFIG_BITBANG_SPI ?= no |
| 487 | endif |
| 488 | endif |
| 489 | endif |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 490 | endif |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 491 | endif |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 492 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 493 | ############################################################################### |
Sean Nelson | 4c6d3a4 | 2013-09-11 23:35:03 +0000 | [diff] [blame] | 494 | # Handle CONFIG_* variables that depend on others set (and verified) above. |
| 495 | |
| 496 | # The external DMI decoder (dmidecode) does not work in libpayload. Bail out if the internal one got disabled. |
| 497 | ifeq ($(TARGET_OS), libpayload) |
| 498 | ifeq ($(CONFIG_INTERNAL), yes) |
| 499 | ifeq ($(CONFIG_INTERNAL_DMI), no) |
| 500 | UNSUPPORTED_FEATURES += CONFIG_INTERNAL_DMI=no |
| 501 | else |
| 502 | override CONFIG_INTERNAL_DMI = yes |
| 503 | endif |
| 504 | endif |
| 505 | endif |
| 506 | |
| 507 | # Use internal DMI/SMBIOS decoder by default instead of relying on dmidecode. |
| 508 | CONFIG_INTERNAL_DMI ?= yes |
| 509 | |
| 510 | ############################################################################### |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 511 | # Programmer drivers and programmer support infrastructure. |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 512 | # Depending on the CONFIG_* variables set and verified above we set compiler flags and parameters below. |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 513 | |
Stefan Tauner | fd0d413 | 2012-09-25 21:24:55 +0000 | [diff] [blame] | 514 | FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER=$(CONFIG_DEFAULT_PROGRAMMER)' |
Stefan Tauner | 265fcac | 2014-06-02 00:12:23 +0000 | [diff] [blame] | 515 | FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"' |
Stefan Tauner | fd0d413 | 2012-09-25 21:24:55 +0000 | [diff] [blame] | 516 | |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 517 | ifeq ($(CONFIG_INTERNAL), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 518 | FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' |
Sean Nelson | 4c6d3a4 | 2013-09-11 23:35:03 +0000 | [diff] [blame] | 519 | PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o internal.o |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 520 | ifeq ($(ARCH), x86) |
Rudolf Marek | 70e1459 | 2013-07-25 22:58:56 +0000 | [diff] [blame] | 521 | PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o amd_imc.o wbsio_spi.o mcp6x_spi.o |
Sean Nelson | 4c6d3a4 | 2013-09-11 23:35:03 +0000 | [diff] [blame] | 522 | PROGRAMMER_OBJS += ichspi.o ich_descriptors.o dmi.o |
| 523 | ifeq ($(CONFIG_INTERNAL_DMI), yes) |
| 524 | FEATURE_CFLAGS += -D'CONFIG_INTERNAL_DMI=1' |
| 525 | endif |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 526 | else |
| 527 | endif |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 528 | NEED_PCI := yes |
| 529 | endif |
| 530 | |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 531 | ifeq ($(CONFIG_SERPROG), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 532 | FEATURE_CFLAGS += -D'CONFIG_SERPROG=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 533 | PROGRAMMER_OBJS += serprog.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 534 | NEED_SERIAL := yes |
| 535 | NEED_NET := yes |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 536 | endif |
| 537 | |
Carl-Daniel Hailfinger | e7fdd6e | 2010-07-21 10:26:01 +0000 | [diff] [blame] | 538 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 539 | FEATURE_CFLAGS += -D'CONFIG_RAYER_SPI=1' |
| 540 | PROGRAMMER_OBJS += rayer_spi.o |
| 541 | # Actually, NEED_PCI is wrong. NEED_IOPORT_ACCESS would be more correct. |
| 542 | NEED_PCI := yes |
| 543 | endif |
| 544 | |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 545 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 546 | FEATURE_CFLAGS += -D'CONFIG_PONY_SPI=1' |
| 547 | PROGRAMMER_OBJS += pony_spi.o |
| 548 | NEED_SERIAL := yes |
| 549 | endif |
| 550 | |
Carl-Daniel Hailfinger | 547872b | 2009-09-28 13:15:16 +0000 | [diff] [blame] | 551 | ifeq ($(CONFIG_BITBANG_SPI), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 552 | FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 553 | PROGRAMMER_OBJS += bitbang_spi.o |
Carl-Daniel Hailfinger | 547872b | 2009-09-28 13:15:16 +0000 | [diff] [blame] | 554 | endif |
| 555 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 556 | ifeq ($(CONFIG_NIC3COM), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 557 | FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 558 | PROGRAMMER_OBJS += nic3com.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 559 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 560 | endif |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 561 | |
Uwe Hermann | 2bc98f6 | 2009-09-30 18:29:55 +0000 | [diff] [blame] | 562 | ifeq ($(CONFIG_GFXNVIDIA), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 563 | FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 564 | PROGRAMMER_OBJS += gfxnvidia.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 565 | NEED_PCI := yes |
Uwe Hermann | 2bc98f6 | 2009-09-30 18:29:55 +0000 | [diff] [blame] | 566 | endif |
| 567 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 568 | ifeq ($(CONFIG_SATASII), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 569 | FEATURE_CFLAGS += -D'CONFIG_SATASII=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 570 | PROGRAMMER_OBJS += satasii.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 571 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 572 | endif |
| 573 | |
Uwe Hermann | ddd5c9e | 2010-02-21 21:17:00 +0000 | [diff] [blame] | 574 | ifeq ($(CONFIG_ATAHPT), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 575 | FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1' |
Uwe Hermann | ddd5c9e | 2010-02-21 21:17:00 +0000 | [diff] [blame] | 576 | PROGRAMMER_OBJS += atahpt.o |
| 577 | NEED_PCI := yes |
| 578 | endif |
| 579 | |
Jonathan Kollasch | 7f0f3fa | 2014-06-01 10:26:23 +0000 | [diff] [blame] | 580 | ifeq ($(CONFIG_ATAVIA), yes) |
| 581 | FEATURE_CFLAGS += -D'CONFIG_ATAVIA=1' |
| 582 | PROGRAMMER_OBJS += atavia.o |
| 583 | NEED_PCI := yes |
| 584 | endif |
| 585 | |
Kyösti Mälkki | 72d42f8 | 2014-06-01 23:48:31 +0000 | [diff] [blame] | 586 | ifeq ($(CONFIG_IT8212), yes) |
| 587 | FEATURE_CFLAGS += -D'CONFIG_IT8212=1' |
| 588 | PROGRAMMER_OBJS += it8212.o |
| 589 | NEED_PCI := yes |
| 590 | endif |
| 591 | |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 592 | ifeq ($(CONFIG_FT2232_SPI), yes) |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 593 | # This is a totally ugly hack. |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 594 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'") |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 595 | NEED_FTDI := yes |
| 596 | PROGRAMMER_OBJS += ft2232_spi.o |
| 597 | endif |
| 598 | |
| 599 | ifeq ($(CONFIG_USBBLASTER_SPI), yes) |
| 600 | # This is a totally ugly hack. |
| 601 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_USBBLASTER_SPI=1'") |
| 602 | NEED_FTDI := yes |
| 603 | PROGRAMMER_OBJS += usbblaster_spi.o |
| 604 | endif |
| 605 | |
| 606 | ifeq ($(NEED_FTDI), yes) |
| 607 | FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") |
Ilya A. Volynets-Evenbakh | 2c714ab | 2012-09-26 00:47:09 +0000 | [diff] [blame] | 608 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FT232H := yes" .features && printf "%s" "-D'HAVE_FT232H=1'") |
Jörg Mayer | 8776db2 | 2009-11-16 14:05:13 +0000 | [diff] [blame] | 609 | FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)") |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 610 | # We can't set NEED_USB here because that would transform libftdi auto-enabling |
| 611 | # into a hard requirement for libusb, defeating the purpose of auto-enabling. |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 612 | endif |
| 613 | |
| 614 | ifeq ($(CONFIG_DUMMY), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 615 | FEATURE_CFLAGS += -D'CONFIG_DUMMY=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 616 | PROGRAMMER_OBJS += dummyflasher.o |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 617 | endif |
| 618 | |
| 619 | ifeq ($(CONFIG_DRKAISER), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 620 | FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 621 | PROGRAMMER_OBJS += drkaiser.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 622 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 623 | endif |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 624 | |
Joerg Fischer | 5665ef3 | 2010-05-21 21:54:07 +0000 | [diff] [blame] | 625 | ifeq ($(CONFIG_NICREALTEK), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 626 | FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1' |
Joerg Fischer | 5665ef3 | 2010-05-21 21:54:07 +0000 | [diff] [blame] | 627 | PROGRAMMER_OBJS += nicrealtek.o |
| 628 | NEED_PCI := yes |
| 629 | endif |
| 630 | |
Andrew Morgan | c29c2e7 | 2010-06-07 22:37:54 +0000 | [diff] [blame] | 631 | ifeq ($(CONFIG_NICNATSEMI), yes) |
| 632 | FEATURE_CFLAGS += -D'CONFIG_NICNATSEMI=1' |
| 633 | PROGRAMMER_OBJS += nicnatsemi.o |
| 634 | NEED_PCI := yes |
| 635 | endif |
| 636 | |
Carl-Daniel Hailfinger | b713d2e | 2011-05-08 00:24:18 +0000 | [diff] [blame] | 637 | ifeq ($(CONFIG_NICINTEL), yes) |
| 638 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL=1' |
| 639 | PROGRAMMER_OBJS += nicintel.o |
| 640 | NEED_PCI := yes |
| 641 | endif |
| 642 | |
Idwer Vollering | 004f4b7 | 2010-09-03 18:21:21 +0000 | [diff] [blame] | 643 | ifeq ($(CONFIG_NICINTEL_SPI), yes) |
| 644 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL_SPI=1' |
| 645 | PROGRAMMER_OBJS += nicintel_spi.o |
| 646 | NEED_PCI := yes |
| 647 | endif |
| 648 | |
Ricardo Ribalda Delgado | 2a41f0a | 2014-07-28 20:35:21 +0000 | [diff] [blame] | 649 | ifeq ($(CONFIG_NICINTEL_EEPROM), yes) |
| 650 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL_EEPROM=1' |
| 651 | PROGRAMMER_OBJS += nicintel_eeprom.o |
| 652 | NEED_PCI := yes |
| 653 | endif |
| 654 | |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 655 | ifeq ($(CONFIG_OGP_SPI), yes) |
| 656 | FEATURE_CFLAGS += -D'CONFIG_OGP_SPI=1' |
| 657 | PROGRAMMER_OBJS += ogp_spi.o |
| 658 | NEED_PCI := yes |
| 659 | endif |
| 660 | |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 661 | ifeq ($(CONFIG_BUSPIRATE_SPI), yes) |
| 662 | FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 663 | PROGRAMMER_OBJS += buspirate_spi.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 664 | NEED_SERIAL := yes |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 665 | endif |
| 666 | |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 667 | ifeq ($(CONFIG_DEDIPROG), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 668 | FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 669 | PROGRAMMER_OBJS += dediprog.o |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 670 | NEED_USB := yes |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 671 | endif |
| 672 | |
Carl-Daniel Hailfinger | 9a1105c | 2011-02-04 21:37:59 +0000 | [diff] [blame] | 673 | ifeq ($(CONFIG_SATAMV), yes) |
| 674 | FEATURE_CFLAGS += -D'CONFIG_SATAMV=1' |
| 675 | PROGRAMMER_OBJS += satamv.o |
| 676 | NEED_PCI := yes |
| 677 | endif |
| 678 | |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 679 | ifeq ($(CONFIG_LINUX_SPI), yes) |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 680 | # This is a totally ugly hack. |
| 681 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "LINUX_SPI_SUPPORT := yes" .features && printf "%s" "-D'CONFIG_LINUX_SPI=1'") |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 682 | PROGRAMMER_OBJS += linux_spi.o |
| 683 | endif |
| 684 | |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 685 | ifeq ($(CONFIG_MSTARDDC_SPI), yes) |
| 686 | # This is a totally ugly hack. |
| 687 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "LINUX_I2C_SUPPORT := yes" .features && printf "%s" "-D'CONFIG_MSTARDDC_SPI=1'") |
| 688 | NEED_LINUX_I2C := yes |
| 689 | PROGRAMMER_OBJS += mstarddc_spi.o |
| 690 | endif |
| 691 | |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 692 | ifeq ($(NEED_SERIAL), yes) |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 693 | LIB_OBJS += serial.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 694 | endif |
| 695 | |
| 696 | ifeq ($(NEED_NET), yes) |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 697 | ifeq ($(TARGET_OS), SunOS) |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 698 | LIBS += -lsocket |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 699 | endif |
Carl-Daniel Hailfinger | e51ea10 | 2009-11-23 19:20:11 +0000 | [diff] [blame] | 700 | endif |
| 701 | |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 702 | ifeq ($(NEED_PCI), yes) |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 703 | CHECK_LIBPCI = yes |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 704 | FEATURE_CFLAGS += -D'NEED_PCI=1' |
Carl-Daniel Hailfinger | fb0828f | 2010-02-12 19:35:25 +0000 | [diff] [blame] | 705 | PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 706 | ifeq ($(TARGET_OS), NetBSD) |
Carl-Daniel Hailfinger | 460b282 | 2010-06-04 23:24:57 +0000 | [diff] [blame] | 707 | # The libpci we want is called libpciutils on NetBSD and needs NetBSD libpci. |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 708 | PCILIBS += -lpciutils -lpci |
Carl-Daniel Hailfinger | 460b282 | 2010-06-04 23:24:57 +0000 | [diff] [blame] | 709 | # For (i386|x86_64)_iopl(2). |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 710 | PCILIBS += -l$(shell uname -p) |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 711 | else |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 712 | |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 713 | PCILIBS += -lpci |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 714 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 715 | ifeq ($(TARGET_OS), OpenBSD) |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 716 | # For (i386|amd64)_iopl(2). |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 717 | PCILIBS += -l$(shell uname -m) |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 718 | else |
| 719 | ifeq ($(TARGET_OS), Darwin) |
| 720 | # DirectHW framework can be found in the DirectHW library. |
Stefan Tauner | e34e3e8 | 2013-01-01 00:06:51 +0000 | [diff] [blame] | 721 | PCILIBS += -framework IOKit -framework DirectHW |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 722 | endif |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 723 | endif |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 724 | endif |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 725 | endif |
| 726 | |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 727 | ifeq ($(NEED_USB), yes) |
| 728 | CHECK_LIBUSB0 = yes |
| 729 | FEATURE_CFLAGS += -D'NEED_USB=1' |
| 730 | USBLIBS := $(shell pkg-config --libs libusb 2>/dev/null || printf "%s" "-lusb") |
| 731 | endif |
| 732 | |
Carl-Daniel Hailfinger | 9c8476b | 2009-09-16 12:19:03 +0000 | [diff] [blame] | 733 | ifeq ($(CONFIG_PRINT_WIKI), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 734 | FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 735 | CLI_OBJS += print_wiki.o |
Carl-Daniel Hailfinger | 9c8476b | 2009-09-16 12:19:03 +0000 | [diff] [blame] | 736 | endif |
| 737 | |
Carl-Daniel Hailfinger | 132e2ec | 2010-03-27 16:36:40 +0000 | [diff] [blame] | 738 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "UTSNAME := yes" .features && printf "%s" "-D'HAVE_UTSNAME=1'") |
| 739 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 740 | # We could use PULLED_IN_LIBS, but that would be ugly. |
| 741 | FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%s" "-lz") |
| 742 | |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 743 | LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS) |
Stefan Tauner | d94d25d | 2012-07-28 03:17:15 +0000 | [diff] [blame] | 744 | OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS) |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 745 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 746 | all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8 |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 747 | ifeq ($(ARCH), x86) |
| 748 | @+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX) |
| 749 | endif |
| 750 | |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 751 | $(PROGRAM)$(EXEC_SUFFIX): $(OBJS) |
Carl-Daniel Hailfinger | 11990da | 2013-07-13 23:21:05 +0000 | [diff] [blame] | 752 | $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LIBS) $(PCILIBS) $(FEATURE_LIBS) $(USBLIBS) |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 753 | |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 754 | libflashrom.a: $(LIBFLASHROM_OBJS) |
| 755 | $(AR) rcs $@ $^ |
| 756 | $(RANLIB) $@ |
| 757 | |
Carl-Daniel Hailfinger | 8ef7dce | 2009-07-10 20:19:48 +0000 | [diff] [blame] | 758 | # TAROPTIONS reduces information leakage from the packager's system. |
| 759 | # If other tar programs support command line arguments for setting uid/gid of |
| 760 | # stored files, they can be handled here as well. |
| 761 | TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root") |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 762 | |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 763 | %.o: %.c .features |
Carl-Daniel Hailfinger | a8da224 | 2012-08-15 23:06:32 +0000 | [diff] [blame] | 764 | $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $< |
Clark Rawlins | 02016f7 | 2008-02-14 23:22:20 +0000 | [diff] [blame] | 765 | |
Carl-Daniel Hailfinger | a0020df | 2010-05-30 22:35:14 +0000 | [diff] [blame] | 766 | # Make sure to add all names of generated binaries here. |
| 767 | # This includes all frontends and libflashrom. |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 768 | # We don't use EXEC_SUFFIX here because we want to clean everything. |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 769 | clean: |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 770 | rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8 |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 771 | @+$(MAKE) -C util/ich_descriptors_tool/ clean |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 772 | |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 773 | distclean: clean |
Stefan Reinauer | e2f0158 | 2010-06-07 11:08:07 +0000 | [diff] [blame] | 774 | rm -f .features .libdeps |
Christian Ruppert | db9d9f4 | 2009-05-14 14:17:07 +0000 | [diff] [blame] | 775 | |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 776 | strip: $(PROGRAM)$(EXEC_SUFFIX) |
| 777 | $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX) |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 778 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 779 | # to define test programs we use verbatim variables, which get exported |
| 780 | # to environment variables and are referenced with $$<varname> later |
| 781 | |
| 782 | define COMPILER_TEST |
| 783 | int main(int argc, char **argv) |
| 784 | { |
| 785 | (void) argc; |
| 786 | (void) argv; |
| 787 | return 0; |
| 788 | } |
| 789 | endef |
| 790 | export COMPILER_TEST |
| 791 | |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 792 | compiler: featuresavailable |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 793 | @printf "Checking for a C compiler... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 794 | @echo "$$COMPILER_TEST" > .test.c |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 795 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test.c -o .test$(EXEC_SUFFIX) >/dev/null && \ |
Carl-Daniel Hailfinger | 4cb7a96 | 2009-06-16 09:31:51 +0000 | [diff] [blame] | 796 | echo "found." || ( echo "not found."; \ |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 797 | rm -f .test.c .test$(EXEC_SUFFIX); exit 1) |
| 798 | @rm -f .test.c .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 799 | @printf "Target arch is " |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 800 | @# FreeBSD wc will output extraneous whitespace. |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 801 | @echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 802 | ( echo "unknown. Aborting."; exit 1) |
| 803 | @printf "%s\n" '$(ARCH)' |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 804 | @printf "Target OS is " |
| 805 | @# FreeBSD wc will output extraneous whitespace. |
| 806 | @echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ |
| 807 | ( echo "unknown. Aborting."; exit 1) |
| 808 | @printf "%s\n" '$(TARGET_OS)' |
Stefan Tauner | d6c17f6 | 2013-09-12 14:04:31 +0000 | [diff] [blame] | 809 | ifeq ($(TARGET_OS), libpayload) |
| 810 | @$(CC) --version 2>&1 | grep -q coreboot || \ |
| 811 | ( echo "Warning: It seems you are not using coreboot's reference compiler."; \ |
| 812 | echo "This might work but usually does not, please beware." ) |
| 813 | endif |
Carl-Daniel Hailfinger | 4cb7a96 | 2009-06-16 09:31:51 +0000 | [diff] [blame] | 814 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 815 | define LIBPCI_TEST |
| 816 | /* Avoid a failing test due to libpci header symbol shadowing breakage */ |
| 817 | #define index shadow_workaround_index |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 818 | #if !defined __NetBSD__ && !defined __DragonFly__ |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 819 | #include <pci/pci.h> |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 820 | #else |
| 821 | #include <pciutils/pci.h> |
| 822 | #endif |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 823 | struct pci_access *pacc; |
| 824 | int main(int argc, char **argv) |
| 825 | { |
| 826 | (void) argc; |
| 827 | (void) argv; |
| 828 | pacc = pci_alloc(); |
| 829 | return 0; |
| 830 | } |
| 831 | endef |
| 832 | export LIBPCI_TEST |
| 833 | |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 834 | define LIBUSB0_TEST |
| 835 | #include <usb.h> |
| 836 | int main(int argc, char **argv) |
| 837 | { |
| 838 | (void) argc; |
| 839 | (void) argv; |
| 840 | usb_init(); |
| 841 | return 0; |
| 842 | } |
| 843 | endef |
| 844 | export LIBUSB0_TEST |
| 845 | |
| 846 | hwlibs: compiler |
| 847 | @printf "" > .libdeps |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 848 | ifeq ($(CHECK_LIBPCI), yes) |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 849 | @printf "Checking for libpci headers... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 850 | @echo "$$LIBPCI_TEST" > .test.c |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 851 | @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 852 | echo "found." || ( echo "not found."; echo; \ |
| 853 | echo "Please install libpci headers (package pciutils-devel)."; \ |
| 854 | echo "See README for more information."; echo; \ |
| 855 | rm -f .test.c .test.o; exit 1) |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 856 | @printf "Checking if libpci is present and sufficient... " |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 857 | @$(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(PCILIBS) >/dev/null && \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 858 | echo "yes." || ( echo "no."; \ |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 859 | printf "Checking if libz+libpci are present and sufficient..."; \ |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 860 | $(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(PCILIBS) -lz >/dev/null && \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 861 | ( echo "yes."; echo "NEEDLIBZ := yes" > .libdeps ) || ( echo "no."; echo; \ |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 862 | echo "Please install libpci (package pciutils) and/or libz."; \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 863 | echo "See README for more information."; echo; \ |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 864 | rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) ) |
| 865 | @rm -f .test.c .test.o .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 866 | endif |
| 867 | ifeq ($(CHECK_LIBUSB0), yes) |
| 868 | @printf "Checking for libusb-0.1/libusb-compat headers... " |
| 869 | @echo "$$LIBUSB0_TEST" > .test.c |
| 870 | @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \ |
| 871 | echo "found." || ( echo "not found."; echo; \ |
| 872 | echo "Please install libusb-0.1 headers or libusb-compat headers."; \ |
| 873 | echo "See README for more information."; echo; \ |
| 874 | rm -f .test.c .test.o; exit 1) |
| 875 | @printf "Checking if libusb-0.1 is usable... " |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 876 | @$(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) $(USBLIBS) >/dev/null && \ |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 877 | echo "yes." || ( echo "no."; \ |
| 878 | echo "Please install libusb-0.1 or libusb-compat."; \ |
| 879 | echo "See README for more information."; echo; \ |
| 880 | rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) |
| 881 | @rm -f .test.c .test.o .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | 8a59ff0 | 2009-12-24 03:33:11 +0000 | [diff] [blame] | 882 | endif |
Stefan Reinauer | 53e9625 | 2005-12-01 16:19:24 +0000 | [diff] [blame] | 883 | |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 884 | .features: features |
| 885 | |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 886 | # If a user does not explicitly request a non-working feature, we should |
| 887 | # silently disable it. However, if a non-working (does not compile) feature |
| 888 | # is explicitly requested, we should bail out with a descriptive error message. |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 889 | # We also have to check that at least one programmer driver is enabled. |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 890 | featuresavailable: |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 891 | ifeq ($(PROGRAMMER_OBJS),) |
| 892 | @echo "You have to enable at least one programmer driver!" |
| 893 | @false |
| 894 | endif |
| 895 | ifneq ($(UNSUPPORTED_FEATURES), ) |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 896 | @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)" |
| 897 | @false |
| 898 | endif |
| 899 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 900 | define FTDI_TEST |
| 901 | #include <ftdi.h> |
| 902 | struct ftdi_context *ftdic = NULL; |
| 903 | int main(int argc, char **argv) |
| 904 | { |
| 905 | (void) argc; |
| 906 | (void) argv; |
| 907 | return ftdi_init(ftdic); |
| 908 | } |
| 909 | endef |
| 910 | export FTDI_TEST |
| 911 | |
Ilya A. Volynets-Evenbakh | 2c714ab | 2012-09-26 00:47:09 +0000 | [diff] [blame] | 912 | define FTDI_232H_TEST |
| 913 | #include <ftdi.h> |
| 914 | enum ftdi_chip_type type = TYPE_232H; |
| 915 | endef |
| 916 | export FTDI_232H_TEST |
| 917 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 918 | define UTSNAME_TEST |
| 919 | #include <sys/utsname.h> |
| 920 | struct utsname osinfo; |
| 921 | int main(int argc, char **argv) |
| 922 | { |
| 923 | (void) argc; |
| 924 | (void) argv; |
| 925 | uname (&osinfo); |
| 926 | return 0; |
| 927 | } |
| 928 | endef |
| 929 | export UTSNAME_TEST |
| 930 | |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 931 | define LINUX_SPI_TEST |
| 932 | #include <linux/types.h> |
| 933 | #include <linux/spi/spidev.h> |
| 934 | |
| 935 | int main(int argc, char **argv) |
| 936 | { |
| 937 | (void) argc; |
| 938 | (void) argv; |
| 939 | return 0; |
| 940 | } |
| 941 | endef |
| 942 | export LINUX_SPI_TEST |
| 943 | |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 944 | define LINUX_I2C_TEST |
| 945 | #include <linux/i2c-dev.h> |
| 946 | #include <linux/i2c.h> |
| 947 | |
| 948 | int main(int argc, char **argv) |
| 949 | { |
| 950 | (void) argc; |
| 951 | (void) argv; |
| 952 | return 0; |
| 953 | } |
| 954 | endef |
| 955 | export LINUX_I2C_TEST |
| 956 | |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 957 | features: compiler |
| 958 | @echo "FEATURES := yes" > .features.tmp |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 959 | ifeq ($(NEED_FTDI), yes) |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 960 | @printf "Checking for FTDI support... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 961 | @echo "$$FTDI_TEST" > .featuretest.c |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 962 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \ |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 963 | ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) || \ |
| 964 | ( echo "not found."; echo "FTDISUPPORT := no" >> .features.tmp ) |
Ilya A. Volynets-Evenbakh | 2c714ab | 2012-09-26 00:47:09 +0000 | [diff] [blame] | 965 | @printf "Checking for FT232H support in libftdi... " |
| 966 | @echo "$$FTDI_232H_TEST" >> .featuretest.c |
| 967 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \ |
| 968 | ( echo "found."; echo "FT232H := yes" >> .features.tmp ) || \ |
| 969 | ( echo "not found."; echo "FT232H := no" >> .features.tmp ) |
Carl-Daniel Hailfinger | 8a59ff0 | 2009-12-24 03:33:11 +0000 | [diff] [blame] | 970 | endif |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 971 | ifeq ($(CONFIG_LINUX_SPI), yes) |
| 972 | @printf "Checking if Linux SPI headers are present... " |
| 973 | @echo "$$LINUX_SPI_TEST" > .featuretest.c |
| 974 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 975 | ( echo "yes."; echo "LINUX_SPI_SUPPORT := yes" >> .features.tmp ) || \ |
| 976 | ( echo "no."; echo "LINUX_SPI_SUPPORT := no" >> .features.tmp ) |
| 977 | endif |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 978 | ifeq ($(NEED_LINUX_I2C), yes) |
| 979 | @printf "Checking if Linux I2C headers are present... " |
| 980 | @echo "$$LINUX_I2C_TEST" > .featuretest.c |
| 981 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 982 | ( echo "yes."; echo "LINUX_I2C_SUPPORT := yes" >> .features.tmp ) || \ |
| 983 | ( echo "no."; echo "LINUX_I2C_SUPPORT := no" >> .features.tmp ) |
| 984 | endif |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 985 | @printf "Checking for utsname support... " |
| 986 | @echo "$$UTSNAME_TEST" > .featuretest.c |
| 987 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 988 | ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \ |
| 989 | ( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) |
| 990 | @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features |
| 991 | @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX) |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 992 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 993 | $(PROGRAM).8: $(PROGRAM).8.tmpl |
Stefan Tauner | d5ff845 | 2015-01-10 09:32:07 +0000 | [diff] [blame] | 994 | @sed -e '1 s#".*".*#"$(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl 2>/dev/null)" "$(VERSION)"#' <$< >$@ |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 995 | |
| 996 | install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8 |
Uwe Hermann | c2a9c9c | 2009-05-14 14:51:14 +0000 | [diff] [blame] | 997 | mkdir -p $(DESTDIR)$(PREFIX)/sbin |
Uwe Hermann | 56b2cb0 | 2009-05-21 15:59:58 +0000 | [diff] [blame] | 998 | mkdir -p $(DESTDIR)$(MANDIR)/man8 |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 999 | $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin |
Uwe Hermann | 56b2cb0 | 2009-05-21 15:59:58 +0000 | [diff] [blame] | 1000 | $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8 |
Uwe Hermann | c113b57 | 2006-12-14 00:59:41 +0000 | [diff] [blame] | 1001 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1002 | export: $(PROGRAM).8 |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1003 | @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1004 | @svn export -r BASE . $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1005 | @sed "s/^SVNVERSION.*/SVNVERSION := $(SVNVERSION)/" Makefile >$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1006 | @cp $(PROGRAM).8 "$(EXPORTDIR)/flashrom-$(RELEASENAME)/$(PROGRAM).8" |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1007 | @LC_ALL=C svn log >$(EXPORTDIR)/flashrom-$(RELEASENAME)/ChangeLog |
| 1008 | @echo Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/ |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 1009 | |
| 1010 | tarball: export |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1011 | @tar cjf $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2 -C $(EXPORTDIR)/ $(TAROPTIONS) flashrom-$(RELEASENAME)/ |
| 1012 | @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1013 | @echo Created $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2 |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 1014 | |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 1015 | djgpp-dos: clean |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 1016 | make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip |
| 1017 | libpayload: clean |
| 1018 | make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 1019 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1020 | .PHONY: all install clean distclean compiler hwlibs features export tarball dos featuresavailable |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 1021 | |
Stefan Reinauer | e2f0158 | 2010-06-07 11:08:07 +0000 | [diff] [blame] | 1022 | -include $(OBJS:.o=.d) |