A better way to use Makefiles
C++ C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
libs
project
submodule
Makefile
README
TODO

README

Advantages

- Full dependency handling, no phantom rebuilds.
- Can keep different configurations simultaneously: debug, test, release, etc.
- Can build source on a read-only medium: OBJDIR=/tmp/obj


How To Use

- Copy project/scripts directory to your application.
- Create your application's Makefile based on project/Makefile.
- Run 'make' or 'make CONFIG=debug'.  Everything should just work.


Thoughts

Q: Why create custom variables (CFLAGS_debug += -DABC) when gmake provides
target-specific variables (debug: CFLAGS += -DABC) that should do the same
thing?

A: Because sometimes you need to access a configuration's variables
outside of its context.  gmake doesn't offer any way to do this.