Changeset b8fac76 in mainline


Ignore:
Timestamp:
2014-08-27T23:05:51Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d427a3
Parents:
57292d3
Message:

Add buildsystem rules for building and cleaning autogens.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r57292d3 rb8fac76  
    6666SIZEOK_MAP = generic/src/debug/sizeok_map.o
    6767
    68 .PHONY: all clean
     68.PHONY: all clean autogen_clean
    6969
    7070all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM)
    7171        -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)
    7272
    73 clean:
     73clean: autogen_clean
    7474        rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h
    75         find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
     75        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm '{}' \;
    7676
    7777## Common compiler flags
     
    367367GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
    368368
     369ARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(ARCH_AUTOGENS_AG)))
     370ARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(ARCH_AUTOGENS_AG)))
     371ARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(ARCH_AUTOGENS_AG)))
     372
    369373LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS))
    370374
     
    397401$(LINK): $(LINK).in $(DEPEND)
    398402        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
     403
     404%.h: %.ag
     405        $(AUTOGEN) probe $< >$<.probe.c
     406        $(GCC) $(DEFS) $(GCC_CFLAGS) -S -o $<.probe.s $<.probe.c
     407        $(AUTOGEN) generate $< <$<.probe.s >$@   
    399408
    400409%.o: %.S $(DEPEND)
     
    441450        $(GENMAP) $(MAP_PREV) $(DUMP) $@
    442451
    443 $(DEPEND): $(COMMON_HEADER_ARCH)
     452$(DEPEND): $(COMMON_HEADER_ARCH) $(ARCH_AUTOGENS_H)
    444453        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    445454        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     
    447456$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    448457        ln -sfn ../../../../$< $@
     458
     459autogen_clean:
     460        -rm $(ARCH_AUTOGENS_H) $(ARCH_AUTOGENS_PROBE_C) $(ARCH_AUTOGENS_PROBE_S)
Note: See TracChangeset for help on using the changeset viewer.