2002-07-20 18:56:22 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2000-2006
|
2002-07-20 18:56:22 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
|
|
|
# See file CREDITS for list of people who contributed to this
|
|
|
|
# project.
|
|
|
|
#
|
|
|
|
# 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; either version 2 of
|
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/config.mk
|
|
|
|
|
2010-11-05 14:48:07 +00:00
|
|
|
LIB = $(obj)libgeneric.o
|
2002-07-20 18:56:22 +00:00
|
|
|
|
2011-07-13 05:11:06 +00:00
|
|
|
ifndef CONFIG_SPL_BUILD
|
2008-12-13 23:20:28 +00:00
|
|
|
COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
|
2011-10-12 07:31:59 +00:00
|
|
|
COBJS-$(CONFIG_BCH) += bch.o
|
2012-04-05 11:54:58 +00:00
|
|
|
COBJS-$(CONFIG_AES) += aes.o
|
2009-02-06 02:04:50 +00:00
|
|
|
COBJS-$(CONFIG_BZIP2) += bzlib.o
|
|
|
|
COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
|
|
|
|
COBJS-$(CONFIG_BZIP2) += bzlib_decompress.o
|
|
|
|
COBJS-$(CONFIG_BZIP2) += bzlib_randtable.o
|
|
|
|
COBJS-$(CONFIG_BZIP2) += bzlib_huffman.o
|
2009-11-09 21:17:50 +00:00
|
|
|
COBJS-$(CONFIG_USB_TTY) += circbuf.o
|
2011-01-11 01:38:20 +00:00
|
|
|
COBJS-y += crc7.o
|
2008-08-28 23:18:11 +00:00
|
|
|
COBJS-y += crc16.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += crc32.o
|
|
|
|
COBJS-y += display_options.o
|
2010-06-11 22:19:46 +00:00
|
|
|
COBJS-y += errno.o
|
2011-10-24 19:15:32 +00:00
|
|
|
COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
|
2012-01-17 08:20:51 +00:00
|
|
|
COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
|
2010-01-22 00:30:36 +00:00
|
|
|
COBJS-$(CONFIG_GZIP) += gunzip.o
|
Add hash table support as base for new environment code
This implementation is based on code from uClibc-0.9.30.3 but was
modified and extended for use within U-Boot.
Major modifications and extensions:
* hsearch() [modified / extended]:
- While the standard version does not make any assumptions about
the type of the stored data objects at all, this implementation
works with NUL terminated strings only.
- Instead of storing just pointers to the original objects, we
create local copies so the caller does not need to care about the
data any more.
- The standard implementation does not provide a way to update an
existing entry. This version will create a new entry or update an
existing one when both "action == ENTER" and "item.data != NULL".
- hsearch_r(): Instead of returning 1 on success, we return the
index into the internal hash table, which is also guaranteed to be
positive. This allows us direct access to the found hash table
slot for example for functions like hdelete().
* hdelete() [added]:
- The standard implementation of hsearch(3) does not provide any way
to delete any entries from the hash table. We extend the code to
do that.
* hexport() [added]:
- Export the data stored in the hash table in linearized form:
Entries are exported as "name=value" strings, separated by an
arbitrary (non-NUL, of course) separator character. This allows to
use this function both when formatting the U-Boot environment for
external storage (using '\0' as separator), but also when using it
for the "printenv" command to print all variables, simply by using
as '\n" as separator. This can also be used for new features like
exporting the environment data as text file, including the option
for later re-import.
- The entries in the result list will be sorted by ascending key
values.
* himport() [added]:
- Import linearized data into hash table. This is the inverse
function to hexport(): it takes a linear list of "name=value"
pairs and creates hash table entries from it.
- Entries without "value", i. e. consisting of only "name" or
"name=", will cause this entry to be deleted from the hash table.
- The "flag" argument can be used to control the behaviour: when
the H_NOCLEAR bit is set, then an existing hash table will kept,
i. e. new data will be added to an existing hash table;
otherwise, old data will be discarded and a new hash table will
be created.
- The separator character for the "name=value" pairs can be
selected, so we both support importing from externally stored
environment data (separated by NUL characters) and from plain text
files (entries separated by newline characters).
- To allow for nicely formatted text input, leading white space
(sequences of SPACE and TAB chars) is ignored, and entries
starting (after removal of any leading white space) with a '#'
character are considered comments and ignored.
- NOTE: this means that a variable name cannot start with a '#'
character.
- When using a non-NUL separator character, backslash is used as
escape character in the value part, allowing for example fo
multi-line values.
- In theory, arbitrary separator characters can be used, but only
'\0' and '\n' have really been tested.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-06-20 11:17:12 +00:00
|
|
|
COBJS-y += hashtable.o
|
2009-11-03 16:35:59 +00:00
|
|
|
COBJS-$(CONFIG_LMB) += lmb.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += ldiv.o
|
2008-03-14 15:22:34 +00:00
|
|
|
COBJS-$(CONFIG_MD5) += md5.o
|
2010-01-03 07:33:58 +00:00
|
|
|
COBJS-y += net_utils.o
|
2010-06-12 23:45:10 +00:00
|
|
|
COBJS-y += qsort.o
|
2010-01-18 02:08:00 +00:00
|
|
|
COBJS-$(CONFIG_SHA1) += sha1.o
|
2008-06-07 10:29:52 +00:00
|
|
|
COBJS-$(CONFIG_SHA256) += sha256.o
|
2008-08-18 11:41:27 +00:00
|
|
|
COBJS-y += strmhz.o
|
2011-07-13 05:11:06 +00:00
|
|
|
COBJS-$(CONFIG_RBTREE) += rbtree.o
|
2011-12-09 09:47:34 +00:00
|
|
|
else
|
|
|
|
COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += display_options.o
|
2011-07-13 05:11:06 +00:00
|
|
|
endif
|
|
|
|
|
2012-01-31 12:03:57 +00:00
|
|
|
ifdef CONFIG_SPL_BUILD
|
|
|
|
COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
|
|
|
|
endif
|
2011-07-13 05:11:06 +00:00
|
|
|
COBJS-y += ctype.o
|
|
|
|
COBJS-y += div64.o
|
|
|
|
COBJS-y += string.o
|
2009-11-24 13:09:21 +00:00
|
|
|
COBJS-y += time.o
|
2011-08-23 11:06:56 +00:00
|
|
|
COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
|
2007-09-24 15:05:30 +00:00
|
|
|
COBJS-y += vsprintf.o
|
2012-06-05 11:33:14 +00:00
|
|
|
COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
|
2012-06-05 11:33:15 +00:00
|
|
|
COBJS-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
|
|
|
|
COBJS-$(CONFIG_CMD_LINK_LOCAL) += rand.o
|
2007-09-24 15:05:30 +00:00
|
|
|
|
2012-06-05 11:33:15 +00:00
|
|
|
COBJS := $(sort $(COBJS-y))
|
2008-05-20 14:00:29 +00:00
|
|
|
SRCS := $(COBJS:.o=.c)
|
2006-09-01 17:49:50 +00:00
|
|
|
OBJS := $(addprefix $(obj),$(COBJS))
|
2002-07-20 18:56:22 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
$(LIB): $(obj).depend $(OBJS)
|
2010-11-05 14:48:07 +00:00
|
|
|
$(call cmd_link_o_target, $(OBJS))
|
2002-07-20 18:56:22 +00:00
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
# defines $(obj).depend target
|
|
|
|
include $(SRCTREE)/rules.mk
|
2002-07-20 18:56:22 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
sinclude $(obj).depend
|
2002-07-20 18:56:22 +00:00
|
|
|
|
|
|
|
#########################################################################
|