3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 CFLAGS += -DUSE_HOSTCC=1
27 LIBNVRAM_SHARED=libnvram.so
28 LIBNVRAM_SHARED_FULLNAME=libnvram-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
31 HEADERS := nvram_env.h nvram.h
33 # do we need to use the original nvram mechanism or emulate it under flatfsd ?
35 ifdef CONFIG_USER_FLATFSD_FLATFSD
36 CFLAGS += -DEMULATE_NVRAM=1
38 OBJS += crc32.o flash_api.o
39 HEADERS += flash_api.h
45 $(CC) $(CFLAGS) -c $< -o $@
46 $(STRIPTOOL) -x -R .note -R .comment $*.o
49 $(LD) $(LDFLAGS) -soname=$(LIBNVRAM_SHARED).$(MAJOR_VERSION) \
50 -o $(LIBNVRAM_SHARED_FULLNAME) --whole-archive $(LIBNVRAM) \
51 --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
52 -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC);
53 $(INSTALL) -d $(TOPDIR)lib
54 $(RM) $(TOPDIR)lib/$(LIBNVRAM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBNVRAM_SHARED).$(MAJOR_VERSION)
55 $(INSTALL) -m 644 $(LIBNVRAM_SHARED_FULLNAME) $(TOPDIR)lib
56 $(LN) -sf $(LIBNVRAM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBNVRAM_SHARED)
57 $(LN) -sf $(LIBNVRAM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBNVRAM_SHARED).$(MAJOR_VERSION)
59 $(LIBNVRAM) ar-target: $(OBJS)
60 $(AR) $(ARFLAGS) $(LIBNVRAM) $(OBJS)
62 $(OBJS): $(HEADERS) Makefile
67 $(RM) *.[oa] $(LIBNVRAM_SHARED)* $(LIBNVRAM_SHARED_FULLNAME)*