Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use CPPFLAGS instead of INCLUDE in compile targets #6159

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Jan 17, 2024

With this, CFLAGS and CPPFLAGS are used when compiling and LDFLAGS when
linking, just like in the built-in GNU make rules. From make -p:

COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)

Note: It is unclear where the INCLUDE variable comes from; it is not
documented in autoconf nor GNU make and automake (which itself is not
used in this repository) only mentions INCLUDES:

`INCLUDES`
     This does the same job as `AM_CPPFLAGS` (or any per-target
     `_CPPFLAGS` variable if it is used).  It is an older name for
     the same functionality.  This variable is deprecated; we
     suggest using `AM_CPPFLAGS` and per-target `_CPPFLAGS` instead.

Environment: automake 1.16.5-2 and GNU make 4.4.1 on Artix Linux.

See also commit 671c3f2 ("build: actually set LDFLAGS and LIBS in
makefiles", 2022-11-30) / PR #5504.

With this, CFLAGS and CPPFLAGS are used when compiling and LDFLAGS when
linking, just like in the built-in GNU make rules.  From `make -p`:

    COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
    LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
    LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)

Note: It is unclear where the `INCLUDE` variable comes from; it is not
documented in autoconf nor GNU make and automake (which itself is not
used in this repository) only mentions `INCLUDES`:

    `INCLUDES`
         This does the same job as `AM_CPPFLAGS` (or any per-target
         `_CPPFLAGS` variable if it is used).  It is an older name for
         the same functionality.  This variable is deprecated; we
         suggest using `AM_CPPFLAGS` and per-target `_CPPFLAGS` instead.

Environment: automake 1.16.5-2 and GNU make 4.4.1 on Artix Linux.

See also commit 671c3f2 ("build: actually set LDFLAGS and LIBS in
makefiles", 2022-11-30) / PR netblue30#5504.
@kmk3 kmk3 merged commit c85aa85 into netblue30:master Jan 20, 2024
13 checks passed
@kmk3 kmk3 deleted the build-use-cppflags branch January 20, 2024 20:41
kmk3 added a commit that referenced this pull request Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

1 participant