To remove redundancy, get-os.sh needs to be retired in favor of pkg.py distro info. It's needed in platform.mk, but the only definiton of JW_PKG_PY is in projects.mk, so move it, along with the variables essential for the command:
include $(JWBDIR)/make/py-version.mk (defining PYTHON) JW_PKG_PY DEVELOPMENT VERSION_FILE
If VERSION_FILE is not found, trying to include makefile snippets triggers the attempt to regenerate it. This happened for installed Makefiles of jw-docker-images: It defines TOPDIR to /opt/jw-docker-images, projects.mk looks there, but the version file is installed under /usr/share/doc/packages/jw-docker-images/VERSION.
Allow VERSION_FILE to be overridden including code to keep that from happening.
Add support for --topdir-format. The option supports several different values, affecting the console output of App wherever it knows that the output contains a reference to the projects' toplevel directory.
- "unaltered" will have it print the toplevel directory in the same
format as passed to the commandline
- "absolute" will try to resolve it to an absolute path before
printing
- make:XXX will return the make-varible $(XXX) instead
To implement this, the proj_dir() member function is turned into the private member function __proj_dir(), and a new member function find_dir() is supplied, with two additional parameters: search_subdirs and search_absdirs, which will try to find an existing directory relative to the toplevel directory of the given module, or in the search_absdirs list, respectively.
Command modules in cmds.projects have been updated to use the new function.
Reorganize the Python module structure. Placing the command classes under jw.cmds.projects instead of jw.build.cmds will allow to add a nested command structure, with the current commands, being mostly related to building software, found below a "projects" toplevel command.
Other conceivable commands could be "package" for packaging, or "distro" for commands wrapping the distribution's package manager.
For a project to supply templates, it needs to advertise their location. For this, the tmpl_dir make variable is added to projects.mk. If other-project wants to get hold of some-project's templates, it can do, e.g.:
The current globbing pattern for filling the PYTHON variable doesn't account for the fact that /usr/bin/python3.X might have more than one digit for X, fix that
- Remove temporary variable PRJS_DIR - Add defaults for BUILD_LIBS_PREFIX and BUILD_TOOLS_PREFIX - Move definitions of varables needed early on from defs.mk into projects.mk, such as PYTHON and PYTHON_VERSION
This commit flips some more switches from Python 2 to Python 3 in makefiles and Python code. Build runs through, but it's still likely to break things.
This commit makes it possible to successfully run "make all" against ytools' again, with TARGET_TUPLE set to i686-ms-w64-mingw. Lots of minor and major tweaks here and there.
The biggest diff is a move of the architecture-related definitions into platform.mk. The are needed pretty early on, so that seems reasonable.
Making this work again is part of the larger effort to support cross buildchains in a more concise way, i.e. without so many if ($(TARGET),mingw)) all over the place. TARGET's relevance should dwindle, until it's finally taken over by the TARGET_XXX variables extracted from TARGET_TUPLE or TARGET_TRIPLET.
This commit sees several improvements to the build performance:
- Introduce cache.mk, which creates makefiles caching often used variables, per tree and per project. - Define more variables with := enclosed in condistions, instead of defining them with ?=, because the RHS of ?= is expanded deferredly. - Add more definitions for executables. - Move some more specialized definitions out into specialized makefiles, notably htdocs.mk and tmpl.mk
C++ definitions are numerous, and they shouldn't pollute variable space and performance outside of directories containing C++ files. This commit pushes them into a defs-cpp.mk file.
proj_query based commands run projects.py, which needs $(TOPDIR), which in turn is undefined, notably for standalone-exe.mk. This commit avoids related warnings.
proj_query_command is not a callable function, as opposed to proj_query, which now uses it. This adds the possibilty to use it multiple times in pipes.
This project was copied from ytools, with anything not related to providing build-functionality left out. This commit replaces the occurences of ytools with jw-build, and removes some but most certainly not all legacy ytools references.
- Add new makefile projects.mk, which is the place to define the minimally required set of variables to get a project's makefile oriented about the build machinery itself, mostly its locations in the file system. This also includes querying other projects. It's been pushed into a seperate makefile includeable early in the Makefile hierarchy, so that other special build variables (i.e. TARGET) can be specialized from within the project later to define build characteristics. - Prefixed object files with $(FLAVOUR_PREFIX), to allow for building two targets from the same directory