Changes in kernel/Makefile [4d6629f:a41cda7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r4d6629f ra41cda7 82 82 INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES)) 83 83 84 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)85 OPTIMIZATION = s86 else87 OPTIMIZATION = 388 endif89 90 84 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 91 85 92 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \93 -f exec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS)\94 -f input-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 - pipe98 99 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 100 -ffreestanding -fno-builtin -nostdlib -nostdinc-Wall -Wmissing-prototypes \86 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 87 -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 \ 101 95 -Werror-implicit-function-declaration -wd170 102 96 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) \ 107 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 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) 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 111 101 112 102 ifeq ($(CONFIG_DEBUG),y) 113 GCC_CFLAGS += -Werror 114 ICC_CFLAGS += -Werror 103 COMMON_CFLAGS += -Werror 115 104 endif 116 105 117 106 ifeq ($(CONFIG_LTO),y) 118 GCC_CFLAGS += -flto107 COMMON_CFLAGS += -flto 119 108 endif 120 109 121 110 ifeq ($(CONFIG_LINE_DEBUG),y) 122 GCC_CFLAGS += -g 123 ICC_CFLAGS += -g 124 CLANG_CFLAGS += -g 111 COMMON_CFLAGS += -g 125 112 endif 126 113 … … 129 116 # AFLAGS and LFLAGS must be initialized before the inclusion. 130 117 # 131 AFLAGS = --fatal-warnings118 AFLAGS = 132 119 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-warnings 125 endif 126 endif 133 127 134 128 # … … 162 156 163 157 ifeq ($(COMPILER),gcc_native) 164 CFLAGS = $( GCC_CFLAGS)158 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 165 159 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 166 160 INSTRUMENTATION = -finstrument-functions … … 168 162 169 163 ifeq ($(COMPILER),gcc_cross) 170 CFLAGS = $( GCC_CFLAGS)164 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 171 165 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 172 166 INSTRUMENTATION = -finstrument-functions … … 174 168 175 169 ifeq ($(COMPILER),gcc_helenos) 176 CFLAGS = $( GCC_CFLAGS)170 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 177 171 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 178 172 INSTRUMENTATION = -finstrument-functions … … 180 174 181 175 ifeq ($(COMPILER),icc) 182 CFLAGS = $( ICC_CFLAGS)176 CFLAGS = $(COMMON_CFLAGS) $(ICC_CFLAGS) 183 177 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 184 178 INSTRUMENTATION = … … 186 180 187 181 ifeq ($(COMPILER),clang) 188 CFLAGS = $(C LANG_CFLAGS)182 CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS) 189 183 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 190 INSTRUMENTATION = 184 INSTRUMENTATION = -finstrument-functions 191 185 endif 192 186 … … 390 384 AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG) 391 385 392 LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS)) 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 393 392 394 393 ifeq ($(CONFIG_SYMTAB),y) … … 410 409 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) 411 410 ifeq ($(CONFIG_LTO),y) 412 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)411 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) 413 412 else 414 413 $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) … … 423 422 %.h: %.ag 424 423 $(AUTOGEN) probe $< >$<.probe.c 425 $(CC ) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c424 $(CC_AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c 426 425 $(AUTOGEN) generate $< <$<.probe.s >$@ 427 426 428 427 %.o: %.S $(DEPEND) 429 $( GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c -o $@ $<428 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 430 429 ifeq ($(PRECHECK),y) 431 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $( GCC_CFLAGS) -D__ASM__430 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__ 432 431 endif 433 432 434 433 %.o: %.s $(DEPEND) 435 $( AS) $(AFLAGS)-o $@ $<434 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 436 435 ifeq ($(PRECHECK),y) 437 436 $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) … … 445 444 446 445 $(REAL_MAP).o: $(REAL_MAP).bin 447 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $( AS) $(AFLAGS) -o $@446 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$<\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $@ - 448 447 449 448 $(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) 450 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $( AS) $(AFLAGS) -o $(EMPTY_MAP)449 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(EMPTY_MAP) - 451 450 ifeq ($(CONFIG_LTO),y) 452 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP)451 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) 453 452 else 454 453 $(LD) $(LFLAGS) -Map $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) … … 460 459 # on architectures that have bss after symtab 461 460 462 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $( AS) $(AFLAGS) -o $(SIZEOK_MAP)461 echo "$(AS_PROLOG)""$(SYMTAB_SECTION)"" .incbin \"$@\"" | $(CC) $(CFLAGS) $(AS_CFLAGS) -x assembler -c -o $(SIZEOK_MAP) - 463 462 ifeq ($(CONFIG_LTO),y) 464 $( GCC) $(LFLAGS_LTO) -Xlinker -Map -Xlinker $(MAP_PREV) $(DEFS) $(GCC_CFLAGS) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP)463 $(CC) $(DEFS) $(CFLAGS) $(LD_CFLAGS) -Xlinker -Map -Xlinker $(MAP_PREV) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) 465 464 else 466 465 $(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.