@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
@rm -f $(obj)tools/crc32.c $(obj)tools/environment.c $(obj)tools/env/crc32.c
@rm -f $(obj)tools/sha1.c $(obj)tools/image.c
+ @rm -f $(obj)tools/fdt.c $(obj)tools/fdt_ro.c $(obj)tools/fdt_rw.c
+ @rm -f $(obj)tools/fdt_strerror.c $(obj)tools/fdt_wip.c
+ @rm -f $(obj)tools/libfdt_internal.h
@rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c
@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -lname "*" -print | xargs rm -f
#OBJ_FILES += mpc86x_clk.o
#endif
+LIBFDT_OBJ_FILES = fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o
+
LOGO_H = $(OBJTREE)/include/bmp_logo.h
ifeq ($(LOGO_BMP),)
-idirafter $(OBJTREE)/include \
-DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
+
+# No -pedantic switch to avoid libfdt compilation warnings
+FIT_CFLAGS = -Wall $(CPPFLAGS) -O
+
AFLAGS = -D__ASSEMBLY__ $(CPPFLAGS)
CC = $(HOSTCC)
STRIP = $(HOSTSTRIP)
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
-$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)sha1.o
+$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)sha1.o $(LIBFDT_OBJ_FILES)
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
$(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)image.o: $(obj)image.c
- $(CC) -g $(CFLAGS) -c -o $@ $<
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)mkimage.o: $(src)mkimage.c
- $(CC) -g $(CFLAGS) -c -o $@ $<
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)ncb.o: $(src)ncb.c
$(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)mpc86x_clk.o: $(src)mpc86x_clk.c
$(CC) -g $(CFLAGS) -c -o $@ $<
+$(obj)fdt.o: $(obj)fdt.c
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_ro.o: $(obj)fdt_ro.c
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_rw.o: $(obj)fdt_rw.c
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_strerror.o: $(obj)fdt_strerror.c
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_wip.o: $(obj)fdt_wip.c
+ $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
subdirs:
ifeq ($(TOOLSUBDIRS),)
@:
@rm -f $(obj)image.c
ln -s $(src)../common/image.c $(obj)image.c
+$(obj)fdt.c: libfdt_internal.h
+ @rm -f $(obj)fdt.c
+ ln -s $(src)../libfdt/fdt.c $(obj)fdt.c
+
+$(obj)fdt_ro.c: libfdt_internal.h
+ @rm -f $(obj)fdt_ro.c
+ ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c
+
+$(obj)fdt_rw.c: libfdt_internal.h
+ @rm -f $(obj)fdt_rw.c
+ ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c
+
+$(obj)fdt_strerror.c: libfdt_internal.h
+ @rm -f $(obj)fdt_strerror.c
+ ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c
+
+$(obj)fdt_wip.c: libfdt_internal.h
+ @rm -f $(obj)fdt_wip.c
+ ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c
+
+$(obj)libfdt_internal.h:
+ @rm -f $(obj)libfdt_internal.h
+ ln -s $(src)../libfdt/libfdt_internal.h $(obj)libfdt_internal.h
+
$(LOGO_H): $(obj)bmp_logo $(LOGO_BMP)
$(obj)./bmp_logo $(LOGO_BMP) >$@
--- /dev/null
+/*
+ * (C) Copyright 2008 Semihalf
+ *
+ * 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
+ */
+
+#ifndef __FDT_HOST_H__
+#define __FDT_HOST_H__
+
+/* Make sure to include u-boot version of libfdt include files */
+#include "../include/fdt.h"
+#include "../include/libfdt.h"
+#include "../include/fdt_support.h"
+
+#endif /* __FDT_HOST_H__ */