Changes in kernel/Makefile [550b4e0:d9faae91] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r550b4e0 rd9faae91  
    3636COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    3737COMMON_HEADER = $(ROOT_PATH)/common.h
    38 COMMON_HEADER_ARCH = arch/$(KARCH)/include/arch/common.h
     38COMMON_HEADER_ARCH = arch/$(KARCH)/include/common.h
    3939
    4040CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     
    5959REAL_MAP = generic/src/debug/real_map
    6060
     61ABI_INCLUDE = generic/include/abi
     62ARCH_INCLUDE = generic/include/arch
     63GENARCH_INCLUDE = generic/include/genarch
     64
    6165GENMAP = tools/genmap.py
    6266JOBFILE = $(ROOT_PATH)/tools/jobfile.py
     
    7276
    7377clean:
    74         rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h
     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
    7579        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
    7680
     
    7882#
    7983
    80 INCLUDES = generic/include genarch/include arch/$(KARCH)/include ../abi/include
    81 INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))
     84INCLUDES = generic/include
    8285
    8386ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
     
    8992DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    9093
    91 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     94GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    9295        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    9396        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     
    9699        -pipe
    97100
    98 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     101ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    99102        -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    100103        -Werror-implicit-function-declaration -wd170
    101104
    102 # clang does not support following options but I am not sure whether
    103 # something won't break because of that:
    104 # -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) -finput-charset=UTF-8
    105 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    106         -ffreestanding -fno-builtin -nostdlib -nostdinc \
    107         -Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \
     105SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
     106        -xnolib -xc99=all -features=extensions \
     107        -erroff=E_ZERO_SIZED_STRUCT_UNION
     108
     109CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
     110        -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
     111        -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
     112        -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    108113        -Werror-implicit-function-declaration -Wwrite-strings \
    109         -integrated-as \
    110         -pipe -target $(CLANG_TARGET)
     114        -pipe -arch $(CLANG_ARCH)
    111115
    112116ifeq ($(CONFIG_DEBUG),y)
     
    122126        GCC_CFLAGS += -g
    123127        ICC_CFLAGS += -g
     128        SUNCC_CFLAGS += -g
    124129        CLANG_CFLAGS += -g
    125130endif
     
    175180        CFLAGS = $(ICC_CFLAGS)
    176181        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     182        INSTRUMENTATION =
     183endif
     184
     185ifeq ($(COMPILER),suncc)
     186        CFLAGS = $(SUNCC_CFLAGS)
     187        DEFS += $(CONFIG_DEFS)
     188        DEPEND_DEFS = $(DEFS)
    177189        INSTRUMENTATION =
    178190endif
     
    196208        generic/src/console/chardev.c \
    197209        generic/src/console/console.c \
    198         generic/src/console/prompt.c \
    199210        generic/src/cpu/cpu.c \
    200211        generic/src/ddi/ddi.c \
     
    257268        generic/src/ipc/ipc.c \
    258269        generic/src/ipc/sysipc.c \
    259         generic/src/ipc/sysipc_ops.c \
    260         generic/src/ipc/ops/clnestab.c \
    261         generic/src/ipc/ops/conctmeto.c \
    262         generic/src/ipc/ops/concttome.c \
    263         generic/src/ipc/ops/connclone.c \
    264         generic/src/ipc/ops/dataread.c \
    265         generic/src/ipc/ops/datawrite.c \
    266         generic/src/ipc/ops/debug.c \
    267         generic/src/ipc/ops/sharein.c \
    268         generic/src/ipc/ops/shareout.c \
    269         generic/src/ipc/ops/stchngath.c \
    270270        generic/src/ipc/ipcrsc.c \
    271271        generic/src/ipc/irq.c \
     
    390390
    391391$(LINK): $(LINK).in $(DEPEND)
    392         $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
     392        $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
    393393
    394394%.o: %.S $(DEPEND)
     
    435435        $(GENMAP) $(MAP_PREV) $(DUMP) $@
    436436
    437 $(DEPEND): $(COMMON_HEADER_ARCH)
     437$(DEPEND): $(ABI_INCLUDE) $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH)
    438438        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    439439        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
    440440
     441$(ABI_INCLUDE): ../abi/include/
     442        ln -sfn ../../$< $@
     443
     444$(ARCH_INCLUDE): arch/$(KARCH)/include/
     445        ln -sfn ../../$< $@
     446
     447$(GENARCH_INCLUDE): genarch/include/
     448        ln -sfn ../../$< $@
     449
    441450$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    442         ln -sfn ../../../../$< $@
     451        ln -sfn ../../../$< $@
Note: See TracChangeset for help on using the changeset viewer.