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) |
Stefan Tauner | 8d21ff1 | 2015-01-10 09:33:06 +0000 | [diff] [blame] | 114 | CPPFLAGS += -I/usr/local/include |
| 115 | LDFLAGS += -L/usr/local/lib |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 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 | |
Patrick Georgi | ced7ab6 | 2015-01-19 19:52:34 +0000 | [diff] [blame^] | 470 | # Enable all features if CONFIG_EVERYTHING=yes is given |
| 471 | ifeq ($(CONFIG_EVERYTHING), yes) |
| 472 | $(foreach var, $(filter CONFIG_%, $(.VARIABLES)),\ |
| 473 | $(if $(filter no, $($(var))),\ |
| 474 | $(eval $(var)=yes))) |
| 475 | endif |
| 476 | |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 477 | # Bitbanging SPI infrastructure, default off unless needed. |
| 478 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 479 | override CONFIG_BITBANG_SPI = yes |
| 480 | else |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 481 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 482 | override CONFIG_BITBANG_SPI = yes |
| 483 | else |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 484 | ifeq ($(CONFIG_INTERNAL), yes) |
| 485 | override CONFIG_BITBANG_SPI = yes |
| 486 | else |
| 487 | ifeq ($(CONFIG_NICINTEL_SPI), yes) |
| 488 | override CONFIG_BITBANG_SPI = yes |
| 489 | else |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 490 | ifeq ($(CONFIG_OGP_SPI), yes) |
| 491 | override CONFIG_BITBANG_SPI = yes |
| 492 | else |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 493 | CONFIG_BITBANG_SPI ?= no |
| 494 | endif |
| 495 | endif |
| 496 | endif |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 497 | endif |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 498 | endif |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 499 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 500 | ############################################################################### |
Sean Nelson | 4c6d3a4 | 2013-09-11 23:35:03 +0000 | [diff] [blame] | 501 | # Handle CONFIG_* variables that depend on others set (and verified) above. |
| 502 | |
| 503 | # The external DMI decoder (dmidecode) does not work in libpayload. Bail out if the internal one got disabled. |
| 504 | ifeq ($(TARGET_OS), libpayload) |
| 505 | ifeq ($(CONFIG_INTERNAL), yes) |
| 506 | ifeq ($(CONFIG_INTERNAL_DMI), no) |
| 507 | UNSUPPORTED_FEATURES += CONFIG_INTERNAL_DMI=no |
| 508 | else |
| 509 | override CONFIG_INTERNAL_DMI = yes |
| 510 | endif |
| 511 | endif |
| 512 | endif |
| 513 | |
| 514 | # Use internal DMI/SMBIOS decoder by default instead of relying on dmidecode. |
| 515 | CONFIG_INTERNAL_DMI ?= yes |
| 516 | |
| 517 | ############################################################################### |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 518 | # Programmer drivers and programmer support infrastructure. |
Stefan Tauner | 037cd84 | 2013-08-25 00:10:56 +0000 | [diff] [blame] | 519 | # 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] | 520 | |
Stefan Tauner | fd0d413 | 2012-09-25 21:24:55 +0000 | [diff] [blame] | 521 | FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER=$(CONFIG_DEFAULT_PROGRAMMER)' |
Stefan Tauner | 265fcac | 2014-06-02 00:12:23 +0000 | [diff] [blame] | 522 | FEATURE_CFLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"' |
Stefan Tauner | fd0d413 | 2012-09-25 21:24:55 +0000 | [diff] [blame] | 523 | |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 524 | ifeq ($(CONFIG_INTERNAL), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 525 | FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' |
Sean Nelson | 4c6d3a4 | 2013-09-11 23:35:03 +0000 | [diff] [blame] | 526 | 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] | 527 | ifeq ($(ARCH), x86) |
Rudolf Marek | 70e1459 | 2013-07-25 22:58:56 +0000 | [diff] [blame] | 528 | 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] | 529 | PROGRAMMER_OBJS += ichspi.o ich_descriptors.o dmi.o |
| 530 | ifeq ($(CONFIG_INTERNAL_DMI), yes) |
| 531 | FEATURE_CFLAGS += -D'CONFIG_INTERNAL_DMI=1' |
| 532 | endif |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 533 | else |
| 534 | endif |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 535 | NEED_PCI := yes |
| 536 | endif |
| 537 | |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 538 | ifeq ($(CONFIG_SERPROG), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 539 | FEATURE_CFLAGS += -D'CONFIG_SERPROG=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 540 | PROGRAMMER_OBJS += serprog.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 541 | NEED_SERIAL := yes |
| 542 | NEED_NET := yes |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 543 | endif |
| 544 | |
Carl-Daniel Hailfinger | e7fdd6e | 2010-07-21 10:26:01 +0000 | [diff] [blame] | 545 | ifeq ($(CONFIG_RAYER_SPI), yes) |
| 546 | FEATURE_CFLAGS += -D'CONFIG_RAYER_SPI=1' |
| 547 | PROGRAMMER_OBJS += rayer_spi.o |
| 548 | # Actually, NEED_PCI is wrong. NEED_IOPORT_ACCESS would be more correct. |
| 549 | NEED_PCI := yes |
| 550 | endif |
| 551 | |
Virgil-Adrian Teaca | da7c545 | 2012-04-30 23:11:06 +0000 | [diff] [blame] | 552 | ifeq ($(CONFIG_PONY_SPI), yes) |
| 553 | FEATURE_CFLAGS += -D'CONFIG_PONY_SPI=1' |
| 554 | PROGRAMMER_OBJS += pony_spi.o |
| 555 | NEED_SERIAL := yes |
| 556 | endif |
| 557 | |
Carl-Daniel Hailfinger | 547872b | 2009-09-28 13:15:16 +0000 | [diff] [blame] | 558 | ifeq ($(CONFIG_BITBANG_SPI), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 559 | FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 560 | PROGRAMMER_OBJS += bitbang_spi.o |
Carl-Daniel Hailfinger | 547872b | 2009-09-28 13:15:16 +0000 | [diff] [blame] | 561 | endif |
| 562 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 563 | ifeq ($(CONFIG_NIC3COM), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 564 | FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 565 | PROGRAMMER_OBJS += nic3com.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 566 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 567 | endif |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 568 | |
Uwe Hermann | 2bc98f6 | 2009-09-30 18:29:55 +0000 | [diff] [blame] | 569 | ifeq ($(CONFIG_GFXNVIDIA), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 570 | FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 571 | PROGRAMMER_OBJS += gfxnvidia.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 572 | NEED_PCI := yes |
Uwe Hermann | 2bc98f6 | 2009-09-30 18:29:55 +0000 | [diff] [blame] | 573 | endif |
| 574 | |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 575 | ifeq ($(CONFIG_SATASII), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 576 | FEATURE_CFLAGS += -D'CONFIG_SATASII=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 577 | PROGRAMMER_OBJS += satasii.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 578 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 579 | endif |
| 580 | |
Uwe Hermann | ddd5c9e | 2010-02-21 21:17:00 +0000 | [diff] [blame] | 581 | ifeq ($(CONFIG_ATAHPT), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 582 | FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1' |
Uwe Hermann | ddd5c9e | 2010-02-21 21:17:00 +0000 | [diff] [blame] | 583 | PROGRAMMER_OBJS += atahpt.o |
| 584 | NEED_PCI := yes |
| 585 | endif |
| 586 | |
Jonathan Kollasch | 7f0f3fa | 2014-06-01 10:26:23 +0000 | [diff] [blame] | 587 | ifeq ($(CONFIG_ATAVIA), yes) |
| 588 | FEATURE_CFLAGS += -D'CONFIG_ATAVIA=1' |
| 589 | PROGRAMMER_OBJS += atavia.o |
| 590 | NEED_PCI := yes |
| 591 | endif |
| 592 | |
Kyösti Mälkki | 72d42f8 | 2014-06-01 23:48:31 +0000 | [diff] [blame] | 593 | ifeq ($(CONFIG_IT8212), yes) |
| 594 | FEATURE_CFLAGS += -D'CONFIG_IT8212=1' |
| 595 | PROGRAMMER_OBJS += it8212.o |
| 596 | NEED_PCI := yes |
| 597 | endif |
| 598 | |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 599 | ifeq ($(CONFIG_FT2232_SPI), yes) |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 600 | # This is a totally ugly hack. |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 601 | 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] | 602 | NEED_FTDI := yes |
| 603 | PROGRAMMER_OBJS += ft2232_spi.o |
| 604 | endif |
| 605 | |
| 606 | ifeq ($(CONFIG_USBBLASTER_SPI), yes) |
| 607 | # This is a totally ugly hack. |
| 608 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_USBBLASTER_SPI=1'") |
| 609 | NEED_FTDI := yes |
| 610 | PROGRAMMER_OBJS += usbblaster_spi.o |
| 611 | endif |
| 612 | |
| 613 | ifeq ($(NEED_FTDI), yes) |
| 614 | 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] | 615 | 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] | 616 | 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] | 617 | # We can't set NEED_USB here because that would transform libftdi auto-enabling |
| 618 | # 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] | 619 | endif |
| 620 | |
| 621 | ifeq ($(CONFIG_DUMMY), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 622 | FEATURE_CFLAGS += -D'CONFIG_DUMMY=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 623 | PROGRAMMER_OBJS += dummyflasher.o |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 624 | endif |
| 625 | |
| 626 | ifeq ($(CONFIG_DRKAISER), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 627 | FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 628 | PROGRAMMER_OBJS += drkaiser.o |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 629 | NEED_PCI := yes |
Carl-Daniel Hailfinger | 4740c6f | 2009-09-16 10:09:21 +0000 | [diff] [blame] | 630 | endif |
Carl-Daniel Hailfinger | 6be7411 | 2009-08-12 16:17:41 +0000 | [diff] [blame] | 631 | |
Joerg Fischer | 5665ef3 | 2010-05-21 21:54:07 +0000 | [diff] [blame] | 632 | ifeq ($(CONFIG_NICREALTEK), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 633 | FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1' |
Joerg Fischer | 5665ef3 | 2010-05-21 21:54:07 +0000 | [diff] [blame] | 634 | PROGRAMMER_OBJS += nicrealtek.o |
| 635 | NEED_PCI := yes |
| 636 | endif |
| 637 | |
Andrew Morgan | c29c2e7 | 2010-06-07 22:37:54 +0000 | [diff] [blame] | 638 | ifeq ($(CONFIG_NICNATSEMI), yes) |
| 639 | FEATURE_CFLAGS += -D'CONFIG_NICNATSEMI=1' |
| 640 | PROGRAMMER_OBJS += nicnatsemi.o |
| 641 | NEED_PCI := yes |
| 642 | endif |
| 643 | |
Carl-Daniel Hailfinger | b713d2e | 2011-05-08 00:24:18 +0000 | [diff] [blame] | 644 | ifeq ($(CONFIG_NICINTEL), yes) |
| 645 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL=1' |
| 646 | PROGRAMMER_OBJS += nicintel.o |
| 647 | NEED_PCI := yes |
| 648 | endif |
| 649 | |
Idwer Vollering | 004f4b7 | 2010-09-03 18:21:21 +0000 | [diff] [blame] | 650 | ifeq ($(CONFIG_NICINTEL_SPI), yes) |
| 651 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL_SPI=1' |
| 652 | PROGRAMMER_OBJS += nicintel_spi.o |
| 653 | NEED_PCI := yes |
| 654 | endif |
| 655 | |
Ricardo Ribalda Delgado | 2a41f0a | 2014-07-28 20:35:21 +0000 | [diff] [blame] | 656 | ifeq ($(CONFIG_NICINTEL_EEPROM), yes) |
| 657 | FEATURE_CFLAGS += -D'CONFIG_NICINTEL_EEPROM=1' |
| 658 | PROGRAMMER_OBJS += nicintel_eeprom.o |
| 659 | NEED_PCI := yes |
| 660 | endif |
| 661 | |
Mark Marshall | 90021f2 | 2010-12-03 14:48:11 +0000 | [diff] [blame] | 662 | ifeq ($(CONFIG_OGP_SPI), yes) |
| 663 | FEATURE_CFLAGS += -D'CONFIG_OGP_SPI=1' |
| 664 | PROGRAMMER_OBJS += ogp_spi.o |
| 665 | NEED_PCI := yes |
| 666 | endif |
| 667 | |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 668 | ifeq ($(CONFIG_BUSPIRATE_SPI), yes) |
| 669 | FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 670 | PROGRAMMER_OBJS += buspirate_spi.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 671 | NEED_SERIAL := yes |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 672 | endif |
| 673 | |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 674 | ifeq ($(CONFIG_DEDIPROG), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 675 | FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 676 | PROGRAMMER_OBJS += dediprog.o |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 677 | NEED_USB := yes |
Carl-Daniel Hailfinger | d38fac8 | 2010-01-19 11:15:48 +0000 | [diff] [blame] | 678 | endif |
| 679 | |
Carl-Daniel Hailfinger | 9a1105c | 2011-02-04 21:37:59 +0000 | [diff] [blame] | 680 | ifeq ($(CONFIG_SATAMV), yes) |
| 681 | FEATURE_CFLAGS += -D'CONFIG_SATAMV=1' |
| 682 | PROGRAMMER_OBJS += satamv.o |
| 683 | NEED_PCI := yes |
| 684 | endif |
| 685 | |
Carl-Daniel Hailfinger | 8541d23 | 2012-02-16 21:00:27 +0000 | [diff] [blame] | 686 | ifeq ($(CONFIG_LINUX_SPI), yes) |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 687 | # This is a totally ugly hack. |
| 688 | 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] | 689 | PROGRAMMER_OBJS += linux_spi.o |
| 690 | endif |
| 691 | |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 692 | ifeq ($(CONFIG_MSTARDDC_SPI), yes) |
| 693 | # This is a totally ugly hack. |
| 694 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "LINUX_I2C_SUPPORT := yes" .features && printf "%s" "-D'CONFIG_MSTARDDC_SPI=1'") |
| 695 | NEED_LINUX_I2C := yes |
| 696 | PROGRAMMER_OBJS += mstarddc_spi.o |
| 697 | endif |
| 698 | |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 699 | ifeq ($(NEED_SERIAL), yes) |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 700 | LIB_OBJS += serial.o |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 701 | endif |
| 702 | |
| 703 | ifeq ($(NEED_NET), yes) |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 704 | ifeq ($(TARGET_OS), SunOS) |
Carl-Daniel Hailfinger | 5bdf298 | 2010-06-14 12:42:05 +0000 | [diff] [blame] | 705 | LIBS += -lsocket |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 706 | endif |
Carl-Daniel Hailfinger | e51ea10 | 2009-11-23 19:20:11 +0000 | [diff] [blame] | 707 | endif |
| 708 | |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 709 | ifeq ($(NEED_PCI), yes) |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 710 | CHECK_LIBPCI = yes |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 711 | FEATURE_CFLAGS += -D'NEED_PCI=1' |
Carl-Daniel Hailfinger | fb0828f | 2010-02-12 19:35:25 +0000 | [diff] [blame] | 712 | PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 713 | ifeq ($(TARGET_OS), NetBSD) |
Carl-Daniel Hailfinger | 460b282 | 2010-06-04 23:24:57 +0000 | [diff] [blame] | 714 | # 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] | 715 | PCILIBS += -lpciutils -lpci |
Carl-Daniel Hailfinger | 460b282 | 2010-06-04 23:24:57 +0000 | [diff] [blame] | 716 | # For (i386|x86_64)_iopl(2). |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 717 | PCILIBS += -l$(shell uname -p) |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 718 | else |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 719 | |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 720 | PCILIBS += -lpci |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 721 | |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 722 | ifeq ($(TARGET_OS), OpenBSD) |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 723 | # For (i386|amd64)_iopl(2). |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 724 | PCILIBS += -l$(shell uname -m) |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 725 | else |
| 726 | ifeq ($(TARGET_OS), Darwin) |
| 727 | # DirectHW framework can be found in the DirectHW library. |
Stefan Tauner | e34e3e8 | 2013-01-01 00:06:51 +0000 | [diff] [blame] | 728 | PCILIBS += -framework IOKit -framework DirectHW |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 729 | endif |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 730 | endif |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 731 | endif |
Carl-Daniel Hailfinger | 66ef4e5 | 2009-12-13 22:28:00 +0000 | [diff] [blame] | 732 | endif |
| 733 | |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 734 | ifeq ($(NEED_USB), yes) |
| 735 | CHECK_LIBUSB0 = yes |
| 736 | FEATURE_CFLAGS += -D'NEED_USB=1' |
| 737 | USBLIBS := $(shell pkg-config --libs libusb 2>/dev/null || printf "%s" "-lusb") |
| 738 | endif |
| 739 | |
Carl-Daniel Hailfinger | 9c8476b | 2009-09-16 12:19:03 +0000 | [diff] [blame] | 740 | ifeq ($(CONFIG_PRINT_WIKI), yes) |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 741 | FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1' |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 742 | CLI_OBJS += print_wiki.o |
Carl-Daniel Hailfinger | 9c8476b | 2009-09-16 12:19:03 +0000 | [diff] [blame] | 743 | endif |
| 744 | |
Carl-Daniel Hailfinger | 132e2ec | 2010-03-27 16:36:40 +0000 | [diff] [blame] | 745 | FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "UTSNAME := yes" .features && printf "%s" "-D'HAVE_UTSNAME=1'") |
| 746 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 747 | # We could use PULLED_IN_LIBS, but that would be ugly. |
| 748 | FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%s" "-lz") |
| 749 | |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 750 | LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS) |
Stefan Tauner | d94d25d | 2012-07-28 03:17:15 +0000 | [diff] [blame] | 751 | OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS) |
Sean Nelson | 5d13464 | 2009-12-24 16:54:21 +0000 | [diff] [blame] | 752 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 753 | all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8 |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 754 | ifeq ($(ARCH), x86) |
| 755 | @+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX) |
| 756 | endif |
| 757 | |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 758 | $(PROGRAM)$(EXEC_SUFFIX): $(OBJS) |
Carl-Daniel Hailfinger | 11990da | 2013-07-13 23:21:05 +0000 | [diff] [blame] | 759 | $(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] | 760 | |
Patrick Georgi | 97bc95c | 2011-03-08 07:17:44 +0000 | [diff] [blame] | 761 | libflashrom.a: $(LIBFLASHROM_OBJS) |
| 762 | $(AR) rcs $@ $^ |
| 763 | $(RANLIB) $@ |
| 764 | |
Carl-Daniel Hailfinger | 8ef7dce | 2009-07-10 20:19:48 +0000 | [diff] [blame] | 765 | # TAROPTIONS reduces information leakage from the packager's system. |
| 766 | # If other tar programs support command line arguments for setting uid/gid of |
| 767 | # stored files, they can be handled here as well. |
| 768 | 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] | 769 | |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 770 | %.o: %.c .features |
Carl-Daniel Hailfinger | a8da224 | 2012-08-15 23:06:32 +0000 | [diff] [blame] | 771 | $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $< |
Clark Rawlins | 02016f7 | 2008-02-14 23:22:20 +0000 | [diff] [blame] | 772 | |
Carl-Daniel Hailfinger | a0020df | 2010-05-30 22:35:14 +0000 | [diff] [blame] | 773 | # Make sure to add all names of generated binaries here. |
| 774 | # This includes all frontends and libflashrom. |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 775 | # 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] | 776 | clean: |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 777 | rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8 |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 778 | @+$(MAKE) -C util/ich_descriptors_tool/ clean |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 779 | |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 780 | distclean: clean |
Stefan Reinauer | e2f0158 | 2010-06-07 11:08:07 +0000 | [diff] [blame] | 781 | rm -f .features .libdeps |
Christian Ruppert | db9d9f4 | 2009-05-14 14:17:07 +0000 | [diff] [blame] | 782 | |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 783 | strip: $(PROGRAM)$(EXEC_SUFFIX) |
| 784 | $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX) |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 785 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 786 | # to define test programs we use verbatim variables, which get exported |
| 787 | # to environment variables and are referenced with $$<varname> later |
| 788 | |
| 789 | define COMPILER_TEST |
| 790 | int main(int argc, char **argv) |
| 791 | { |
| 792 | (void) argc; |
| 793 | (void) argv; |
| 794 | return 0; |
| 795 | } |
| 796 | endef |
| 797 | export COMPILER_TEST |
| 798 | |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 799 | compiler: featuresavailable |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 800 | @printf "Checking for a C compiler... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 801 | @echo "$$COMPILER_TEST" > .test.c |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 802 | @$(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] | 803 | echo "found." || ( echo "not found."; \ |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 804 | rm -f .test.c .test$(EXEC_SUFFIX); exit 1) |
| 805 | @rm -f .test.c .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 806 | @printf "Target arch is " |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 807 | @# FreeBSD wc will output extraneous whitespace. |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 808 | @echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ |
Carl-Daniel Hailfinger | 91199a1 | 2011-07-07 06:59:18 +0000 | [diff] [blame] | 809 | ( echo "unknown. Aborting."; exit 1) |
| 810 | @printf "%s\n" '$(ARCH)' |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 811 | @printf "Target OS is " |
| 812 | @# FreeBSD wc will output extraneous whitespace. |
| 813 | @echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \ |
| 814 | ( echo "unknown. Aborting."; exit 1) |
| 815 | @printf "%s\n" '$(TARGET_OS)' |
Stefan Tauner | d6c17f6 | 2013-09-12 14:04:31 +0000 | [diff] [blame] | 816 | ifeq ($(TARGET_OS), libpayload) |
| 817 | @$(CC) --version 2>&1 | grep -q coreboot || \ |
| 818 | ( echo "Warning: It seems you are not using coreboot's reference compiler."; \ |
| 819 | echo "This might work but usually does not, please beware." ) |
| 820 | endif |
Carl-Daniel Hailfinger | 4cb7a96 | 2009-06-16 09:31:51 +0000 | [diff] [blame] | 821 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 822 | define LIBPCI_TEST |
| 823 | /* Avoid a failing test due to libpci header symbol shadowing breakage */ |
| 824 | #define index shadow_workaround_index |
Stefan Tauner | 8d21ff1 | 2015-01-10 09:33:06 +0000 | [diff] [blame] | 825 | #if !defined __NetBSD__ |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 826 | #include <pci/pci.h> |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 827 | #else |
| 828 | #include <pciutils/pci.h> |
| 829 | #endif |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 830 | struct pci_access *pacc; |
| 831 | int main(int argc, char **argv) |
| 832 | { |
| 833 | (void) argc; |
| 834 | (void) argv; |
| 835 | pacc = pci_alloc(); |
| 836 | return 0; |
| 837 | } |
| 838 | endef |
| 839 | export LIBPCI_TEST |
| 840 | |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 841 | define LIBUSB0_TEST |
| 842 | #include <usb.h> |
| 843 | int main(int argc, char **argv) |
| 844 | { |
| 845 | (void) argc; |
| 846 | (void) argv; |
| 847 | usb_init(); |
| 848 | return 0; |
| 849 | } |
| 850 | endef |
| 851 | export LIBUSB0_TEST |
| 852 | |
| 853 | hwlibs: compiler |
| 854 | @printf "" > .libdeps |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 855 | ifeq ($(CHECK_LIBPCI), yes) |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 856 | @printf "Checking for libpci headers... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 857 | @echo "$$LIBPCI_TEST" > .test.c |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 858 | @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 859 | echo "found." || ( echo "not found."; echo; \ |
| 860 | echo "Please install libpci headers (package pciutils-devel)."; \ |
| 861 | echo "See README for more information."; echo; \ |
| 862 | rm -f .test.c .test.o; exit 1) |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 863 | @printf "Checking if libpci is present and sufficient... " |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 864 | @$(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] | 865 | echo "yes." || ( echo "no."; \ |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 866 | printf "Checking if libz+libpci are present and sufficient..."; \ |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 867 | $(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] | 868 | ( echo "yes."; echo "NEEDLIBZ := yes" > .libdeps ) || ( echo "no."; echo; \ |
Carl-Daniel Hailfinger | 9979eac | 2010-03-22 12:29:45 +0000 | [diff] [blame] | 869 | echo "Please install libpci (package pciutils) and/or libz."; \ |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 870 | echo "See README for more information."; echo; \ |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 871 | rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) ) |
| 872 | @rm -f .test.c .test.o .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | e7a39bf | 2012-11-20 21:06:16 +0000 | [diff] [blame] | 873 | endif |
| 874 | ifeq ($(CHECK_LIBUSB0), yes) |
| 875 | @printf "Checking for libusb-0.1/libusb-compat headers... " |
| 876 | @echo "$$LIBUSB0_TEST" > .test.c |
| 877 | @$(CC) -c $(CPPFLAGS) $(CFLAGS) .test.c -o .test.o >/dev/null && \ |
| 878 | echo "found." || ( echo "not found."; echo; \ |
| 879 | echo "Please install libusb-0.1 headers or libusb-compat headers."; \ |
| 880 | echo "See README for more information."; echo; \ |
| 881 | rm -f .test.c .test.o; exit 1) |
| 882 | @printf "Checking if libusb-0.1 is usable... " |
Carl-Daniel Hailfinger | 26148ae | 2012-11-29 22:22:04 +0000 | [diff] [blame] | 883 | @$(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] | 884 | echo "yes." || ( echo "no."; \ |
| 885 | echo "Please install libusb-0.1 or libusb-compat."; \ |
| 886 | echo "See README for more information."; echo; \ |
| 887 | rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) |
| 888 | @rm -f .test.c .test.o .test$(EXEC_SUFFIX) |
Carl-Daniel Hailfinger | 8a59ff0 | 2009-12-24 03:33:11 +0000 | [diff] [blame] | 889 | endif |
Stefan Reinauer | 53e9625 | 2005-12-01 16:19:24 +0000 | [diff] [blame] | 890 | |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 891 | .features: features |
| 892 | |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 893 | # If a user does not explicitly request a non-working feature, we should |
| 894 | # silently disable it. However, if a non-working (does not compile) feature |
| 895 | # 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] | 896 | # 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] | 897 | featuresavailable: |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 898 | ifeq ($(PROGRAMMER_OBJS),) |
| 899 | @echo "You have to enable at least one programmer driver!" |
| 900 | @false |
| 901 | endif |
| 902 | ifneq ($(UNSUPPORTED_FEATURES), ) |
Carl-Daniel Hailfinger | 5d3fcb9 | 2010-06-14 18:40:59 +0000 | [diff] [blame] | 903 | @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)" |
| 904 | @false |
| 905 | endif |
| 906 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 907 | define FTDI_TEST |
| 908 | #include <ftdi.h> |
| 909 | struct ftdi_context *ftdic = NULL; |
| 910 | int main(int argc, char **argv) |
| 911 | { |
| 912 | (void) argc; |
| 913 | (void) argv; |
| 914 | return ftdi_init(ftdic); |
| 915 | } |
| 916 | endef |
| 917 | export FTDI_TEST |
| 918 | |
Ilya A. Volynets-Evenbakh | 2c714ab | 2012-09-26 00:47:09 +0000 | [diff] [blame] | 919 | define FTDI_232H_TEST |
| 920 | #include <ftdi.h> |
| 921 | enum ftdi_chip_type type = TYPE_232H; |
| 922 | endef |
| 923 | export FTDI_232H_TEST |
| 924 | |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 925 | define UTSNAME_TEST |
| 926 | #include <sys/utsname.h> |
| 927 | struct utsname osinfo; |
| 928 | int main(int argc, char **argv) |
| 929 | { |
| 930 | (void) argc; |
| 931 | (void) argv; |
| 932 | uname (&osinfo); |
| 933 | return 0; |
| 934 | } |
| 935 | endef |
| 936 | export UTSNAME_TEST |
| 937 | |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 938 | define LINUX_SPI_TEST |
| 939 | #include <linux/types.h> |
| 940 | #include <linux/spi/spidev.h> |
| 941 | |
| 942 | int main(int argc, char **argv) |
| 943 | { |
| 944 | (void) argc; |
| 945 | (void) argv; |
| 946 | return 0; |
| 947 | } |
| 948 | endef |
| 949 | export LINUX_SPI_TEST |
| 950 | |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 951 | define LINUX_I2C_TEST |
| 952 | #include <linux/i2c-dev.h> |
| 953 | #include <linux/i2c.h> |
| 954 | |
| 955 | int main(int argc, char **argv) |
| 956 | { |
| 957 | (void) argc; |
| 958 | (void) argv; |
| 959 | return 0; |
| 960 | } |
| 961 | endef |
| 962 | export LINUX_I2C_TEST |
| 963 | |
Carl-Daniel Hailfinger | b18ecbc | 2009-06-19 14:20:34 +0000 | [diff] [blame] | 964 | features: compiler |
| 965 | @echo "FEATURES := yes" > .features.tmp |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 966 | ifeq ($(NEED_FTDI), yes) |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 967 | @printf "Checking for FTDI support... " |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 968 | @echo "$$FTDI_TEST" > .featuretest.c |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 969 | @$(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] | 970 | ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) || \ |
| 971 | ( echo "not found."; echo "FTDISUPPORT := no" >> .features.tmp ) |
Ilya A. Volynets-Evenbakh | 2c714ab | 2012-09-26 00:47:09 +0000 | [diff] [blame] | 972 | @printf "Checking for FT232H support in libftdi... " |
| 973 | @echo "$$FTDI_232H_TEST" >> .featuretest.c |
| 974 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \ |
| 975 | ( echo "found."; echo "FT232H := yes" >> .features.tmp ) || \ |
| 976 | ( echo "not found."; echo "FT232H := no" >> .features.tmp ) |
Carl-Daniel Hailfinger | 8a59ff0 | 2009-12-24 03:33:11 +0000 | [diff] [blame] | 977 | endif |
Stefan Tauner | 8868db3 | 2012-03-13 00:18:19 +0000 | [diff] [blame] | 978 | ifeq ($(CONFIG_LINUX_SPI), yes) |
| 979 | @printf "Checking if Linux SPI headers are present... " |
| 980 | @echo "$$LINUX_SPI_TEST" > .featuretest.c |
| 981 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 982 | ( echo "yes."; echo "LINUX_SPI_SUPPORT := yes" >> .features.tmp ) || \ |
| 983 | ( echo "no."; echo "LINUX_SPI_SUPPORT := no" >> .features.tmp ) |
| 984 | endif |
Alexandre Boeglin | 80e6471 | 2014-12-20 20:25:19 +0000 | [diff] [blame] | 985 | ifeq ($(NEED_LINUX_I2C), yes) |
| 986 | @printf "Checking if Linux I2C headers are present... " |
| 987 | @echo "$$LINUX_I2C_TEST" > .featuretest.c |
| 988 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 989 | ( echo "yes."; echo "LINUX_I2C_SUPPORT := yes" >> .features.tmp ) || \ |
| 990 | ( echo "no."; echo "LINUX_I2C_SUPPORT := no" >> .features.tmp ) |
| 991 | endif |
Stefan Tauner | 5678708 | 2011-08-18 02:27:19 +0000 | [diff] [blame] | 992 | @printf "Checking for utsname support... " |
| 993 | @echo "$$UTSNAME_TEST" > .featuretest.c |
| 994 | @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \ |
| 995 | ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) || \ |
| 996 | ( echo "not found."; echo "UTSNAME := no" >> .features.tmp ) |
| 997 | @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features |
| 998 | @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX) |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 999 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1000 | $(PROGRAM).8: $(PROGRAM).8.tmpl |
Stefan Tauner | d5ff845 | 2015-01-10 09:32:07 +0000 | [diff] [blame] | 1001 | @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] | 1002 | |
| 1003 | install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8 |
Uwe Hermann | c2a9c9c | 2009-05-14 14:51:14 +0000 | [diff] [blame] | 1004 | mkdir -p $(DESTDIR)$(PREFIX)/sbin |
Uwe Hermann | 56b2cb0 | 2009-05-21 15:59:58 +0000 | [diff] [blame] | 1005 | mkdir -p $(DESTDIR)$(MANDIR)/man8 |
Carl-Daniel Hailfinger | ddbab71 | 2010-06-14 14:44:08 +0000 | [diff] [blame] | 1006 | $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin |
Uwe Hermann | 56b2cb0 | 2009-05-21 15:59:58 +0000 | [diff] [blame] | 1007 | $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8 |
Uwe Hermann | c113b57 | 2006-12-14 00:59:41 +0000 | [diff] [blame] | 1008 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1009 | export: $(PROGRAM).8 |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1010 | @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1011 | @svn export -r BASE . $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1012 | @sed "s/^SVNVERSION.*/SVNVERSION := $(SVNVERSION)/" Makefile >$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1013 | @cp $(PROGRAM).8 "$(EXPORTDIR)/flashrom-$(RELEASENAME)/$(PROGRAM).8" |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1014 | @LC_ALL=C svn log >$(EXPORTDIR)/flashrom-$(RELEASENAME)/ChangeLog |
| 1015 | @echo Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/ |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 1016 | |
| 1017 | tarball: export |
Carl-Daniel Hailfinger | 48e5e09 | 2009-08-31 16:25:08 +0000 | [diff] [blame] | 1018 | @tar cjf $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2 -C $(EXPORTDIR)/ $(TAROPTIONS) flashrom-$(RELEASENAME)/ |
| 1019 | @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME) |
| 1020 | @echo Created $(EXPORTDIR)/flashrom-$(RELEASENAME).tar.bz2 |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 1021 | |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 1022 | djgpp-dos: clean |
Carl-Daniel Hailfinger | 33a65a0 | 2011-12-20 00:51:44 +0000 | [diff] [blame] | 1023 | make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip |
| 1024 | libpayload: clean |
| 1025 | 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] | 1026 | |
Joerg Mayer | a93d9dc | 2013-08-29 00:38:19 +0000 | [diff] [blame] | 1027 | .PHONY: all install clean distclean compiler hwlibs features export tarball dos featuresavailable |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 1028 | |
Stefan Reinauer | e2f0158 | 2010-06-07 11:08:07 +0000 | [diff] [blame] | 1029 | -include $(OBJS:.o=.d) |