Merge branch 'support_for_dragino2'
[oweals/u-boot_mod.git] / u-boot / common / Makefile
1 #
2 # (C) Copyright 2004
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 include $(TOPDIR)/config.mk
25
26 LIB     = libcommon.a
27
28 AOBJS   =
29
30 COBJS   = main.o \
31                   cmd_bootm.o \
32                   cmd_boot.o \
33                   cmd_flash.o \
34                   cmd_mem.o \
35                   cmd_custom.o \
36                   cmd_net.o \
37                   cmd_nvedit.o \
38                   command.o \
39                   console.o \
40                   devices.o \
41                   dlmalloc.o \
42                   environment.o \
43                   env_common.o \
44                   env_nowhere.o \
45                   exports.o \
46                   flash.o \
47                   lists.o \
48                   env_flash.o
49
50 OBJS    = $(AOBJS) $(COBJS)
51
52 CPPFLAGS += -I..
53
54 ifeq ($(DUAL_FIRMWAREIMAGE_SUPPORT),1)
55 CFLAGS += -DCONFIG_DUALIMAGE_SUPPORT
56 OBJS += cmd_bdr.o
57 endif
58
59 all:    $(LIB) $(AOBJS)
60
61 $(LIB): .depend $(OBJS)
62         $(AR) crv $@ $(OBJS)
63
64 environment.o: environment.c ../tools/envcrc
65         $(CC) $(AFLAGS) -Wa,--no-warn \
66                 -DENV_CRC=$(shell ../tools/envcrc) \
67                 -c -o $@ environment.c
68
69 ../tools/envcrc:
70         $(MAKE) -C ../tools
71
72 #########################################################################
73
74 .depend:        Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
75                 $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
76
77 sinclude .depend
78
79 #########################################################################