Changes in uspace/Makefile.common [2660ee3:e6ae77a] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    r2660ee3 re6ae77a  
    174174endif
    175175
    176 # Flags that are not necessary, and can be overriden, but are used by default.
    177 DEFAULT_CFLAGS = \
    178         -O$(OPTIMIZATION) \
    179         -ffunction-sections \
    180         -pipe \
    181         -Wall \
    182         -Wextra \
    183         -Wno-unused-parameter \
    184         -Wmissing-prototypes \
    185         -Wwrite-strings \
    186         -Werror-implicit-function-declaration
     176COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     177        -ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \
     178        -finput-charset=UTF-8 -D__$(ENDIANESS)__ -fno-common \
     179        -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
     180
     181GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \
     182        -Wno-unused-parameter -Wmissing-prototypes -std=gnu99 \
     183        -Werror-implicit-function-declaration \
     184        -Wwrite-strings -pipe
     185
     186# -Wno-missing-prototypes is there because it warns about main().
     187# This should be fixed elsewhere.
     188CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-typedef-redefinition \
     189        -Wno-missing-prototypes -Wno-unused-command-line-argument \
     190        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
     191        -pipe -fno-stack-protector -fno-PIC
    187192
    188193ifeq ($(CONFIG_DEBUG),y)
    189         DEFAULT_CFLAGS += -Werror
    190 endif
    191 
    192 ifeq ($(COMPILER),clang)
    193         DEFAULT_CFLAGS += \
    194                 -Wno-missing-field-initializers \
    195                 -Wno-typedef-redefinition \
    196                 -Wno-unused-command-line-argument
    197 else
    198         DEFAULT_CFLAGS += \
    199                 -Wno-clobbered
     194        COMMON_CFLAGS += -Werror
    200195endif
    201196
    202197ifeq ($(CONFIG_LINE_DEBUG),y)
    203         DEFAULT_CFLAGS += -ggdb
    204 endif
    205 
    206 # Flags that should always be used, even for third-party software.
    207 COMMON_CFLAGS = \
    208         -ffreestanding \
    209         -nostdlib \
    210         -nostdinc \
    211         -D__$(ENDIANESS)__
    212 
    213 # Flags that are always used for HelenOS code, but not for third-party.
    214 HELENOS_CFLAGS = \
    215         -std=gnu99 \
    216         $(INCLUDES_FLAGS) \
    217         -imacros $(CONFIG_HEADER) \
    218         -D_HELENOS_SOURCE \
    219         -fexec-charset=UTF-8 \
    220         -finput-charset=UTF-8 \
    221         -fno-common \
    222         -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
    223 
    224 # TODO: Use a different name.
    225 # CFLAGS variable is traditionally used for overridable flags.
    226 CFLAGS = $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS)
     198        GCC_CFLAGS += -ggdb
     199        CLANG_CFLAGS += -g
     200endif
    227201
    228202## Setup platform configuration
     
    242216endif
    243217
     218ifeq ($(COMPILER),clang)
     219        CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)
     220else
     221        CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
     222endif
     223
    244224ifeq ($(CONFIG_STRIP_BINARIES),y)
    245225        LFLAGS += --strip-all
     
    266246all-test: $(TEST_OUTPUTS)
    267247
    268 clean: fasterclean
     248clean:
     249        rm -f $(JOB) $(OUTPUTS) $(EXTRA_CLEAN) tag deps.mk
    269250        find . -name '*.o' -follow -exec rm \{\} \;
    270251        find . -name '*.lo' -follow -exec rm \{\} \;
     
    272253
    273254fasterclean:
    274         rm -rf $(JOB) $(OUTPUTS) $(EXTRA_CLEAN) tag deps.mk
     255        rm -f $(JOB) $(OUTPUTS) $(EXTRA_CLEAN) tag deps.mk
    275256
    276257depend: $(PRE_DEPEND)
Note: See TracChangeset for help on using the changeset viewer.