aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2023-08-06move release version into VERSION.txtBrandon Maier1-6/+2
To synchronize the release version of the Makefile and Meson build systems, pull the version info from a shared file. Meson requires that the shared library version follow the X.Y.Z numbering scheme. But the Makefile supported building shared libraries with an EXTRAVERSION appended, for example X.Y.Z-rc1. We want to keep the output of both systems the same to avoid issues, so we drop support for the Makefile EXTRAVERSION. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-07-29Makefile: allow to install libfdt without building executablesNicolas Escande1-1/+1
When we only need the libfdt calling the target install-lib also builds the executables listed in $(BINS) because this target depends on all Instead lets make install-lib only depend on libfdt. Signed-off-by: Nicolas Escande <nico.escande@gmail.com> Message-ID: <20230726144336.677135-1-nico.escande@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-05-14yaml: Depend on libyaml >= 0.2.3Uwe Kleine-König1-1/+5
libyaml before 0.2.3 expects non-const string parameters. Supporting both variants would require either cpp magic or ignoring "discarded-qualifiers" compiler warnings. For the sake of simplicity just support libyaml 0.2.3 and newer. Note that NO_YAML can be overwritten on the make command line. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2023-03-01build-sys: add -Wwrite-stringsMarc-André Lureau1-1/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-02-27Add -Wsuggest-attribute=format warning, correct warnings thus generatedDavid Gibson1-1/+2
Add this new warning to the default build flags. It suggests adding a ((format)) attribute to xavsprintf_append(), so do that. Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-02-09Bump version to v1.7.0v1.7.0David Gibson1-2/+2
It's been rather too long since the last release, and quite a lot of changes have accumulated. Finally get around to rolling a release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-09-26Makefile: fix infinite recursion by dropping non-existent `%.output`Sergei Trofimovich1-1/+1
Without the change GNU `make-4.4` falls into infinite recursion of trying to generate %.output files (bison is not passed flags to generate debug output). This happens on GNU `make-4.4` only after GNU make change to more eagerly rebuild all target outputs in multiple targets: https://savannah.gnu.org/bugs/index.php?63098 The recursion here is the following: - Makefile depends on *.d files - *.d files depend on *.c files - *.c files are generated by bison - bison is triggered whenever some of it's multiple targets are missing In our case `%.output` is always missing and bison is always reran. *.d files are always regenerated on `make` run. And make is always restarted as *.d files are always regenerated. The fix removes infeasible `%.output`. Signed-off-by: Sergei Trofimovich <slyich@gmail.com> Message-Id: <20220925104203.648449-2-slyich@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-09-26Makefile: limit make re-execution to avoid infinite spinSergei Trofimovich1-0/+4
make-4.4 became intentionally more eager at rebuilding outdated Makefile includes. Currently this causes `dtc` to spin infinitely in parser/dependency loop: $ make ... CHK version_gen.h BISON dtc-parser.tab.h DEP dtc-lexer.lex.c DEP dtc-parser.tab.c CHK version_gen.h BISON dtc-parser.tab.h DEP dtc-lexer.lex.c DEP dtc-parser.tab.c ... # never stops After the change build eventually fails when gets into this state: $ make ... CHK version_gen.h UPD version_gen.h DEP util.c BISON dtc-parser.tab.h DEP dtc-lexer.lex.c DEP dtc-parser.tab.c CHK version_gen.h BISON dtc-parser.tab.h DEP dtc-lexer.lex.c DEP dtc-parser.tab.c Makefile:394: *** "Make re-executed itself 10 times. Infinite recursion?". Stop. The actual recursion will be fixed separately. Signed-off-by: Sergei Trofimovich <slyich@gmail.com> Message-Id: <20220925104203.648449-1-slyich@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-07-27Allow static building with makeTero Tervala1-3/+10
Set STATIC_BUILD=1 environment variable to enable static building when using makefiles. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220629163531.932281-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-06-21Makefile: add -Wsign-compare to warning optionsAndre Przywara1-1/+1
Now that all signedness comparison warnings in the source tree have been fixed, let's enable the warning option, to avoid them creeping in again. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20210618172030.9684-6-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-06-08Bump version to v1.6.1v1.6.1David Gibson1-1/+1
A number of fixes have accumulated, so rolling up another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-08-25Makefile: Specify cflags for libyamlEmmanuel Vadot1-0/+1
Some systems don't install third party software includes in a default path (like FreeBSD), add yaml cflags to fix compilation. Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
2020-05-14Makefile: when building libfdt only, do not add unneeded depsClaudio Fontana1-0/+4
implemented originally for the QEMU consumer of libfdt. Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20200512103315.1926-1-cfontana@suse.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-04Bump version to v1.6.0v1.6.0David Gibson1-1/+1
We've accumulated some new features and a bunch of fixes. Also the versioning on v1.5.1 was messed up :(. Prepare for another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-04Encode $(NO_PYTHON) consistently with other variablesDavid Gibson1-3/+5
We have several $(NO_*) variables used to disable optional features. $(NO_PYTHON) is encoded as empty for "include Python support" and anything else for "disable Python support". However the other variables - $(NO_YAML) and $(NO_VALGRIND) - use 0 for "include" and 1 for "disable". Change $(NO_PYTHON) to work consistently with the others. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-02-24Add a way to control the level of checks in the codeSimon Glass1-1/+5
Add a new ASSUME_MASK option, which allows for some control over the checks used in libfdt. With all assumptions enabled, libfdt assumes that the input data and parameters are all correct and that internal errors cannot happen. By default no assumptions are made and all checks are enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Message-Id: <20200220214557.176528-3-sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-12-19Move -DNO_VALGRIND into CPPFLAGSDavid Gibson1-1/+1
Since -D sets preprocessor directives, it applies for the preprocessor not just the C compiler proper and so belongs in CPPFLAGS rather than CFLAGS. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-12-17Makefile: pass $(CFLAGS) also during dependency generationEd Maste1-1/+1
When Valgrind is not available NO_VALGRIND is set in CFLAGS, and this is needed during dependency generation as well as compilation. Message-Id: <20191210163033.9888-1-emaste@freefall.freebsd.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-11-03support byacc in addition to bisonEthan Sommer1-1/+1
Use -b to explicitly set file prefix, so that byacc generates files with the same names as bison. Add %locations to dtc-parser.y to explicitly enable location tracking for byacc, and define YYERROR_CALL to prevent byacc from defining it to call yyerror with 2 parameters because of the locations directive, because dtc-parser.y defines yyerror to accept one parameter. Signed-off-by: Ethan Sommer <e5ten.arch@gmail.com> Message-Id: <20191029162619.32561-1-e5ten.arch@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-22Makefile: Add EXTRA_CFLAGS variableJoel Stanley1-1/+1
Distributions packaging dtc may need to set extra flags. Currently when they do that it overrides the ones set by the makefile. This is particularly problematic when compiling without yaml, as the yaml detection is ignored. ld: dtc.o: in function `main': dtc.c:(.text.startup+0x718): undefined reference to `dt_to_yaml' This patch provides a EXTRA_CFLAGS variable that is added to the list of CFLAGS, and can be set on the command line when packaging. Signed-off-by: Joel Stanley <joel@jms.id.au> Message-Id: <20190722030244.9580-1-joel@jms.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21dtc: Add GPLv2 SPDX tags to files missing license textRob Herring1-0/+1
A couple of dtc files are missing licenses. Add GPL-2.0-or-later SPDX tag to them. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20190620211944.9378-7-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-10Fix bogus error on rebuildDavid Gibson1-1/+1
Currently if a file is touched requiring libfdt.so rebuild, it will fail because the ln -s command will attempt to replace an already existing link an error. Correct this by using ln -sf. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29Link tools and tests against libfdt shared libraryDavid Gibson1-4/+5
Currently the libfdt based tools (fdtput, fdtget, etc.) and all the test binaries using libfdt are linked against the static version of libfdt. That's made it very easy in the past to forget to properly update the version.lds file which is needed to make functions publicaly accessible from the shared library. To avoid problems like that in future, alter the build so that we link and run the tests against the shared library version of libfdt. That immediately points out several important symbols that are still missing from the version.lds, so fix those as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29Clean up LDLIBS handlingDavid Gibson1-2/+2
We currently set LDLIBS to include libyaml globally if we're using it. However only dtc itself actually needs to link with libyaml - the other tool binaries don't. Avoid that unnecessary inclusion by making LDLIBS handling per-target. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29Rebuild libfdt shared object if versioning linker script changesDavid Gibson1-5/+5
The usable content of the shared library varies depending on the symbol versions given in the version.lds linker script, however it's not currently in the make dependencies. Correct that, and move the libfdt rules together for consistency while we're at it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29Use Python3 by defaultDavid Gibson1-1/+1
Python2 is deprecated upstream, lets try to move forwards. Along with it generalize the .gitignore file so we ignore the .pyc files in the new location that Python3 uses. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-06Bump version to v1.5.0v1.5.0David Gibson1-2/+2
We've accumulated several new features as well as a number of bugfixes, so prepare for another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-11-23Remove broken objdir / srcdir supportDavid Gibson1-14/+12
The dtc makefiles have support for building into a separate directory from the sources... except that it's broken and probably always has been. Remove the pretense. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-11-23Refine pylibfdt_clean targetDavid Gibson1-4/+0
Move it to the subdir Makefile, generalize some of the patterns, remove the 'build' directory made by setup.py and __pycache__ directory made by Python3. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-11-23Refine libfdt_clean targetDavid Gibson1-5/+0
Move it to the libfdt Makefile piece, use neater make syntax, and remove redundant command (already included in STD_CLEANFILES). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-11-23pylibfdt: Allow switch to Python 3 via environment variable PYTHONLumir Balhar1-1/+2
Python 2 is still the default but it can be changed by setting environment variable PYTHON before build/test. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-09-13Add support for YAML encoded outputGrant Likely1-1/+8
YAML encoded DT is useful for validation of DTs using binding schemas. The YAML encoding is an intermediate format used for validation and is therefore subject to change as needed. The YAML output is dependent on DTS input with type information preserved. Signed-off-by: Grant Likely <grant.likely@arm.com> [robh: make YAML support optional, build fixes, Travis CI test, preserve type information in paths and phandles] Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-09-10Make valgrind optionalDavid Gibson1-0/+7
Some platforms don't have valgrind support, and sometimes you simply might not want to use valgrind. But at present, dtc, or more specifically its testsuite, won't compile without valgrind because we use the valgrind client interface in some places to improve our testing and suppress false positives. This adds some Makefile detection to correctly handle the case where valgrind is not available. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-07-23dtc: Bump version to v1.4.7v1.4.7David Gibson1-1/+1
We've accumulated a bunch of bugfixes, including considerable improvements to libfdt's memory safety, so get ready for another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-01-08Avoid installing pylibfdt when dependencies are missingSimon Glass1-8/+16
At present we have a build check that python-dev and swig are available. If they are not, we print a message and skip building pylibfdt. However this check is not currently present with 'make install'. The install is attempted, and fails. See crbug.com/789189 Split the check out into a separate script and use it twice, once for the build and once for the install. This corrects the error. Reported-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-01-04Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}kevans@FreeBSD.org1-4/+9
For adoption into systems that may have additional arguments to be passed into install(1) upon install, split out INSTALL into the different types of files to be installed and use them appropriately. This allows, for instance, passing -s to strip binaries and libs while not botching directory installs or data/script installations. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-01-03dtc: Bump version to v1.4.6v1.4.6David Gibson1-1/+1
We've accumulated a number of bugfixes since v1.4.5, so prepare for another release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-27dtc: Bump version to v1.4.5v1.4.5David Gibson1-1/+1
Preparing for another release. No particular trigger for this, just a number of accumulated enhancements since v1.4.4. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-27pylibfdt: Use Python2 explicitlyDavid Gibson1-1/+1
The pylibfdt code is written for Python2, not Python3. So, it's safer to explicitly request Python2 in our scripts and when checking pkg-config. On Arch Linux at least, there isn't actually a plain "python" link, just "python2" and "python3", so the current setup won't work at all. According to https://www.python.org/dev/peps/pep-0394/ using "python2" should work, and is preferred. Updating pylibfdt to work with Python3 would be nice, but is a problem for another day. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-06-15fdtoverlay: A tool that applies overlaysPantelis Antoniou1-0/+5
Since libfdt support overlay application on FDT blobs, provide a command line tool that applies an arbitrary number of overlays, one after another to a base fdt blob and output the result in the given file. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-05-20Makefile: Fix build on MSYS2 and CygwinCufi, Carles1-1/+5
The host compiler on MSYS2 and Cygwin does not allow the -fPIC option, issuing a warning that is treated as an error and stops the build. Detect whether we're running under MSYS2 or Cygwin and avoid adding -fPIC to prevent the error from happening. Tested on Linux, MSYS2 and Cygwin. Signed-off-by: Carles Cufi <carles.cufi@gmail.com> [dwg: Added explicit empty CFLAGS for clarity] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-05-19Clean up shared library compile/link optionsDavid Gibson1-6/+8
- Allow overriding of shared library compile time flags for platforms whic need it - Include -fPIC in the link flags variable instead of including it raw in the target rule - Cosmetic formatting tweaks Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-04-08pylibfdt: Use Makefile constructs to implement NO_PYTHONSimon Glass1-3/+12
The current mechanism uses a shell construct, but it seems better to use a Makefile approach. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-04-08pylibfdt: Allow setup.py to operate stand-aloneSimon Glass1-0/+1
At present we require that setup.py is executed from the Makefile, which sets up various important things like the list of files to build and the version number. However many installation systems expect to be able to change to the directory containing setup.py and run it. This allows them to support (for example) building/installing for multiple Python versions, varying installation paths, particular C flags, etc. The problem in implementing this is that we don't want to duplicate the information in the Makefile. A common solution (so I am told) is to parse the Makefile to obtain the required information. Update the setup.py script to read a few Makefiles when it does not see the required information in its environment. This allows installation using: ./pylibfdt/setup.py install Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-29pylibfdt: Enable installation of Python moduleSimon Glass1-1/+1
Adjust the setup script to support installation, and call it from the Makefile if enabled. It will be disabled if we were unable to build the module (e.g. due to swig being missing), or the NO_PYTHON environment variable is set. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-29pylibfdt: Allow building to be disabledSimon Glass1-0/+1
Some build systems want to build python libraries separately from the rest of the build. Add a NO_PYTHON option to enable this. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-27pylibfdt: Allow pkg-config to be supplied in the environmentSimon Glass1-1/+2
Some build systems have their own version of the pkg-config tool. Use a variable for this instead of hard-coding it, to allow for this. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-22Correct typo: s/pylibgfdt/pylibfdt/David Gibson1-1/+1
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-21Build pylibfdt as part of the normal build processSimon Glass1-2/+32
If swig and the Python are available, build pylibfdt automatically. Adjust the tests to run Python tests too in this case. Signed-off-by: Simon Glass <sjg@chromium.org> [dwg: Make error message clearer that missing swig or python-dev isn't fatal to the whole build] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
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>