Changes in kernel/Makefile [a41cda7:4d6629f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
ra41cda7 r4d6629f 82 82 INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES)) 83 83 84 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y) 85 OPTIMIZATION = s 86 else 87 OPTIMIZATION = 3 88 endif 89 84 90 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 85 91 86 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 92 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 93 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ 94 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 95 -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \ 96 -Werror-implicit-function-declaration -Wwrite-strings \ 97 -pipe 98 99 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 100 -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \ 101 -Werror-implicit-function-declaration -wd170 102 103 # clang does not support following options but I am not sure whether 104 # something won't break because of that: 105 # -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8 106 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 87 107 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 88 -fexec-charset=UTF-8 -finput-charset=UTF-8 89 90 GCC_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \ 91 -Wmissing-prototypes -Werror-implicit-function-declaration \ 92 -Wwrite-strings -pipe 93 94 ICC_CFLAGS = -Wall -Wmissing-prototypes \ 95 -Werror-implicit-function-declaration -wd170 96 97 CLANG_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \ 98 -Wno-missing-field-initializers -Wno-unused-command-line-argument \ 99 -Wmissing-prototypes -Werror-implicit-function-declaration \ 100 -Wwrite-strings -pipe -fno-stack-protector -fno-PIC 108 -std=gnu99 -Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \ 109 -Werror-implicit-function-declaration -Wwrite-strings \ 110 -integrated-as -pipe -target $(CLANG_TARGET) 101 111 102 112 ifeq ($(CONFIG_DEBUG),y) 103 COMMON_CFLAGS += -Werror 113 GCC_CFLAGS += -Werror 114 ICC_CFLAGS += -Werror 104 115 endif 105 116 106 117 ifeq ($(CONFIG_LTO),y) 107 COMMON_CFLAGS += -flto118 GCC_CFLAGS += -flto 108 119 endif 109 120 110 121 ifeq ($(CONFIG_LINE_DEBUG),y) 111 COMMON_CFLAGS += -g 122 GCC_CFLAGS += -g 123 ICC_CFLAGS += -g 124 CLANG_CFLAGS += -g 112 125 endif 113 126 … … 116 129 # AFLAGS and LFLAGS must be initialized before the inclusion. 117 130 # 118 AFLAGS = 131 AFLAGS = --fatal-warnings 119 132 LFLAGS = -n -T $(LINK) -M --fatal-warnings 120 121 # FIXME: This condition is a workaround for issues #693 and #694.122 ifneq ($(KARCH),sparc64)123 ifneq ($(KARCH),mips32)124 AFLAGS += --fatal-warnings125 endif126 endif127 133 128 134 # … … 156 162 157 163 ifeq ($(COMPILER),gcc_native) 158 CFLAGS = $( COMMON_CFLAGS) $(GCC_CFLAGS)164 CFLAGS = $(GCC_CFLAGS) 159 165 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 160 166 INSTRUMENTATION = -finstrument-functions … … 162 168 163 169 ifeq ($(COMPILER),gcc_cross) 164 CFLAGS = $( COMMON_CFLAGS) $(GCC_CFLAGS)170 CFLAGS = $(GCC_CFLAGS) 165 171 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 166 172 INSTRUMENTATION = -finstrument-functions … … 168 174 169 175 ifeq ($(COMPILER),gcc_helenos) 170 CFLAGS = $( COMMON_CFLAGS) $(GCC_CFLAGS)176 CFLAGS = $(GCC_CFLAGS) 171 177 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 172 178 INSTRUMENTATION = -finstrument-functions … … 174 180 175 181 ifeq ($(COMPILER),icc) 176 CFLAGS = $( COMMON_CFLAGS) $(ICC_CFLAGS)182 CFLAGS = $(ICC_CFLAGS) 177 183 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 178 184 INSTRUMENTATION = … … 180 186 181 187 ifeq ($(COMPILER),clang) 182 CFLAGS = $(C OMMON_CFLAGS) $(CLANG_CFLAGS)188 CFLAGS = $(CLANG_CFLAGS) 183 189 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 184 INSTRUMENTATION = -finstrument-functions190 INSTRUMENTATION = 185 191 endif 186 192 … … 384 390 AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG) 385 391 386 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS)) 387 LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS)) 388 389 ifeq ($(COMPILER),clang) 390 AS_CFLAGS += -mllvm -asm-macro-max-nesting-depth=1000 391 endif 392 LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS)) 392 393 393 394 ifeq ($(CONFIG_SYMTAB),y) … … 409 410 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) 410 411 ifeq ($(CONFIG_LTO),y) 411 $( CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)412 $(GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) 412 413 else 413 414 $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) … … 422 423 %.h: %.ag 423 424 $(AUTOGEN) probe $< >$<.probe.c 424 $(CC _AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c425 $(CC) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c 425 426 $(AUTOGEN) generate $< <$<.probe.s >$@ 426 427 427 428 %.o: %.S $(DEPEND) 428 $( CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<429 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c -o $@ $< 429 430 ifeq ($(PRECHECK),y) 430 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $( CFLAGS) -D__ASM__431 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(GCC_CFLAGS) -D__ASM__ 431 432 endif 432 433 433 434 %.o: %.s $(DEPEND) 434 $( CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c-o $@ $<435 $(AS) $(AFLAGS) -o $@ $< 435 436 ifeq ($(PRECHECK),y) 436 437 $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) … … 444 445 445 446 $(REAL_MAP).o: $(REAL_MAP).bin 446 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $( CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $@ -447 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 447 448 448 449 $(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) 449 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $( CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(EMPTY_MAP) -450 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(AS) $(AFLAGS) -o $(EMPTY_MAP) 450 451 ifeq ($(CONFIG_LTO),y) 451 $( CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)452 $(GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) 452 453 else 453 454 $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) … … 459 460 # on architectures that have bss after symtab 460 461 461 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $( CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(SIZEOK_MAP) -462 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(AS) $(AFLAGS) -o $(SIZEOK_MAP) 462 463 ifeq ($(CONFIG_LTO),y) 463 $( CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)464 $(GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) 464 465 else 465 466 $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)
Note:
See TracChangeset
for help on using the changeset viewer.