News for hackers. Stuff that matters.
Re:Ask HN: In what creative ways are you using Makefiles? by vortico on Monday July 24, 2017 @06:34AM (#14837269)
Have you made a cross-build system that compiles to all three on a single machine, or that works when run on each of the three? I've been working on a system based on gcc, MinGW64, and osxcross, but if that fails I'll use docker with crossbuild.
Re:Ask HN: In what creative ways are you using Makefiles? by xoroshiro on Monday July 24, 2017 @09:01PM (#14844185)
The Stockfish Makefile is probably the best example of this I've seen. It also does some advanced stuff I'm not sure I understand yet. Profiling, setting flags for CPU instructions and making profile builds, all with support for different C++ compilers. Pretty neat stuff from one of the best chess engines.

https://github.com/official-stockfish/Stockfish/blob/master/...

Re:Ask HN: In what creative ways are you using Makefiles? by analogwzrd on Monday July 24, 2017 @11:44AM (#14839401)
I'm taking a grad school embedded systems class where we have to maintain a makefile that cross compiles to two different embedded platforms as well as compiles on the host machine.

We're doing it by calling a PLATFORM and using an IF statement in the makefile: make PLATFORM=HOST for example. The makefile then replaces the compiler variable, compiler flags, linker, flags, etc.

Re:Ask HN: In what creative ways are you using Makefiles? by gkya on Monday July 24, 2017 @11:55AM (#14839509)
Linux's makefile is fairly easy to read, and has a very smart way of doing cross platform builds w/ gcc.