Commit Graph

87 Commits

Author SHA1 Message Date
Steven Allen
e45abef49f feat: add default makefile to call gnumake
* gmake will prefer GNUmakefile over Makefile.
* Other make implementations will read Makefile and then call gmake.
2019-08-01 12:53:00 -07:00
Steven Allen
1de768fb8f fix: require gmake
IPFS doesn't build correctly under non-GNU make implementations.
2019-08-01 12:18:56 -07:00
Steven Allen
6b0f9f71e0 build: use protoc-gen-* from gomod
Also,

* Make it possible to override the PROTOC binary.
* Remove gx targets.
2019-06-05 10:57:43 -07:00
Steven Allen
5ae130dee2 update protobuf files in go-ipfs
Also:

* Switch to gogo for filestore for consistency.
* Use the "faster" codegen for fewer allocations.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-08-15 12:02:21 -07:00
Jakub Sztandera
1d3e039367
make: fix PATH escaping
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 10:26:39 +01:00
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
Jakub Sztandera
e5711d384a
make: unsilence gx
I probably silienced it when I was working on some Makefile

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-01-10 17:29:00 +01:00
Jakub Sztandera
c7b455210e
Add codecov.yml
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-06 23:50:10 +01:00
Jakub Sztandera
2fc9cc547a
Some progress with coverage
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-06 23:50:10 +01:00
Jakub Sztandera
650eeee7cc
Rework tags and flags passing in Makefile
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-06 17:34:07 +01:00
Jakub Sztandera
0310992078
Exclude cmd from coverage
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-05 00:23:13 +01:00
Jakub Sztandera
8218dcb0c8
Do not include core/commands in coverage report
It is covered by sharness

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-04 23:56:09 +01:00
Jakub Sztandera
56e50178cc
Fix PHONY name in Makefile
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-02 22:43:50 +01:00
Jakub Sztandera
36708cc04a
Run coveralls if COVERALLS_TOKEN is set
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-02 22:31:04 +01:00
Jakub Sztandera
21c7ec8c35
Add test_go_fmt to makefile
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-11-24 22:14:59 +01:00
Vasil Dimov
5538f658ba
use $(MAKE) instead of 'make' in Makefiles (follow-up to f3dc11c)
License: MIT
Signed-off-by: Vasil Dimov <vd@FreeBSD.org>
2016-09-26 22:22:02 +03:00
Jeromy
94a0e16b67 update gx binary requirements
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-08-23 11:03:43 -07:00
Jeromy
4974136a1a bump go requirement to 1.7
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-08-23 10:46:17 -07:00
Jakub Sztandera
cc60f6909b make: cleanup -rm calls
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-04 16:38:00 +02:00
Jakub Sztandera
f93ce30018 make: squash install, build and nofuse rules
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-04 16:38:00 +02:00
Jakub Sztandera
c1014aea88 make: 'make clean' clears sharness too
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-04 16:38:00 +02:00
Jakub Sztandera
f3dc11c566 use $(MAKE) instead of 'make' in Makefiles
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-04 16:38:00 +02:00
Jakub Sztandera
7be60c9b13 make: run sharness in single thread
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-04 16:38:00 +02:00
Jeromy
70cd1dac9a update gx version
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-19 08:08:00 -07:00
Dominic Della Valle
228c4db6d7 Fix Makefile on Windows
License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
2016-07-16 18:37:43 -04:00
Péter Szilágyi
dbc1d3f2d3 Makefile, bin: Support multiple GOPATH components
License: MIT
Signed-off-by: Péter Szilágyi <peterke@gmail.com>
2016-07-16 18:06:16 -04:00
Lars Gierth
ad461c611e Revert "Makefile, bin: Support multiple GOPATH components"
This reverts commit ff75bc0318,
which broke building on windows. See ipfs/go-ipfs#2833.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-06-17 15:32:40 +02:00
Jakub Sztandera
32cdbbdffa Fix DHT tests failing because of repeated addresses
Due to SO_REUSE_PORT it is possible for a localhost:0
address to repeat. This causes failure in DHT tests
where we spun up a lot of nodes inside test.

As for a birthday paradox it is enough to use 140
ports to get 20% chance for collision which was causing
failure in our case.

The fix is to disable REUSE_PORT routine for the
tests and leave it running for sharness tests where
not that many addresses are used at the same time.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-14 16:39:15 +02:00
Péter Szilágyi
ff75bc0318 Makefile, bin: Support multiple GOPATH components
License: MIT
Signed-off-by: Péter Szilágyi <peterke@gmail.com>
2016-06-05 21:39:02 +03:00
Lars Gierth
864e305557 build: specify a dist.ipfs.io hash
Right now bin/dist_get trusts whatever DNS resolver is active.
This change enables it to verify what it downloads.
Verification itself remains TODO.

This will work best with a unixfs-hash tool which is TODO too.
It'd just do the equivalent of `ipfs add -n -r <dirOrFile>`.

License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-05-17 02:33:35 +02:00
Christian Couder
b5c6a62e63 Makefile: remove toolkit_upgrade target
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-05-16 06:23:04 +02:00
Jeromy
db5d730fb9 bump gx version to 0.7.0
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-05-09 13:19:14 -07:00
Jeromy
1e31839cc2 use repo level bins in test Makefile
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-05-09 12:48:06 -07:00
Jeromy
06a8a5bdb6 use gx-go 1.2.0
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-05-09 10:55:33 -07:00
Jeromy
4b6828ebfe stricter makefile targets
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-05-09 10:55:33 -07:00
Jeromy
284bb1866f add a dist_get script for getting bins from dist.ipfs.io
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-05-09 10:55:33 -07:00
Christian Couder
f24aa85c8e Makefile: add variables for min versions of go, gx and gx-go
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-05-04 20:25:17 +02:00
Christian Couder
c777ac05da Makefile: update gx and gx-go versions
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2016-05-04 07:04:40 +02:00
Jeromy Johnson
60f1ba1f81 Merge pull request #2593 from kevina/refactor-makefile
Refactor Makefile.
2016-04-28 10:33:01 -07:00
Kevin Atkinson
31421aeace Refactor Makefile.
Move the go commands that should run under cmd/ipfs in the Makefile in
cmd/ipfs rather than doing a "cd cmd/ipfs && go ..." in the root
Makefile.

The "cd cmd/ipfs && go ..." lines causes problems with GNU Emacs's
compilation mode.  With the current setup Emacs is unable to jump to
the location of the error outputted by go compiler as it can not find
the source file.  The problem is that the embedded "cd" command causes
Emacs's compilation mode to lose track of the current directory and
thus attempts to look for the source file in the wrong directory.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-04-28 01:28:42 -04:00
Jeromy Johnson
973266ae11 re-add dep needed for windows builds (#2611)
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-04-27 11:49:15 -07:00
Andrew Chin
0dea50be68 Adds 'toolkit_upgrade' to the makefile help target
License: MIT
Signed-off-by: Andrew Chin <achin@eminence32.net>
2016-04-13 17:18:57 -04:00
Steven Allen
5b763e8a08 allow users to override the IPFS API address when fetching dependencies
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2016-03-28 10:14:50 -07:00
Lars Gierth
6c74ac0d91 build: have install task not depend on build tasks, unneccessary
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-03-10 19:26:57 +01:00
Lars Gierth
7d67b0a69c build: fix path_check for symlink-into-gopath usecase
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-03-10 19:23:12 +01:00
Jeromy Johnson
6d4da612dd Merge pull request #2399 from ipfs/fix/assert-gopath
assert that you must build from inside your gopath
2016-03-02 13:00:23 -08:00
Jeromy
64c6943ae2 remove trailing whitespace
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-02 10:10:04 -08:00
Jeromy
aa6db5dde3 use makes realpath so its more crossplatform
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-03-01 11:24:01 -08:00
Jakub Sztandera
07ffab63f4 Make Makefile patch to use global gateway actually work
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-02-27 11:15:55 +01:00
Jeromy
65519a0367 move gopath check to separate script and use realpath for symlink handling
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-23 22:26:37 -08:00