A common pattern for building and installing Redis is:
$ make 32bit
$ make install PREFIX=/tmp/whatever
This is not possible now, as changes in some flags may trigger a rebuild. The rebuild is triggered because a change in ARCH / CFLAGS / LDFLAGS / etc requires dependencies to be updated.
This change persists the flags, so they remain the same across runs. When any of the flags change, everything will be rebuilt.
The unstable version of this PR is #456.
Rename ADD_*FLAGS -> REDIS_*FLAGS, REDIS_*FLAGS -> FINAL_*FLAGS
This reflects that REDIS_*FLAGS will only be used for compilation of
Redis and not for its dependencies. Similarly, that FINAL_*FLAGS are
composed of other variables and holds the options that are finally
passed to the compiler and linker.
The lcov target shouldn't clean
This is not needed because every change in compiler/linker flags
triggers a cleanup.
Ignore gcov/lcov artifacts
Question mark assignment is not needed
First set defaults, then do composition
Remove unused LIBS variable
Don't set flags recursively
Persist `make` settings and trigger rebuild if anything changes