kubo/core
Jakub Sztandera f630222580
make: rework makefiles for non-recursive make and add sharness coverage
This commit introduces non-recursive Makefile infrastructure that replaces current Makefile infrastructure.
It also generally cleanups the Makefiles, separates them into nicer sub-modules and centralizes common operations into single definitions.

It allows to depend on any target that is defined in the makefile, this means that for example `gx install` is called once when `make build test_expensive_sharness` is called instead of 4 or 5 times.

It also makes the dependencies much cleaner and allows for reuse of modules. For example sharness coverage collection (WIP) uses sharness target with amended PATH, previously it might have been possible but not without wiring in the coverage collection into sharness make runner code.

Yes, it is more complex but not much more. There are few rules that have to be followed and few complexities added but IMHO it is worth it.

How to NR-make:
1. If make is to generate some file via a target, it MUST be defined in Rules.mk file in the directory of the target.
2. `Rules.mk` file MUST have `include mk/header.mk` statement as the first line and `include mk/footer.mk` statement as the last line (apart from project root `Rules.mk`).
3. It then MUST be included by the closest `Rules.mk` file up the directory tree.
4. Inside a `Rules.mk` special variable accessed as `$(d)` is defined. Its value is current directory, use it so if the `Rules.mk` file is moved in the tree it still works without a problem. Caution: this variable is not available in the recipe part and MUST NOT be used. Use name of the target or prerequisite to extract it if you need it.
5. Make has only one global scope, this means that name conflicts are a thing. Names SHOULD  follow `VAR_NAME_$(d)` convention. There are exceptions from this rule in form of well defined global variables. Examples: General lists `TGT_BIN`, `CLEAN`; General targets: `TEST`, `COVERAGE`; General variables: `GOFLAGS`, `DEPS_GO`.
3. Any rules, definitions or variables that fit some family SHOULD be defined in `mk/$family.mk` file and included from project root `Rules.mk`

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00
..
commands make: rework makefiles for non-recursive make and add sharness coverage 2017-02-12 01:18:40 +01:00
coreapi bubble up go-datastore deps 2016-11-28 22:29:38 -08:00
corehttp feat(webui): update to new version 2017-02-09 12:44:30 +01:00
corenet bubble up go-datastore deps 2016-11-28 22:29:38 -08:00
corerepo gc: remove unneccessary full repo scan 2016-12-13 14:50:01 +01:00
corerouting update go-libp2p with negotiate lazy fixes 2017-01-10 14:52:00 -08:00
coreunix coreunix: fix Add() docs regarding pinning 2016-12-18 01:09:23 +01:00
mock update go-libp2p with negotiate lazy fixes 2017-01-10 14:52:00 -08:00
.gitignore ignore testdb 2014-07-05 15:04:04 -07:00
bootstrap_test.go bubble up go-datastore deps 2016-11-28 22:29:38 -08:00
bootstrap.go update go-libp2p with negotiate lazy fixes 2017-01-10 14:52:00 -08:00
builder.go add option to enable go-multiplex experiment 2016-12-04 16:29:03 -08:00
core_test.go run gofmt 2016-10-12 07:00:38 -07:00
core.go Add in env var to enable yamux debug logging 2017-02-08 22:36:40 -08:00
pathresolver_test.go make path resolver no longer require whole node for construction 2016-10-25 15:04:44 -07:00
pathresolver.go bubble up go-datastore deps 2016-11-28 22:29:38 -08:00