5 ms·
I use Makefile as a wrapper for build / test bash commands. For example I often define these targets: - make test : run the entire test suite on local environm
by richardknop 9y ago
I use Makefile as a wrapper for build / test bash commands. For example I often define these targets:
- make test : run the entire test suite on local environment
- make ci : run the whole test suite (using docker compose so this can easily be executed by any CI server without having to install anything other than docker and docker-compose) and generate code coverage report, use linter tools to check code standards
- make install-deps : installs dependencies for current project
- make update-deps : will check if there is a newer version of dependencies available and install it
- make fmt : formats the code (replace spaces for tabs or vice-versa, remove additional whitespaces from beginning/end of files etc)
- make build : would compile and build a binary for current platform, I would also defined platform specific sub commands like make build-linux or make build-windows
- codebeaker 9y agoare you me?
- deleted 9y ago[deleted]
- leipert 9y agoWe handle it pretty similar at work, to have consistent commands over all repositories regardless of language. Additional targets are - make docker-build - make docker-test which are essentially wrappers around build/test, just in docker.
- koolba 9y agoI have the exact same usage, generally with the same names too. It's great for going back to a project you haven't touched in months/years and then typing "make" to build it regardless of the language or tool chain.
- lunch 9y agoI more or less use the same targets, with one more that I've been using for the past couple years: - make dev: stops, builds, and runs the code locally in a Docker container.
- zweicoder 9y agoLate to the thread, but just wondering why are so many people using makefiles instead of say bash scripts? I personally achieve the same result with a homebrew solution that uses bash exclusively (https://github.com/zweicoder/magic https://github.com/zweicoder/magic) but just curious to know why so many people prefer makefiles.