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

Make tup's build more configurable #325

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions Tuprules.tup
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,13 @@ else
CC = gcc
endif

ifeq (@(TUP_DEBUG),y)
CFLAGS += -g
else
CFLAGS += -Os
endif

ifdef AR
AR = @(AR)
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I$(TUP_CWD)/src
ifdef CFLAGS
CFLAGS += @(CFLAGS)
else
AR = ar
endif

CFLAGS += -W
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should put the CFLAGS -W through -fno-common into the group with -I$(TUP_CWD)/src, so that they are always included. IMO these are important warnings that should be included in all profiles.

Since these flags would be before the 'ifdef CFLAGS' line, it is still possible for a user to override certain flags with their tup.config. For example, they could set CONFIG_CFLAGS to -Wno-switch-enum if they wanted to override the default -Wswitch-enum flag.

The 'else' block of the 'ifdef CFLAGS' can just be -O2 for the default optimization, since this is the most common thing that you are changing in the configs/*.config files.

This would also make gcc-dev.config and gcc-dev-lto.config much smaller.

CFLAGS += -Wall
ifeq (@(TUP_WERROR),y)
CFLAGS += -Werror
endif
CFLAGS += -Wbad-function-cast
CFLAGS += -Wcast-align
CFLAGS += -Wcast-qual
Expand All @@ -42,12 +32,13 @@ CFLAGS += -Wstrict-prototypes
CFLAGS += -Wwrite-strings
CFLAGS += -Wswitch-enum
CFLAGS += -fno-common
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I$(TUP_CWD)/src
CFLAGS += -O2
endif

ifeq (@(TUP_32_BIT),y)
CFLAGS += -m32
LDFLAGS += -m32
ifdef AR
AR = @(AR)
else
AR = ar
endif

export PKG_CONFIG_PATH
Expand Down