Changeset 4761f54 in mainline for kernel/Makefile
- Timestamp:
- 2017-10-21T04:41:07Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c14309
- Parents:
- feab36ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
rfeab36ae r4761f54 49 49 50 50 AGDEPEND = Makefile.ag.depend 51 DEPEND = Makefile.depend52 DEPEND_PREV = $(DEPEND).prev53 51 RAW = kernel.raw 54 52 BIN = kernel.bin … … 67 65 SIZEOK_MAP = generic/src/debug/sizeok_map.o 68 66 69 .PHONY: all clean autogen_clean 67 .PHONY: all clean autogen_clean depend 70 68 71 69 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM) 72 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)73 70 74 71 clean: autogen_clean 75 rm -f $( DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h72 rm -f $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h 76 73 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm '{}' \; 74 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.d' -follow -exec rm '{}' \; 77 75 78 76 ## Common compiler flags … … 129 127 -include arch/$(KARCH)/Makefile.inc 130 128 -include genarch/Makefile.inc 131 -include $(DEPEND)132 129 -include $(AGDEPEND) 133 130 … … 152 149 # 153 150 154 ifeq ($(COMPILER),gcc_native)155 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)156 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)157 INSTRUMENTATION = -finstrument-functions158 endif159 160 ifeq ($(COMPILER),gcc_cross)161 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)162 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)163 INSTRUMENTATION = -finstrument-functions164 endif165 166 ifeq ($(COMPILER),gcc_helenos)167 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS)168 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)169 INSTRUMENTATION = -finstrument-functions170 endif171 172 151 ifeq ($(COMPILER),clang) 173 152 CFLAGS = $(COMMON_CFLAGS) $(CLANG_CFLAGS) 174 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 175 INSTRUMENTATION = -finstrument-functions 176 endif 177 153 else 154 CFLAGS = $(COMMON_CFLAGS) $(GCC_CFLAGS) 155 endif 156 157 INSTRUMENTATION = -finstrument-functions 178 158 179 159 ## Generic kernel sources … … 364 344 GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) 365 345 346 GENERIC_DEPENDS := $(addsuffix .d,$(basename $(GENERIC_SOURCES))) 347 ARCH_DEPENDS := $(addsuffix .d,$(basename $(ARCH_SOURCES))) 348 GENARCH_DEPENDS := $(addsuffix .d,$(basename $(GENARCH_SOURCES))) 349 366 350 GENARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(GENARCH_AUTOGENS_AG))) 367 351 GENARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(GENARCH_AUTOGENS_AG))) … … 378 362 LD_CFLAGS := $(addprefix -Xlinker ,$(LFLAGS)) 379 363 364 -include $(GENERIC_DEPENDS) 365 -include $(ARCH_DEPENDS) 366 -include $(GENARCH_DEPENDS) 367 380 368 ifeq ($(COMPILER),clang) 381 369 AS_CFLAGS += -mllvm -asm-macro-max-nesting-depth=1000 … … 408 396 endif 409 397 410 $(LINK): $(LINK).in $(DEPEND)398 $(LINK): $(LINK).in | depend 411 399 $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@ 412 400 … … 416 404 $(AUTOGEN) generate $< <$<.probe.s >$@ 417 405 418 %.o: %.S $(DEPEND)419 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<406 %.o: %.S | depend 407 $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 420 408 ifeq ($(PRECHECK),y) 421 409 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__ 422 410 endif 423 411 424 %.o: %.s $(DEPEND)425 $(CC) $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $<412 %.o: %.s | depend 413 $(CC) -MD $(DEFS) $(CFLAGS) $(AS_CFLAGS) -D__ASM__ -c -o $@ $< 426 414 ifeq ($(PRECHECK),y) 427 415 $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) 428 416 endif 429 417 430 %.o: %.c $(DEPEND)431 $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $<418 %.o: %.c | depend 419 $(CC) -MD $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) $(if $(findstring $<,$(INSTRUMENTED_SOURCES)),$(INSTRUMENTATION)) -c -o $@ $< 432 420 ifeq ($(PRECHECK),y) 433 421 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) … … 470 458 done 471 459 472 $(DEPEND): $(COMMON_HEADER_ARCH) $(AUTOGENS_H) 473 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null 474 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@ 460 depend: $(COMMON_HEADER_ARCH) $(AUTOGENS_H) 475 461 476 462 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
Note:
See TracChangeset
for help on using the changeset viewer.