aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2017-03-21Add an initial Python library for libfdtSimon Glass1-0/+1
Add Python bindings for a bare-bones set of libfdt functions. These allow navigating the tree and reading node names and properties. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-10dtc: Bump version to v1.4.4v1.4.4David Gibson1-1/+1
Preparing for yet another release, due to a build bug in v1.4.3. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-28dtc: Bump version to v1.4.3v1.4.3David Gibson1-1/+1
Preparing for new release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-30Makefile: Add tags ruleStephen Boyd1-0/+6
It's useful to have some tags to jump around sources. We don't include test sources in the toplevel Makefile because they probably aren't useful to main program development. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-09-03dtc: Makefile improvements for release uploadingv1.4.2David Gibson1-4/+20
This has some fixes to the make dist target, and a new make kup target for maintainer convenience uploading new releases. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-09-03dtc: Bump version to 1.4.2David Gibson1-1/+1
Bump version in preparation for a new release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-11-16Remove duplicated -Werror in dtc MakefileDavid Gibson1-1/+1
The "-Werror" compiler flag is currently declared twice in the Makefile, one time in WARNINGS, and one time in CFLAGS. Let's remove one of them. Signed-off-by: Thomas Huth <thuth@redhat.com> [Moved remaining -Werror from WARNINGS to CFLAGS --dwg] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-11-12dtc: Bump version to 1.4.1v1.4.1David Gibson1-1/+1
Bump version number in preparation for a release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-11-12dtc: Add maintainer script for signing and upload to kernel.orgDavid Gibson1-0/+1
This patch adds scripts/kup-dtc which builds a tarball from a specified git tag, signs it and uploads to kernel.org with kup. This is useful only for dtc maintainers. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-06-18Add a basic test for fdtdumpSimon Glass1-0/+1
We can test fdtdump by comparing its output with the source file that was compiled by dtc. Add a simple test that should at least catch regressions in basic functionality. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-02-04Makefile: add a make "dist" targetFlorian Fainelli1-0/+5
make dist can be used to produce tarballs directly from the git repository, which can be useful to automate the release process as well as shipping custom releases. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-01-25Makefile: enable -Wshadow by defaultFlorian Fainelli1-1/+1
Now that all -Wshadow build warnings/errors are fixed, turn on -Wshadow by default to make sure we would catch new potential shadow warnings. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2013-08-15Makefile: provide separate install targetsDavid Gibson1-2/+10
Currently `make install` will install the binaries, libraries and includes. This change separates the install target into install-bin, install-lib and install-includes, so we have more flexibility, particularly when we're just using libfdt. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2013-06-22Tag Version 1.4.0v1.4.0Jon Loeliger1-1/+1
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2012-01-21Introduce ${TESTS_BIN} in Makefiles to identify tested executables.Jon Loeliger1-0/+6
2012-01-21Add fdtput utility to write property values to a device treeSimon Glass1-0/+4
This simple utility allows writing of values into a device tree from the command line. It aimes to be the opposite of fdtget. What is it for: - Updating fdt values when a binary blob already exists (even though source may be available it might be easier to use this utility rather than sed, etc.) - Writing machine-specific fdt values within a build system To use it, specify the fdt binary file on command line followed by the node and property to set. Then, provide a list of values to put into that property. Often there will be just one, but fdtput also supports arrays and string lists. fdtput does not try to guess the type of the property based on looking at the arguments. Instead it always assumes that an integer is provided. To indicate that you want to write a string, use -ts. You can also provide hex values with -tx. The command line arguments are joined together into a single value. For strings, a nul terminator is placed between each string when it is packed into the property. To avoid this, pass the string as a single argument. Usage: fdtput <options> <dt file> <<node> <property> [<value>...] Options: -t <type> Type of data -v Verbose: display each value decoded from command line -h Print this help <type> s=string, i=int, u=unsigned, x=hex Optional modifier prefix: hh or b=byte, h=2 byte, l=4 byte (default) To read from stdin and write to stdout, use - as the file. So you can do: cat somefile.dtb | fdtput -ts - /node prop "My string value" > newfile.dtb This commit also adds basic tests to verify the major features. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-01-21Add fdtget utility to read property values from a device treeSimon Glass1-0/+4
This simply utility makes it easy for scripts to read values from the device tree. It is written in C and uses the same libfdt as the rest of the dtc package. What is it for: - Reading fdt values from scripts - Extracting fdt information within build systems - Looking at particular values without having to dump the entire tree To use it, specify the fdt binary file on command line followed by a list of node, property pairs. The utility then looks up each node, finds the property and displays the value. Each value is printed on a new line. fdtget tries to guess the type of each property based on its contents. This is not always reliable, so you can use the -t option to force fdtget to decode the value as a string, or byte, etc. To read from stdin, use - as the file. Usage: fdtget <options> <dt file> [<node> <property>]... Options: -t <type> Type of data -h Print this help <type> s=string, i=int, u=unsigned, x=hex Optional modifier prefix: hh or b=byte, h=2 byte, l=4 byte (default) Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26fdtdump: rename from ftdumpMike Frysinger1-3/+3
The freetype package already installs a binary named "ftdump", so the dtc package conflicts with that. So rename the newer dtc tool to "fdtdump". This even makes a bit more sense: ftdump: [F]lat device [T]ree [dump] fdtdump: [F]lat [D]evice [T]ree [dump] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2011-09-22Add fdt read/write utility functionsSimon Glass1-1/+1
This adds higher-level libfdt operations for reading/writing an fdt blob from/to a file, as well as a function to decode a data type string as will be used by fdtget, fdtput. This also adds a few tests for the simple type argument supported by utilfdt_decode_type. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2011-09-22Create Makefile.utils and move ftdump into itSimon Glass1-1/+1
We want to avoid a separate Makefile include for each utility, so this sets up a general one for utilities. Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Simon Glass <sjg@chromium.org>
2011-05-08Tag Version 1.3.0v1.3.0Jon Loeliger1-1/+1
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2011-04-29libfdt: include version number in sonamePaolo Bonzini1-4/+5
The libfdt shared library is only installed by its unversioned name. Including it properly in a distribution requires installation of both the versioned name (used in the binary-only package) and the unversioned name (used in the development package). The latter is just a symbolic link, so you need to change the soname in turn to include the version. While at it, use Makefile variables to shorten some lines and avoid cut-and-paste typos; and clean up remnants of when shared libraries were not supported on Darwin. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2010-11-13dtc: Add code to make diffing trees easierDavid Gibson1-2/+3
This patch adds a "dtdiff" script to do a useful form diff of two device trees. This automatically converts the tree to dts form (if it's not already) and uses a new "-s" option in dtc to "sort" the tree. That is, it sorts the reserve entries, it sorts the properties within each node by name, and it sorts nodes by name within their parent. This gives a pretty sensible diff between the trees, which will ignore semantically null internal rearrangements (directly diffing the dts files can give a lot of noise due to the order changes). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2010-04-30dtc: Add -Wredundant-decls (resend)David Gibson1-1/+1
We are almost clean already with the -Wredundant-decls warning. The only exception is a declaration for isatty() inside the flex-generated code. This can be removed by using flex's "never-interactive" option, which we probably should be using anyway, since we never parse interactively in the sense that this option implies. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2010-03-10dtc: Enable more warningsDavid Gibson1-1/+3
This patch turns on a bunch of extra gcc warnings, most of which are probably a good idea. Of the new warnings -Wnested-externs and -Wstrict-prototypes need no code changes, we're already warning-clean. The remaining one, -Wmissing-prototypes requires trivial changes in some of the tests (making functions local). This patch also rearranges the warnings flags into a separate make variable for convenience, and turns on -Werror, to really encourage people to keep the code warning-clean. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2009-07-15add Mac OS X supportJean-Christophe PLAGNIOL-VILLARD1-3/+14
use dylib shared lib extention allow to specifiy os specific shared lib link option Mac OS use -dynamiclib instead of -shared, -install_name instead of -soname and does not support --version-script add HOSTOS macro to detect the current os you are Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-02-17Fix libraries (static and dynamic) installationEmil Medve1-4/+3
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
2009-02-03dtc: Make asm output more portable and add testcasesDavid Gibson1-1/+1
This patch adds some testcases for dtc's -Oasm mode. Specifically it checks that building the asm will result in the same device tree blob in memory as -Odtb mode would produce, for a variety of trees. This test uncovered two difficulties with our current -Oasm output, both of which are addressed in this patch as well. First, -Oasm output would only be correct if assembled for a big-endian target. Usually that would be the case, when building device trees into a firmware or similar. However this makes life inconvenient for testing on a little-endian target, and one can think up use cases where a program running on a little endian host might want to embed a device tree for a big-endian target. This patch therefore changes -Oasm output to use .byte directives instead of .long throughout in order to generate byte-for-byte identical trees regardless of the endianness of the assembler target. Second, -Oasm output emitted several #define statements which were then used in the innards of the output - i.e. it assumed the output would be processed by cpp before being assembled. That may not be convenient in all build environments, and in any case doesn't work well with the above fix. So, -Oasm output no longer needs to be preprocessed before assembling. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2009-01-02libfdt: Introduce libfdt shared libraryJosh Boyer1-3/+12
Build a libfdt shared library in addition to the existing .a that is created. Symbol versioning is used from the libfdt/version.lds script. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
2008-10-03Rearrange ftdump and convert-dtsv0 into sub-Makefiles.Jon Loeliger1-33/+37
Follows the model of the existing sub-Makefiles for dtc. Adjust $(BIN) definition to represent installable bin programs and use it as the list of installed programs rather than using an enumerated list in the install target. Adjust the tests/Makefile to clean up properly still. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2008-10-03Install & document convert-dtsv0Niklaus Giger1-0/+1
Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-25Tag Version 1.2.0v1.2.0Jon Loeliger1-1/+1
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2008-07-23libfdt: Fix 'make install' target handling of .h files.Jon Loeliger1-1/+3
The definition of LIBFDT_INCLUDES was accidentally dropped. Put it back and add srcdir prefix handling for it. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2008-07-14Tag Version 1.2.0-rc2v1.2.0-rc2Jon Loeliger1-1/+1
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2008-07-14dtc: Enable and fix -Wcast-qual warningsDavid Gibson1-1/+1
Enabling -Wcast-qual warnings in dtc shows up a number of places where we are incorrectly discarding a const qualification. There are also some places where we are intentionally discarding the 'const', and we need an ugly cast through uintptr_t to suppress the warning. However, most of these are pretty well isolated with the *_w() functions. So in the interests of maximum safety with const qualifications, this patch enables the warnings and fixes the existing complaints. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14dtc: Enable and fix -Wpointer-arith warningsDavid Gibson1-1/+1
This patch turns on the -Wpointer-arith option in the dtc Makefile, and fixes the resulting warnings due to using (void *) in pointer arithmetic. While convenient, pointer arithmetic on void * is not portable, so it's better that we avoid it, particularly in libfdt. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-06-19Tag Version 1.2.0-rc1v1.2.0-rc1Jon Loeliger1-2/+2
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2008-05-29dtc: Remove reference to dead Makefile variablesDavid Gibson1-2/+1
Previous cleanups have removed the LIBFDT_CLEANFILES and DTC_CLEANFILES variables from the Makefiles. However, they're still referenced by the Makefile. This patch gets rid of these last vestiges. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-05-19dtc: Add program to convert dts files from v0 to v1David Gibson1-3/+7
This patch adds a new utility program, convert-dtsv0, to the dtc sources. This program will convert dts files from v0 to v1, preserving comments and spacing. It also includes some heuristics to guess an appropriate base to use in the v1 output (so it will use hex for the contents of reg properties and decimal for clock-frequency properties, for example). They're limited and imperfect, but not terrible. The guts of the converter program is a modified version of the lexer from dtc itself. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-05-19dtc: Clean up included Makefile fragmentsDavid Gibson1-3/+4
Currently the Makefile.dtc and Makefile.libfdt fragments include a number of things that seemed like they might be useful for other projects embedding the pieces, or for a make dist target. Well, we have no make dist target, it's become fairly unclear that these things would actually be useful to embedders (the kernel certainly doesn't use them), and it's a bunch of stuff with no current users. This patch, therefore, removes a bunch of unused definitions from the Makefile fragments. It also removes a dependency declared in Makefile.libfdt (of libfdt.a on the constituent .o files) which was incorrect (wrong path), and if corrected would be redundant with the similar dependency in the top-level makefile. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-01-24Tag Version 1.1.0v1.1.0Jon Loeliger1-1/+1
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2008-01-10Tag Version 1.1.0-rc1v1.1.0-rc1Jon Loeliger1-2/+2
Signed-off-by: Jon Loeliger <jdl@jdl.com>
2007-12-17dtc: Don't build tests as part of "all"David Gibson1-1/+1
Currently "make all" for dtc will build (but not run) the testcase binaries. This is a problem for cross compiles, because building the tests will attempt to run the dumptrees utility on the host system, which won't work if it's cross-compiled of course. Although it would be possible to separately build host binaries, there's not a lot of value in doing so since we don't have a facility for cross-executing the testsuite anyway. Therefore, remove the tests from the "all" target. It will still, of course, be build as a prerequisite to "make check" which will run the testsuite. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-06dtc: Remove space from flex command lineDavid Gibson1-1/+1
Author: Geoff Levand <geoffrey.levand@am.sony.com> Apparently some versions of flex don't correctly parse the -o parameter, if there's a space between the -o and its argument. So, this patch removes it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-13dtc: Add missing dependencies for testsDavid Gibson1-0/+4
At present, the Makefiles will not rebuild trees.o or the dtb files derived from it if testdata.h is updated. This is incorrect, and is because of missing dependency information. This patch fixes the problem by making sure that dependency information is generated from trees.S and dumptrees.c. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-05dtc: Fix the install targetEmil Medve1-5/+5
/usr/bin/install: cannot stat `fdt.h': No such file or directory /usr/bin/install: cannot stat `libfdt.h': No such file or directory Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-05dtc: Don't include libfdt in global LDFLAGSDavid Gibson1-1/+0
Remove the uneccessary LDFLAGS from the top-level makefile. It only added libfdt/ to the link path. dtc doesn't need libfdt at all, and the testcases which do, already link libfdt.a by explicit path. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-25DTC: Remove the need for the GLR Parser.Jon Loeliger1-1/+0
Previously, there were a few shift/reduce and reduce/reduce errors in the grammar that were being handled by the not-so-popular GLR Parser technique. Flip a right-recursive stack-abusing rule into a left-recursive stack-friendly rule and clear up three messes in one shot: No more conflicts, no need for the GLR parser, and friendlier stackness. Compensate by reversing the property list on the node. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-10-16Restore warning message about bison expected output.Jon Loeliger1-0/+1
It was dropped in ad9593f229362782b953da4b805df713e8468df0. Signed-off-by: Jon Loeliger <jdl@jdl.com>
2007-10-15dtc: Refactor MakefilesDavid Gibson1-75/+91
This patch makes a number of Makefile cleanups and improvements: - We use more generic rules to invoke flex and bison, which is useful for some of the other changes. - We use the name dtc-lexer.lex.c for the flex output, instead of the default lex.yy.c. That means less potential for confusion if dtc is embedded into other projects (e.g. the kernel). - We separate out a Makefile.dtc designed for embedding into other projects, analagous to Makefile.libfdt. - Makefile.libfdt is cleaned up to be more useful based on some actual trial runs of embedding libfdt in the kernel bootwrapper. - Versioning related rules and variables are collected into one place in the Makefile. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>