Changes in kernel/Makefile [4761f54:fe171357] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r4761f54 rfe171357  
    5959
    6060GENMAP = tools/genmap.py
    61 JOBFILE = $(ROOT_PATH)/tools/jobfile.py
    6261
    6362LINK = arch/$(KARCH)/_link.ld
    6463EMPTY_MAP = generic/src/debug/empty_map.o
    6564SIZEOK_MAP = generic/src/debug/sizeok_map.o
     65
     66ifeq ($(PRECHECK),y)
     67        JOBFILE = $(ROOT_PATH)/tools/jobfile.py
     68        # XXX: Do not change the order of arguments.
     69        CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
     70else
     71        CC_JOB = $(CC) $< -o $@
     72endif
    6673
    6774.PHONY: all clean autogen_clean depend
     
    8491COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    8592        -ffreestanding -fno-builtin -nostdlib -nostdinc \
    86         -fexec-charset=UTF-8 -finput-charset=UTF-8
     93        -fexec-charset=UTF-8 -finput-charset=UTF-8 -fno-common \
     94        -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
    8795
    8896GCC_CFLAGS = -std=gnu99 -Wall -Wextra -Wno-unused-parameter \
     
    111119# AFLAGS and LFLAGS must be initialized before the inclusion.
    112120#
    113 AFLAGS =
    114 LFLAGS = -n -T $(LINK) -M --fatal-warnings
    115 
    116 # FIXME: This condition is a workaround for issues #693 and #694.
    117 ifneq ($(KARCH),sparc64)
    118 ifneq ($(KARCH),mips32)
    119         AFLAGS += --fatal-warnings
    120 endif
     121AFLAGS = --fatal-warnings
     122LFLAGS = -n -T $(LINK) -M --fatal-warnings --warn-common
     123
     124ifeq ($(CONFIG_STRIP_BINARIES),y)
     125        LFLAGS += --strip-all
    121126endif
    122127
     
    392397        $(LD) $(LFLAGS) -Map $(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS)
    393398endif
    394 ifeq ($(CONFIG_STRIP_BINARIES),y)
    395         $(STRIP) $(RAW)
    396 endif
    397399
    398400$(LINK): $(LINK).in | depend
     
    405407
    406408%.o: %.S | depend
    407         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    408 ifeq ($(PRECHECK),y)
    409         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
    410 endif
     409        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
    411410
    412411%.o: %.s | depend
    413         $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<
    414 ifeq ($(PRECHECK),y)
    415         $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
    416 endif
     412        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__
    417413
    418414%.o: %.c | depend
    419         $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $<
    420 ifeq ($(PRECHECK),y)
    421         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)
    422 endif
     415        $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION))
    423416
    424417$(REAL_MAP).o: $(REAL_MAP).bin
     
    458451        done
    459452
    460 depend: $(COMMON_HEADER_ARCH) $(AUTOGENS_H)
    461 
    462 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    463         ln -sfn ../../../../$< $@
     453depend: $(AUTOGENS_H)
    464454
    465455autogen_clean:
Note: See TracChangeset for help on using the changeset viewer.