summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.subdir.mk
Commit message (Collapse)AuthorAgeFilesLines
* MFC r307741:ngie2017-05-301-1/+1
| | | | | | | | | r307741 (by emaste): Allow all subdirectories to be optional via SUBDIR.${MK_*} Tested by: br Pointy hat to: emaste
* MFC r308600:bdrewery2017-01-031-1/+4
| | | | | DIRDEPS_BUILD: Consolidate some logic for skipping of reading Makefile.depend.
* MFC r305147:bdrewery2017-01-031-4/+14
| | | | Add a 'make print-dir' that simply traverses all directories and prints them.
* Mark targets with _SUBDIR as .PHONY.bdrewery2016-06-151-2/+2
| | | | | | | | | This is mostly fixing META_MODE with realinstall wanting a .meta file when it does not need one. These targets really should always run though since they have _SUBDIR on them. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division
* Revert r301137 and r301163, and implement a correct fixgjb2016-06-011-2/+1
| | | | | | | | | | for the CONFS issue with dma.conf and ppp.conf. Thank you very much to Bryan Drewery for looking into the problem and providing this fix. Pointyhat: gjb Sponsored by: The FreeBSD Foundation
* share: minor spelling fixes.pfg2016-05-011-1/+1
| | | | | | Mostly comments but these tend to be user-visible. MFC after: 2 weeks
* Don't even define or append subdir targets with NO_SUBDIR.bdrewery2016-03-111-3/+2
| | | | | | | | | | No functional change. This prevents adding empty targets to the main called target which is confusing for debugging. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Import bsd.clang-analyze.mk based on NetBSD's version.bdrewery2016-02-261-1/+1
| | | | | | | | | This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the Clang static analyzer and present results on stdout. Obtained from: NetBSD (CVS Rev. 1.3) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5449
* Slightly lessen the amount of job target output for SUBDIR_PARALLEL.bdrewery2016-02-251-1/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Add more STANDALONE_SUBDIR_TARGETS.bdrewery2016-02-241-2/+9
| | | | Sponsored by: EMC / Isilon Storage Division
* Show full DIRPRFX in subdir parallel target name.bdrewery2016-02-241-3/+3
| | | | | | | | | For example when building, from buildworld, lib/atf/libatf-c++/tests/detail: --- all_subdir_atf --- is now: --- all_subdir_lib/atf/libatf-c++/tests/detail --- Sponsored by: EMC / Isilon Storage Division
* Add an .ORDER for all/install.bdrewery2016-02-161-0/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Simplify running the FreeBSD test suitengie2016-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace `make regress` (legacy test make target) and `make test` (incomplete test make target added with the FreeBSD test suite) with make check as it's consistent with other open source projects. `make check` defaults to running tests from `.OBJDIR`, but can be overridden with the `CHECKDIR` variable. Add `make checkworld` target to simplify running the FreeBSD test suite from `TESTSBASE` (i.e. the top-level tests directory), similar to buildworld. Document `make check` and `make checkworld` in build(7). Other minor changes: - Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify `make check`. - Remove terse warnings attached to `beforetest`/`aftertest`. - Add kyua binary check to check target in suite.test.mk; error out if it's not found The MFC is [partly] contingent on other build related changes being MFCed. Differential Revision: https://reviews.freebsd.org/D4406 MFC after: 2 months X-MFC to: stable/10 Relnotes: yes Reviewed by: bdrewery, Evan Cramer <eccramer@gmail.com> Sponsored by: EMC / Isilon Storage Division
* bsd.subdir.mk: Allow easier modification of [STANDALONE_]SUBDIR_TARGETS.bdrewery2016-01-191-13/+16
| | | | | | | | | | | | | | This reworks r289254 and removes ALL_SUBDIR_TARGETS. Because there is an include guard in this file there is no need for LOCAL_ or ?= on SUBDIR_TARGETS or STANDALONE_SUBDIR_TARGETS. These can just be set via src.conf. By the time bsd.subdir.mk is included it will just append the values to the existing value and work fine. This allows a consistent way to append to these variables without introducing a LOCAL_ var for STANDALONE_SUBDIR_TARGETS or renaming the historical SUBDIR_TARGETS. Sponsored by: EMC / Isilon Storage Division
* installconfig is PARALLEL_SUBDIR safe.bdrewery2016-01-191-1/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix 'install*' and many other missing targets with DIRDEPS_BUILD.bdrewery2015-12-041-8/+15
| | | | | | | | | My changes in r291635 broke 'make install*' for DIRDEPS_BUILD but also revealed that some other targets were not guaranteed to be created if there was a SUBDIR defined. One example is 'installfiles' was never defined if SUBDIR was not empty. Sponsored by: EMC / Isilon Storage Division
* The .if redirection on .WAIT is no longer needed with bmake.bdrewery2015-12-041-3/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix 'afterinstall' order not being respected after my changes in r291635.bdrewery2015-12-041-5/+6
| | | | | | | | | The problem was that 'afterinstall' was not coming after SUBDIRs were installed which was the expectation at least in sys/modules for kldxref. Reported by: np Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division
* Rearrange some common logic.bdrewery2015-12-041-5/+5
|
* bsd.subdir.mk: Only recurse on called targets, rather than dependencies.bdrewery2015-12-021-34/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig' due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of 'all'. This now adds all of the '*includes', '*files' targets as subdir targets, allowing them to recurse. This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since it no longer recurses; only 'install' will recurse and call the proper 'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory. This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE} sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids various issues such as the one fixed in r289462. As such revert Makefile.inc1 back to using 'includes' which avoids an extra tree walk and parallelizes the includes phases better. Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL, added in r289438. This is so users do not get a probably broken build if they run 'make all' from the top-level. Before the change in this commit, the workaround for 'make everything' was 'par-all' which would depend on 'all' and cause a proper parallel recursion. Now that will not work so a new _PARALLEL_SUBUDIR_OK is used to allow it. This is still part of an effort to combine bsd.(files|incs|confs).mk and move some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in r289331. This commit fixes the problems found there which was mostly double recursing during 'includes' which would recurse on itself and 'buildincludes' and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk for now. I've been cautious about this commit but have experienced no breakage on the tree except for the 'par-all' case which was already a hack. If something foo is depending on something bar that should recurse, it is very likely that the foo target is being recursed on already meaning that bar will still effectively recurse once sub-directories call foo. Discussed on: arch@ MFC after: never Sponsored by: EMC / Isilon Storage Division
* Revert r291633. Some files were missed.bdrewery2015-12-021-36/+34
|
* bsd.subdir.mk: Only recurse on called targets, rather than dependencies.bdrewery2015-12-021-34/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig' due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of 'all'. This now adds all of the '*includes', '*files' targets as subdir targets, allowing them to recurse. This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since it no longer recurses; only 'install' will recurse and call the proper 'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory. This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE} sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids various issues such as the one fixed in r289462. As such revert Makefile.inc1 back to using 'includes' which avoids an extra tree walk and parallelizes the includes phases better. Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL, added in r289438. This is so users do not get a probably broken build if they run 'make all' from the top-level. Before the change in this commit, the workaround for 'make everything' was 'par-all' which would depend on 'all' and cause a proper parallel recursion. Now that will not work so a new _PARALLEL_SUBUDIR_OK is used to allow it. This is still part of an effort to combine bsd.(files|incs|confs).mk and move some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in r289331. This commit fixes the problems found there which was mostly double recursing during 'includes' which would recurse on itself and 'buildincludes' and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk for now. I've been cautious about this commit but have experienced no breakage on the tree except for the 'par-all' case which was already a hack. If something foo is depending on something bar that should recurse, it is very likely that the foo target is being recursed on already meaning that bar will still effectively recurse once sub-directories call foo. Discussed on: arch@ MFC after: never Sponsored by: EMC / Isilon Storage Division
* Rename META_MODE option to DIRDEPS_BUILDsjg2015-11-141-1/+1
| | | | | | | | | This allows META_FILES option to be renamed META_MODE. Also add META_COOKIE_TOUCH for use in targets that can benefit from a cookie when in meta mode. Differential Revision: https://reviews.freebsd.org/D4153 Reviewed by: bdrewery
* Fix regression from using .USEBEFORE in _SUBDIR in r289705.bdrewery2015-10-291-1/+1
| | | | | | | | | Using .USEBEFORE had the unintended side-effect of changing the directory for the real target ran in the current directory. For example this meant that the 'make clean' would run in one of the SUBDIR. Sponsored by: EMC / Isilon Storage Division Pointyhat to: bdrewery
* Rework r289778 to always parallelize known targets, without ordering.bdrewery2015-10-231-14/+20
| | | | | | | | | | | | | | - Rather than allow 'make clean*' to ignore dependencies, make a static list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe. This allows a user to override them if needed and avoids adding this feature to user-defined targets that are in ${SUBDIR_TARGETS}. [1] - This now also allows to force SUBDIR_PARALLEL when calling these targets, since no dependencies are needed. Reported by: ian [1] Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks X-MFC-With: r289778
* For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there is no need tobdrewery2015-10-221-0/+11
| | | | | | | respect SUBDIR_DEPEND_* or .WAIT. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Remove indirection of _sub target for using _SUBDIR.bdrewery2015-10-211-6/+4
| | | | | | | | | | | | | | | | | | | | This reverts r266473 as the need for it, working around .MAKE and '+' issues, is no longer needed after r289460. This avoids extra log output in -j builds of '-- _sub.TARGET --' that are redundant with the '-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing. r266473 also made a subtle change in the ordering of _SUBDIR handling. Before the change, SUBDIRS were recursed into after building the TARGET due to the .USE of _SUBDIR *appending* the commands onto the TARGET. After the change though the indirection caused TARGET to depend on _sub.TARGET which had the _SUBDIR handling in it. This TARGET would run after recursing. However, the SUBDIR_PARALLEL handling from r263778 has this ordering as well. Since this has so far not been a problem, for now make this behavior for non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE. Further research may change this back to .USE as well as the SUBDIR_PARALLEL handling and bsd.progs.mk recursing. Sponsored by: EMC / Isilon Storage Division
* Replace all of the duplicated logic for recursing into a subdir with onebdrewery2015-10-191-30/+17
| | | | | | | implementation. It is duplicated at run-time but is more easily maintainable now. Sponsored by: EMC / Isilon Storage Division
* Add missing .PHONY for parallel subdir target.bdrewery2015-10-191-1/+1
| | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Recurse on 'buildconfig' and 'installconfig'. Remove the 'config' pseudo ↵bdrewery2015-10-141-4/+5
| | | | | | | | | | | target. The 'config' target isn't really needed right now so just remove it to avoid any clashes with config(8) building. It's also likely misspelled and should be 'configs' if we decide to add it back. This was just a convenience target recently added. Sponsored by: EMC / Isilon Storage Division
* Re-indent the ALL_SUBDIR_TARGETS listbdrewery2015-10-141-2/+3
|
* Revert r289282 for now as the interaction with a directory containingbdrewery2015-10-141-6/+20
| | | | bsd.files.mk and bsd.subdir.mk is recursing too many times.
* Replace the out-of-place includes/files/config handling in bsd.subdir.mk withbdrewery2015-10-141-20/+6
| | | | | | | | | | | | more typical ALL_SUBDIR_TARGETS entries and target hooks in bsd.incs.mk, bsd.files.mk and bsd.confs.mk. This allows the targets to be NOPs if unneeded and still work with the shortcut 'make includes' to build and then install in a parallel-safe manner. Sort and re-indent the ALL_SUBDIR_TARGETS with the new entries. Sponsored by: EMC / Isilon Storage Division
* Add a note about the mysterious files/includes/config block.bdrewery2015-10-141-0/+3
| | | | This originated from r96668.
* bsd.subdir.mk: Move all of the targets into ALL_SUBDIR_TARGETS.bdrewery2015-10-131-6/+7
| | | | | | | | | | Also improve documentation. The SUBDIR_TARGETS variable should really be named LOCAL_SUBDIR_TARGETS, but renaming it may be a surprise for downstream vendors who use this variable. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* bsd.subdir.mk: Handle cleanobj.bdrewery2015-10-131-1/+1
| | | | | | | | | | Before this, the target was unknown. Now it will recurse on subdirs and run the target in the current directory. It is required to recurse as there may be subdirs that have objs in their directory or in the object directory, so it is not enough to just delete the objdir of the subdir parent. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Add a new bsd.confs.mk similar to bsd.files.mk or bsd.incs.mkbapt2015-10-091-1/+1
| | | | | It defines a CONFS variable for all files supposed to be installed as a configuration file and handle as such
* Remove 'set -e' that are no longer needed as it is already default.bdrewery2015-09-251-4/+3
| | | | | | | | When bmake was initially imported at r241298 shell commands were no longer ran with 'set -e' as they were before. This was fixed in r254980 so they again always use 'set -e'. Sponsored by: EMC / Isilon Storage Division
* Automatically append SUBDIR.yes to the SUBDIR variable, andimp2015-08-271-1/+7
| | | | | | | remove duplicates. We cannot sort SUBDIR because many Makefiles have .WAIT in the list which is strongly ordering. Rather than try to second guess when to sort and when to not sort depending on .WAIT being in the list, just remove duplicates.
* Building on fmake is no longer possible so removed tests for bmake.sjg2015-06-101-1/+1
|
* Merge from headsjg2015-05-261-1/+1
|\
* \ Merge head from 7/28sjg2014-08-191-6/+16
|\ \ | |/
| * Create a mechanism for providing fine-grained build order dependenciesian2014-06-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | during SUBDIR_PARALLEL builds. This augments the coarse .WAIT mechanism, which is still useful if you've got a situation such as "almost everything depends on A and B". Because the parallel subdir mechanism uses non-obvious mangling of target names, which should probably remain a private detail of the implementation, it's not easy to do things like "libfoo: libbar", so instead the new mechanism lets you set a variable that lists dependencies: SUBDIR_DEPEND_libfoo= libgroodah libpouet Note that while I'm using libraries as an example here, it really has nothing to do with the generated library files. This is really saying "build in directory libfoo after building in the libgroodah and libpouet directories." This updates lib/Makefile with dependency information based on the old almost-accurate comment block and by combing through lib/* makefiles looking for LDADD dependencies to other libraries within lib/*. Reviewed by: Jia-Shiun Li <jiashiun@gmail.com>
| * Put the test suite in its own tests.txz distribution file.jmmv2014-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Force all the contents of /usr/tests to go into a separate distribution file so that users of binary releases can easily choose to not install it. To make this possible, we need two fixes: - bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we do not recurse into 'tests' subdirectories when we needn't. Otherwise, we end up with some Kyuafiles in base.txz. - etc/Makefile needs to skip installing tests in its 'distribute' target so that a Kyuafile doesn't leak into base.txz. Approved by: gjb
| * Use an intermediate target to associate with _SUBDIR which is marked .MAKEsjg2014-05-201-5/+9
| | | | | | | | | | | | | | | | this allows make -n to do tree walks as expected without doing anything else (as intended). Use prefix _sub. to help avoid conflict with any real target. Reviewed by: imp
| * Revert previous change - doesn't cover all cases.sjg2014-05-191-2/+1
| |
| * _SUBDIR is marked .MAKE - since it runs a sub-make.sjg2014-05-191-1/+2
| | | | | | | | | | | | | | | | | | | | Targets thus marked are supposed to run even with -n. As such they should not do anything except run the sub-make. Use an intermediate target _* to associate with _SUBDIR and which depends on installincludes etc so that we get the correct behavior with -n. Reviewed by: marcel
* | Merge headsjg2014-04-281-2/+29
|\ \ | |/
| * Allow .WAIT to appear in SUBDIR= lists, to provide some control overian2014-04-231-3/+11
| | | | | | | | | | | | | | parallel build order. All subdirs before a .WAIT will be built before any subdirs after it. Reviewed by: imp@
| * Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to processdim2014-03-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all the SUBDIR entries in parallel, instead of serially. Apply this option to a selected number of Makefiles, which can greatly speed up the build on multi-core machines, when using make -j. This can be extended to more Makefiles later on, whenever they are verified to work correctly with parallel building. I tested this on a 24-core machine, with make -j48 buildworld (N = 6): before stddev after stddev ======= ====== ======= ====== real time 1741.1 16.5 959.8 2.7 user time 12468.7 16.4 14393.0 16.8 sys time 1825.0 54.8 2110.6 22.8 (user+sys)/real 8.2 17.1 E.g. the build was approximately 45% faster in real time. On machines with less cores, or with lower -j settings, the speedup will not be as impressive. But at least you can now almost max out a machine with buildworld! Submitted by: jilles MFC after: 2 weeks
OpenPOWER on IntegriCloud