hdctools: build: fix CFLAGS/CPPFLAGS handling, and unify compile/link steps

We shouldn't ignore the CFLAGS from the build env, so use ?= to initialize
the -O2 -g settings.

CPPFLAGS is for preprocessor flags like -D/-I, so use that variable for
those settings and split them out of CFLAGS completely.  This also lets
us respect the build env CPPFLAGS settings.

Since none of the current compile rules respect CPPFLAGS, we have to fix
that.  But rather than just adding $(CPPFLAGS) everywhere, unify these
compile steps into a single COMPILE.c variable.  And since that looks
pretty, go ahead and unify all the link steps into a single LINK.c too.

TEST=`emerge hdctools` still works and installs same files

Change-Id: Iac9381462a0f4d74e936f37a01bf48ee0b7f6a65
Reviewed-on: https://gerrit.chromium.org/gerrit/18289
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
5 files changed