2002-07-21 02:56:22 +08:00
|
|
|
#
|
2006-09-02 01:49:50 +08:00
|
|
|
# (C) Copyright 2000-2006
|
2002-07-21 02:56:22 +08: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 22:48:07 +08:00
|
|
|
LIB = $(obj)libgeneric.o
|
2002-07-21 02:56:22 +08:00
|
|
|
|
2011-07-13 13:11:06 +08:00
|
|
|
ifndef CONFIG_SPL_BUILD
|
2008-12-14 07:20:28 +08:00
|
|
|
COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
|
2011-10-12 15:31:59 +08:00
|
|
|
COBJS-$(CONFIG_BCH) += bch.o
|
2012-04-05 19:54:58 +08:00
|
|
|
COBJS-$(CONFIG_AES) += aes.o
|
2009-02-06 10:04:50 +08: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-10 05:17:50 +08:00
|
|
|
COBJS-$(CONFIG_USB_TTY) += circbuf.o
|
2011-01-11 09:38:20 +08:00
|
|
|
COBJS-y += crc7.o
|
2008-08-29 07:18:11 +08:00
|
|
|
COBJS-y += crc16.o
|
2007-09-24 23:05:30 +08:00
|
|
|
COBJS-y += crc32.o
|
|
|
|
COBJS-y += display_options.o
|
2010-06-12 06:19:46 +08:00
|
|
|
COBJS-y += errno.o
|
2011-10-25 03:15:32 +08:00
|
|
|
COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
|
2012-01-17 16:20:51 +08:00
|
|
|
COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
|
2010-01-22 08:30:36 +08: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 19:17:12 +08:00
|
|
|
COBJS-y += hashtable.o
|
2009-11-04 00:35:59 +08:00
|
|
|
COBJS-$(CONFIG_LMB) += lmb.o
|
2007-09-24 23:05:30 +08:00
|
|
|
COBJS-y += ldiv.o
|
2008-03-14 23:22:34 +08:00
|
|
|
COBJS-$(CONFIG_MD5) += md5.o
|
2010-01-03 15:33:58 +08:00
|
|
|
COBJS-y += net_utils.o
|
2010-06-13 07:45:10 +08:00
|
|
|
COBJS-y += qsort.o
|
2010-01-18 10:08:00 +08:00
|
|
|
COBJS-$(CONFIG_SHA1) += sha1.o
|
2008-06-07 18:29:52 +08:00
|
|
|
COBJS-$(CONFIG_SHA256) += sha256.o
|
2008-08-18 19:41:27 +08:00
|
|
|
COBJS-y += strmhz.o
|
2011-07-13 13:11:06 +08:00
|
|
|
COBJS-$(CONFIG_RBTREE) += rbtree.o
|
2011-12-09 17:47:34 +08:00
|
|
|
else
|
|
|
|
COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += display_options.o
|
2011-07-13 13:11:06 +08:00
|
|
|
endif
|
|
|
|
|
2012-01-31 20:03:57 +08:00
|
|
|
ifdef CONFIG_SPL_BUILD
|
|
|
|
COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
|
|
|
|
endif
|
2011-07-13 13:11:06 +08:00
|
|
|
COBJS-y += ctype.o
|
|
|
|
COBJS-y += div64.o
|
|
|
|
COBJS-y += string.o
|
2009-11-24 21:09:21 +08:00
|
|
|
COBJS-y += time.o
|
2011-08-23 19:06:56 +08:00
|
|
|
COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
|
2007-09-24 23:05:30 +08:00
|
|
|
COBJS-y += vsprintf.o
|
2012-06-05 19:33:14 +08:00
|
|
|
COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
|
2007-09-24 23:05:30 +08:00
|
|
|
|
|
|
|
COBJS := $(COBJS-y)
|
2008-05-20 22:00:29 +08:00
|
|
|
SRCS := $(COBJS:.o=.c)
|
2006-09-02 01:49:50 +08:00
|
|
|
OBJS := $(addprefix $(obj),$(COBJS))
|
2002-07-21 02:56:22 +08:00
|
|
|
|
2006-09-02 01:49:50 +08:00
|
|
|
$(LIB): $(obj).depend $(OBJS)
|
2010-11-05 22:48:07 +08:00
|
|
|
$(call cmd_link_o_target, $(OBJS))
|
2002-07-21 02:56:22 +08:00
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
2006-09-02 01:49:50 +08:00
|
|
|
# defines $(obj).depend target
|
|
|
|
include $(SRCTREE)/rules.mk
|
2002-07-21 02:56:22 +08:00
|
|
|
|
2006-09-02 01:49:50 +08:00
|
|
|
sinclude $(obj).depend
|
2002-07-21 02:56:22 +08:00
|
|
|
|
|
|
|
#########################################################################
|