tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
164 stars 36 forks source link

Makefile.am: AM_CFLAGS is used implicitly when compiling #9

Closed dilyanpalauzov closed 5 years ago

dilyanpalauzov commented 5 years ago

… like $(CFLAGS), unless the $(CFLAGS) of a target is specified. In the latter case target_CFLAGS needs to include implicitly $(AM_CFLAGS). As the Automake manual states:

Adding ‘prog_CFLAGS = $(AM_CFLAGS)’ is almost a no-op, because when the ‘prog_CFLAGS’ is defined, it is used instead of ‘AM_CFLAGS’. However as a side effect it will cause ‘prog.c’ and ‘foo.c’ to be compiled as ‘prog-prog.$(OBJEXT)’ and ‘prog-foo.$(OBJEXT)’, which solves the issue.

AndreasFuchsTPM commented 5 years ago

Thanks, I'll add that to the backlog for after 1.0.0 because I don't want to roll a new rc for this.

Since it's a no-op, I guess there's no harm, right ?

codecov[bot] commented 5 years ago

Codecov Report

Merging #9 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #9   +/-   ##
=======================================
  Coverage   85.25%   85.25%           
=======================================
  Files           3        3           
  Lines         658      658           
=======================================
  Hits          561      561           
  Misses         97       97

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 44fcb68...e04c5fc. Read the comment docs.

dilyanpalauzov commented 5 years ago

No harm, just code without added value.

If src/libtpm2-totp.c or src/tpm2-totp.c were used at several places as sources, they would have been compiled for each target separately, instead of once for all targets (using every time different set of CFLAGS).