2012-03-09 10:53:52 +01:00
|
|
|
##
|
|
|
|
## Integration of nvramtool into the coreboot build system
|
|
|
|
##
|
|
|
|
## (C) 2005-2008 coresystems GmbH
|
|
|
|
## written by Stefan Reinauer <stepan@coresystems.de>
|
|
|
|
## (C) 2012 secunet Security Networks AG
|
|
|
|
##
|
|
|
|
## This program is free software; you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published by
|
|
|
|
## the Free Software Foundation; version 2 of the License.
|
|
|
|
##
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
##
|
|
|
|
|
|
|
|
OS_ARCH = $(shell uname)
|
|
|
|
NVRAMTOOLFLAGS := -I$(top)/util/nvramtool
|
|
|
|
ifeq ($(OS_ARCH), NetBSD)
|
2012-04-27 16:46:55 +02:00
|
|
|
NVRAMTOOLLDLFLAGS = -l$(shell uname -p)
|
|
|
|
endif
|
2012-09-28 10:02:35 +02:00
|
|
|
ifeq ($(shell uname -o 2>/dev/null), Cygwin)
|
2012-04-27 16:46:55 +02:00
|
|
|
NVRAMTOOLFLAGS += -O2 -g -Wall -W -D__GLIBC__
|
|
|
|
HOSTCFLAGS =
|
2012-03-09 10:53:52 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
nvramtoolobj :=
|
|
|
|
nvramtoolobj += cli/nvramtool.o cli/opts.o
|
|
|
|
nvramtoolobj += cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o
|
2012-04-14 11:55:13 +02:00
|
|
|
nvramtoolobj += hexdump.o input_file.o layout.o accessors/layout-common.o accessors/layout-text.o accessors/layout-bin.o lbtable.o
|
2012-05-01 12:10:45 +02:00
|
|
|
nvramtoolobj += reg_expr.o cbfs.o accessors/cmos-mem.o
|
2012-03-09 10:53:52 +01:00
|
|
|
|
2012-10-22 10:41:42 +02:00
|
|
|
ifeq ($(shell uname -s 2>/dev/null | cut -c-7), MINGW32)
|
|
|
|
NVRAMTOOLLDFLAGS += -lregex -lwsock32
|
|
|
|
nvramtoolobj += win32mmap.o
|
|
|
|
endif
|
|
|
|
|
2012-03-09 10:53:52 +01:00
|
|
|
$(objutil)/nvramtool $(objutil)/nvramtool/accessors $(objutil)/nvramtool/cli:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(objutil)/nvramtool/%.o: $(top)/util/nvramtool/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(NVRAMTOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(objutil)/nvramtool/nvramtool: $(objutil)/nvramtool $(objutil)/nvramtool/accessors $(objutil)/nvramtool/cli $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2012-04-27 16:46:55 +02:00
|
|
|
$(HOSTCC) $(NVRAMTOOLFLAGS) -o $@ $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj)) $(NVRAMTOOLLDFLAGS)
|