News for hackers. Stuff that matters.
Re:Ask HN: In what creative ways are you using Makefiles? by richardknop on Monday July 24, 2017 @05:58AM (#14837119)
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

Re:Ask HN: In what creative ways are you using Makefiles? by koolba on Monday July 24, 2017 @07:12AM (#14837446)
I 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.

Re:Ask HN: In what creative ways are you using Makefiles? by zweicoder on Thursday July 27, 2017 @05:32AM (#14863760)
Late 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) but just curious to know why so many people prefer makefiles.

Re:Ask HN: In what creative ways are you using Makefiles? by leipert on Monday July 24, 2017 @07:00AM (#14837377)
We 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.

Re:Ask HN: In what creative ways are you using Makefiles? by lunch on Monday July 24, 2017 @12:10PM (#14839661)
I 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.

Re:Ask HN: In what creative ways are you using Makefiles? by codebeaker on Monday July 24, 2017 @06:32AM (#14837254)
are you me?