summaryrefslogtreecommitdiff
path: root/libfdt/Makefile
diff options
context:
space:
mode:
authorGerald Van Baren <vanbaren@cideas.com>2007-03-31 11:59:59 -0400
committerGerald Van Baren <vanbaren@cideas.com>2007-03-31 11:59:59 -0400
commit7cd5da0fe877e7171a4cdd44880bce783132871a (patch)
treeb938b97ce604e9dadca0ac683275cd8ec9b0f3a3 /libfdt/Makefile
parent6db7d0af2336c126e4d4b2f248cc23516bdd46a8 (diff)
downloadu-boot-imx-7cd5da0fe877e7171a4cdd44880bce783132871a.zip
u-boot-imx-7cd5da0fe877e7171a4cdd44880bce783132871a.tar.gz
u-boot-imx-7cd5da0fe877e7171a4cdd44880bce783132871a.tar.bz2
libfdt: Import libfdt source (1 of 2)
This adds the applicable libfdt source files (unmodified) and a README to explain where the source came from.
Diffstat (limited to 'libfdt/Makefile')
-rw-r--r--libfdt/Makefile88
1 files changed, 88 insertions, 0 deletions
diff --git a/libfdt/Makefile b/libfdt/Makefile
new file mode 100644
index 0000000..c8240bb
--- /dev/null
+++ b/libfdt/Makefile
@@ -0,0 +1,88 @@
+PREFIX = /usr/local
+TARGETLIBS = libfdt.a
+LIBOBJS = fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o fdt_strerror.o
+
+SOURCE = $(shell find . -maxdepth 1 ! -name version.h -a -name '*.[h]')
+SOURCE += *.c Makefile
+NODEPTARGETS=<clean>
+
+CPPFLAGS = -I.
+CFLAGS = -Wall -g
+
+LIBDIR = $(PREFIX)/$(LIB32)
+
+EXTRA_DIST = \
+ README \
+ HOWTO \
+ LGPL-2.1
+
+ifdef V
+VECHO = :
+else
+VECHO = echo " "
+ARFLAGS = rc
+.SILENT:
+endif
+
+DEPFILES = $(LIBOBJS:%.o=%.d)
+
+all: libs tests
+
+.PHONY: tests libs
+
+libs: $(TARGETLIBS)
+
+tests: tests/all
+
+tests/%: libs
+ $(MAKE) -C tests $*
+
+check: all
+ cd tests; ./run_tests.sh
+
+checkv: all
+ cd tests; ./run_tests.sh -v
+
+func: all
+ cd tests; ./run_tests.sh -t func
+
+funcv: all
+ cd tests; ./run_tests.sh -t func -v
+
+stress: all
+ cd tests; ./run_tests.sh -t stress
+
+stressv: all
+ cd tests; ./run_tests.sh -t stress -v
+
+%.o: %.c
+ @$(VECHO) CC $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+libfdt.a: $(LIBOBJS)
+ @$(VECHO) AR $@
+ $(AR) $(ARFLAGS) $@ $^
+
+%.i: %.c
+ @$(VECHO) CPP $@
+ $(CC) $(CPPFLAGS) -E $< > $@
+
+%.s: %.c
+ @$(VECHO) CC -S $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -S $<
+
+clean:
+ @$(VECHO) CLEAN
+ rm -f *~ *.o *.so *.a *.d *.i *.s core a.out $(VERSION)
+ $(MAKE) -C tests clean
+
+%.d: %.c
+ @$(CC) $(CPPFLAGS) -MM -MT "$*.o $@" $< > $@
+
+# Workaround: Don't build dependencies for certain targets
+# When the include below is executed, make will use the %.d target above to
+# generate missing files. For certain targets (clean, version.h, etc) we don't
+# need or want these dependency files, so don't include them in this case.
+ifeq (,$(findstring <$(MAKECMDGOALS)>,$(NODEPTARGETS)))
+-include $(DEPFILES)
+endif