Changes in uspace/Makefile.common [a41cda7:94c5bc1] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    ra41cda7 r94c5bc1  
    160160LIBNETTL_PREFIX = $(LIB_PREFIX)/nettl
    161161
    162 AFLAGS =
     162AFLAGS = --fatal-warnings
    163163LFLAGS = --fatal-warnings
    164 
    165 # FIXME: This condition is a workaround for issues #692 and #693.
    166 ifneq ($(KARCH),ia64)
    167 ifneq ($(KARCH),mips32)
    168         AFLAGS += --fatal-warnings
    169 endif
    170 endif
    171164
    172165ifeq ($(STATIC_NEEDED),y)
     
    210203endif
    211204
     205ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
     206        OPTIMIZATION = s
     207else
     208        OPTIMIZATION = 3
     209endif
     210
    212211# PCUT-based unit tests
    213212ifneq ($(TEST_SOURCES),)
     
    235234        find . -name '*.lo' -follow -exec rm \{\} \;
    236235
    237 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    238         -ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \
    239         -finput-charset=UTF-8 -D__$(ENDIANESS)__
    240 
    241 GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \
    242         -Wno-unused-parameter -Wmissing-prototypes -std=gnu99 \
    243         -Werror-implicit-function-declaration \
    244         -Wwrite-strings -pipe
    245 
    246 ICC_CFLAGS = -Wall -Wextra -Wno-clobbered -Wno-unused-parameter \
    247         -Wmissing-prototypes -Werror-implicit-function-declaration \
    248         -Wwrite-strings -pipe
    249 
    250 # -Wno-missing-prototypes is there because it warns about main().
    251 # This should be fixed elsewhere.
    252 CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-typedef-redefinition \
    253         -Wno-missing-prototypes -Wno-unused-command-line-argument \
     236GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     237        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     238        -finput-charset=UTF-8 -ffreestanding -fno-builtin -ffunction-sections \
     239        -nostdlib -nostdinc -Wall -Wextra -Wno-clobbered -Wno-unused-parameter \
     240        -Wmissing-prototypes -std=gnu99 -Werror-implicit-function-declaration \
     241        -Wwrite-strings -pipe -ggdb -D__$(ENDIANESS)__
     242
     243ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     244        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     245        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     246        -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \
     247        -Werror-implicit-function-declaration -Wwrite-strings \
     248        -pipe -g -D__$(ENDIANESS)__
     249
     250# clang does not support following options but I am not sure whether
     251# something won't break because of that:
     252# -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
     253CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     254        -ffreestanding -fno-builtin -nostdlib -nostdinc \
     255        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    254256        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    255         -pipe -fno-stack-protector -fno-PIC
     257        -integrated-as -pipe -g -target $(CLANG_TARGET) -D__$(ENDIANESS)__
     258
     259LIB_CFLAGS = $(CFLAGS) -fPIC
     260LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
    256261
    257262ifeq ($(CONFIG_DEBUG),y)
    258         COMMON_CFLAGS += -Werror
     263        GCC_CFLAGS += -Werror
     264        ICC_CFLAGS += -Werror
    259265endif
    260266
     
    267273# Prepare for POSIX before including platform specific stuff
    268274ifeq ($(POSIX_COMPAT),y)
    269         CFLAGS += -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
     275        CFLAGS = -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/
    270276        BASE_LIBS = $(LIBPOSIX_PREFIX)/libposixaslibc.a $(LIBPOSIX_PREFIX)/libc4posix.a $(LIBSOFTINT_PREFIX)/libsoftint.a
    271277endif
     
    282288
    283289ifeq ($(COMPILER),gcc_cross)
    284         CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
     290        CFLAGS += $(GCC_CFLAGS)
    285291        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    286292endif
    287293
    288294ifeq ($(COMPILER),gcc_helenos)
    289         CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
     295        CFLAGS += $(GCC_CFLAGS)
    290296        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    291297endif
    292298
    293299ifeq ($(COMPILER),gcc_native)
    294         CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
     300        CFLAGS += $(GCC_CFLAGS)
    295301        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    296302endif
    297303
    298304ifeq ($(COMPILER),icc)
    299         CFLAGS += $(COMMON_CFLAGS) $(ICC_CFLAGS)
     305        CFLAGS += $(ICC_CFLAGS)
    300306        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    301307endif
    302308
    303309ifeq ($(COMPILER),clang)
    304         CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)
     310        CFLAGS += $(CLANG_CFLAGS)
    305311        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    306312endif
    307 
    308 LIB_CFLAGS = $(CFLAGS) -fPIC
    309 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive
    310313
    311314ifneq ($(MAKECMDGOALS),clean)
    312315-include $(DEPEND)
    313316endif
    314 
    315 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    316 LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS))
    317317
    318318OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
     
    378378
    379379%.o: %.S $(DEPEND)
    380         $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
     380        $(GCC) $(DEFS) $(GCC_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
    381381ifeq ($(PRECHECK),y)
    382382        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    384384
    385385%.o: %.s $(DEPEND)
    386         $(CC) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
     386        $(AS) $(AFLAGS) -o $@ $<
    387387ifeq ($(PRECHECK),y)
    388388        $(JOBFILE) $(JOB) $< $@ as asm
     
    402402
    403403%.lo: %.S $(DEPEND)
    404         $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
     404        $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__ -c $< -o $@
    405405ifeq ($(PRECHECK),y)
    406406        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) -D__ASM__
     
    408408
    409409%.lo: %.s $(DEPEND)
    410         $(CC) $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
     410        $(AS) $(AFLAGS) -o $@ $<
    411411ifeq ($(PRECHECK),y)
    412412        $(JOBFILE) $(JOB) $< $@ as asm
Note: See TracChangeset for help on using the changeset viewer.