]> git.ipfire.org Git - people/ms/u-boot.git/blame - tools/imls/Makefile
Rename lib_generic/ to lib/
[people/ms/u-boot.git] / tools / imls / Makefile
CommitLineData
f578a2da
MS
1#
2# (C) Copyright 2009 Marco Stornelli <marco.stornelli@gmail.com>
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License as
6# published by the Free Software Foundation; either version 2 of
7# the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17# MA 02111-1307 USA
18#
19
20include $(TOPDIR)/config.mk
21
f578a2da
MS
22# Generated executable files
23BIN_FILES-y += imls
24
25# Source files which exist outside the tools/imls directory
78acc472
PT
26EXT_OBJ_FILES-y += lib/crc32.o
27EXT_OBJ_FILES-y += lib/md5.o
28EXT_OBJ_FILES-y += lib/sha1.o
f578a2da
MS
29EXT_OBJ_FILES-y += common/image.o
30
31# Source files located in the tools/imls directory
32OBJ_FILES-y += imls.o
33
34# Flattened device tree objects
35LIBFDT_OBJ_FILES-y += fdt.o
36LIBFDT_OBJ_FILES-y += fdt_ro.o
37LIBFDT_OBJ_FILES-y += fdt_rw.o
38LIBFDT_OBJ_FILES-y += fdt_strerror.o
39LIBFDT_OBJ_FILES-y += fdt_wip.o
40
41# now $(obj) is defined
42SRCS += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c))
43SRCS += $(addprefix $(SRCTREE)/tools/,$(OBJ_FILES-y:.o=.c))
44SRCS += $(addprefix $(SRCTREE)/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c))
45BINS := $(addprefix $(obj),$(sort $(BIN_FILES-y)))
46LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
47
48#
d984fed0 49# Compile for a hosted environment on the target
f578a2da
MS
50# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
51#
d984fed0 52HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
f578a2da
MS
53 -idirafter $(OBJTREE)/include2 \
54 -idirafter $(OBJTREE)/include \
55 -I $(SRCTREE)/libfdt \
56 -I $(SRCTREE)/tools \
57 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES
f578a2da
MS
58
59ifeq ($(MTD_VERSION),old)
d984fed0 60HOSTCPPFLAGS += -DMTD_OLD
f578a2da
MS
61endif
62
63all: $(BINS)
64
65$(obj)imls: $(obj)imls.o $(obj)crc32.o $(obj)image.o $(obj)md5.o \
66 $(obj)sha1.o $(LIBFDT_OBJS)
d984fed0 67 $(CC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
f578a2da
MS
68 $(STRIP) $@
69
70# Some files complain if compiled with -pedantic, use FIT_CFLAGS
71$(obj)image.o: $(SRCTREE)/common/image.c
d984fed0 72 $(CC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
f578a2da 73
d984fed0
SW
74$(obj)imls.o: $(SRCTREE)/tools/imls/imls.c
75 $(CC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
f578a2da
MS
76
77# Some of the tool objects need to be accessed from outside the tools/imls directory
78$(obj)%.o: $(SRCTREE)/common/%.c
d984fed0 79 $(CC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
f578a2da 80
78acc472 81$(obj)%.o: $(SRCTREE)/lib/%.c
d984fed0 82 $(CC) -g $(HOSTCFLAGS) -c -o $@ $<
f578a2da
MS
83
84$(obj)%.o: $(SRCTREE)/libfdt/%.c
d984fed0 85 $(CC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
f578a2da
MS
86
87clean:
88 rm -rf *.o imls
89
90#########################################################################
91
92# defines $(obj).depend target
93include $(SRCTREE)/rules.mk
94
95sinclude $(obj).depend
96
97#########################################################################