Changeset 147a066 in mainline for kernel/Makefile


Ignore:
Timestamp:
2016-05-10T06:32:18Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2889634
Parents:
7ba16eb
Message:

Generate dependency rules between autogenerated headers automatically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r7ba16eb r147a066  
    4848#
    4949
     50AGDEPEND = Makefile.ag.depend
    5051DEPEND = Makefile.depend
    5152DEPEND_PREV = $(DEPEND).prev
     
    138139-include genarch/Makefile.inc
    139140-include $(DEPEND)
     141-include $(AGDEPEND)
    140142
    141143## The at-sign
     
    385387ARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(ARCH_AUTOGENS_AG)))
    386388
     389AUTOGENS_H := $(ARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_H)
     390AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG)
     391
    387392LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS))
    388393
     
    464469        $(GENMAP) $(MAP_PREV) $(DUMP) $@
    465470
    466 $(DEPEND): $(COMMON_HEADER_ARCH) $(ARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_H)
     471$(AUTOGENS_H): $(AGDEPEND)
     472
     473$(AGDEPEND): $(AUTOGENS_AG)
     474        touch $@
     475        for g in $?; do \
     476                h=`dirname $$g`/`basename $$g .ag`.h; \
     477                for l in `$(AUTOGEN) depend $$g`; do \
     478                        echo "$$h: $$l" >>$@; \
     479                done \
     480        done
     481
     482$(DEPEND): $(COMMON_HEADER_ARCH) $(AUTOGENS_H)
    467483        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    468484        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     
    474490        -rm $(ARCH_AUTOGENS_H) $(ARCH_AUTOGENS_PROBE_C) $(ARCH_AUTOGENS_PROBE_S)
    475491        -rm $(GENARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_PROBE_C) $(GENARCH_AUTOGENS_PROBE_S)
     492        -rm $(AGDEPEND)
Note: See TracChangeset for help on using the changeset viewer.