Changeset 6ecf5b8 in mainline for kernel/Makefile


Ignore:
Timestamp:
2012-10-24T02:11:42Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aebcd42
Parents:
b800b0e
Message:

Prevent compile-time symlinks in kernel

So far, architecture specific headers for kernel were in
kernel/arch/$ARCH/include directory.
From kernel sources, they were referenced as arch/header.h.

For example, file kernel/arch/$ARCH/include/whatever.h
was included with <arch/whatever.h>.

To allow that, a symbolic link with name `arch' pointing
to the correct `include/' was created during compilation.

This change adds one arch/ directory and instead of
creating a symbolic link for each compilation, -I flag
was added to the compiler (the header mentioned above would
now reside in kernel/arch/$ARCH/include/arch/whatever.h).

The same goes for genarch/ includes.

This change would be followed by similar changes in userspace
and ABI. To overall goal is to simplify job of documenation
generators or IDEs that might have problems with the dynamically
created symbolic links.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rb800b0e r6ecf5b8  
    3636COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    3737COMMON_HEADER = $(ROOT_PATH)/common.h
    38 COMMON_HEADER_ARCH = arch/$(KARCH)/include/common.h
     38COMMON_HEADER_ARCH = arch/$(KARCH)/include/arch/common.h
    3939
    4040CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     
    6060
    6161ABI_INCLUDE = generic/include/abi
    62 ARCH_INCLUDE = generic/include/arch
    63 GENARCH_INCLUDE = generic/include/genarch
    6462
    6563GENMAP = tools/genmap.py
     
    7674
    7775clean:
    78         rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ABI_INCLUDE) $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld arch/*/include/common.h
     76        rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ABI_INCLUDE) arch/*/_link.ld arch/*/include/arch/common.h
    7977        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
    8078
     
    8280#
    8381
    84 INCLUDES = generic/include
     82INCLUDES = generic/include genarch/include arch/$(KARCH)/include
     83INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
    8584
    8685ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
     
    9291DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    9392
    94 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     93GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    9594        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    9695        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     
    9998        -pipe
    10099
    101 ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     100ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    102101        -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    103102        -Werror-implicit-function-declaration -wd170
    104103
    105 CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     104CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    106105        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    107106        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     
    435434        $(GENMAP) $(MAP_PREV) $(DUMP) $@
    436435
    437 $(DEPEND): $(ABI_INCLUDE) $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH)
     436$(DEPEND): $(ABI_INCLUDE) $(COMMON_HEADER_ARCH)
    438437        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    439438        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     
    442441        ln -sfn ../../$< $@
    443442
    444 $(ARCH_INCLUDE): arch/$(KARCH)/include/
    445         ln -sfn ../../$< $@
    446 
    447 $(GENARCH_INCLUDE): genarch/include/
    448         ln -sfn ../../$< $@
    449 
    450443$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    451         ln -sfn ../../../$< $@
     444        ln -sfn ../../../../$< $@
Note: See TracChangeset for help on using the changeset viewer.