Changeset 95c675b in mainline for boot/Makefile.build


Ignore:
Timestamp:
2017-10-17T13:11:35Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60af4cdb
Parents:
dbf32b1 (diff), a416d070 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.build

    rdbf32b1 r95c675b  
    3636DEFS = -DBOOT -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    3737
     38AFLAGS =
    3839LFLAGS = --fatal-warnings
    3940
    40 GCC_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    41         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    42         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    43         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     41# FIXME: This condition is a workaround for issue #693.
     42ifneq ($(BARCH),mips32)
     43        AFLAGS += --fatal-warnings
     44endif
     45
     46COMMON_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     47        -ffreestanding -fno-builtin -nostdlib -nostdinc \
     48        -fexec-charset=UTF-8 -finput-charset=UTF-8
     49
     50GCC_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    4451        -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    4552        -pipe
    4653
    47 ICC_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    48         -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    49         -Werror-implicit-function-declaration -wd170
    50 
    51 CLANG_CFLAGS = $(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    52         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    53         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    54         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     54CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    5555        -Werror-implicit-function-declaration -Wwrite-strings \
    56         -pipe
     56        -pipe  -fno-stack-protector -fno-PIC
    5757
    5858ifeq ($(CONFIG_DEBUG),y)
    59         GCC_CFLAGS += -Werror
    60         ICC_CFLAGS += -Werror
     59        COMMON_CFLAGS += -Werror
    6160endif
    6261
    6362ifeq ($(CONFIG_LINE_DEBUG),y)
    64         GCC_CFLAGS += -g
    65         ICC_CFLAGS += -g
    66         CLANG_CFLAGS += -g
     63        COMMON_CFLAGS += -g
    6764endif
    6865
    6966ifeq ($(COMPILER),gcc_native)
    70         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     67        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    7168        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    7269endif
    7370
    7471ifeq ($(COMPILER),gcc_cross)
    75         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
     72        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    7673        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    7774endif
    7875
    7976ifeq ($(COMPILER),gcc_helenos)
    80         CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    81         DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    82 endif
    83 
    84 
    85 ifeq ($(COMPILER),icc)
    86         CFLAGS = $(ICC_CFLAGS) $(EXTRA_CFLAGS)
     77        CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) $(EXTRA_CFLAGS)
    8778        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    8879endif
    8980
    9081ifeq ($(COMPILER),clang)
    91         CFLAGS = $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
     82        CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS) $(EXTRA_CFLAGS)
    9283        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    9384endif
    9485
    9586OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    96 COMPONENT_OBJECTS := $(addsuffix .co,$(basename $(MODULES)))
    9787
    9888all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BOOT_OUTPUT)
     
    10292        rm -f $(RAW) $(MAP) $(ARCH_INCLUDE) $(GENARCH_INCLUDE)
    10393
     94ifneq ($(MAKECMDGOALS),clean)
    10495-include $(DEPEND)
     96endif
     97
     98AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS))
    10599
    106100$(BOOT_OUTPUT): $(RAW)
    107101        $(OBJCOPY) -O $(BFD_OUTPUT) $< $@
    108102
    109 $(RAW): $(OBJECTS) $(COMPONENT_OBJECTS) $(LINK)
    110         $(LD) -n $(LFLAGS) -T $(LINK) -M -Map $(MAP) -o $@ $(COMPONENT_OBJECTS) $(OBJECTS)
     103$(RAW): $(OBJECTS) $(LINK)
     104        $(LD) -n $(LFLAGS) -T $(LINK) -M -Map $(MAP) -o $@ $(OBJECTS)
    111105
    112 $(LINK): $(LINK).comp $(DEPEND)
    113         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).comp | grep -v "^\#" > $(LINK)
     106$(LINK): $(DEPEND)
     107        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).in | grep -v "^\#" > $(LINK)
    114108
    115109%.o: %.S $(DEPEND)
    116         $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@
     110        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
    117111ifeq ($(PRECHECK),y)
    118112        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     
    125119endif
    126120
    127 $(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH)
     121%.o: %.s $(DEPEND)
     122        $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c $< -o $@
     123ifeq ($(PRECHECK),y)
     124        $(JOBFILE) $(JOB) $< $@ as asm
     125endif
     126
     127$(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH) $(PRE_DEPEND)
    128128        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
    129129        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     130
     131$(COMPS).s: $(COMPS).zip
     132        unzip -p $< $@ > $@
     133
     134$(COMPS).h: $(COMPS).zip
     135        unzip -p $< $@ > $@
     136
     137$(COMPS)_desc.c: $(COMPS).zip
     138        unzip -p $< $@ > $@
     139
     140$(COMPONENTS_DEFLATE): $(COMPS).zip
     141        unzip -p $< $@ > $@
     142
     143$(COMPS).zip: $(COMPONENTS)
     144        $(MKARRAY) --deflate $(COMPS) $(COMP) "$(AS_PROLOG)" ".section .components, \"a\"" $^
     145
     146include Makefile.initrd
    130147
    131148$(ARCH_INCLUDE): arch/$(KARCH)/include/
Note: See TracChangeset for help on using the changeset viewer.