OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / lib / libnvram / Makefile
1 #
2 # (C) Copyright 2002
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # See file CREDITS for list of people who contributed to this
6 # project.
7 #
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.
12 #
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.
17 #
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,
21 # MA 02111-1307 USA
22 #
23
24 CFLAGS += -DUSE_HOSTCC=1
25
26 LIBNVRAM=libnvram.a
27 LIBNVRAM_SHARED=libnvram.so
28 LIBNVRAM_SHARED_FULLNAME=libnvram-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
29
30 OBJS    := nvram_env.o
31 HEADERS := nvram_env.h nvram.h
32
33 # do we need to use the original nvram mechanism or emulate it under flatfsd ?
34
35 ifdef CONFIG_USER_FLATFSD_FLATFSD
36 CFLAGS += -DEMULATE_NVRAM=1
37 else
38 OBJS    += crc32.o flash_api.o
39 HEADERS += flash_api.h
40 endif
41
42 all:    $(LIBNVRAM)
43
44 $(OBJS): %.o : %.c
45         $(CC) $(CFLAGS) -c $< -o $@
46         $(STRIPTOOL) -x -R .note -R .comment $*.o
47
48 shared: all
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)
58
59 $(LIBNVRAM) ar-target: $(OBJS)
60         $(AR) $(ARFLAGS) $(LIBNVRAM) $(OBJS)
61
62 $(OBJS): $(HEADERS) Makefile
63
64 romfs:
65
66 clean:
67         $(RM) *.[oa] $(LIBNVRAM_SHARED)* $(LIBNVRAM_SHARED_FULLNAME)*
68