Changeset 98a4e76 in mainline for kernel/Makefile
- Timestamp:
- 2009-02-12T20:12:51Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 54b2e74
- Parents:
- fa024ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
rfa024ce r98a4e76 33 33 include ../version 34 34 -include ../Makefile.config 35 -include ../config.defs 35 36 36 37 INCLUDES = generic/include 37 38 OPTIMIZATION = 3 38 39 40 ifndef CROSS_PREFIX 41 CROSS_PREFIX = /usr/local 42 endif 43 39 44 ## Common compiler flags 40 45 # 41 46 42 DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" \ 43 -DKERNEL 44 45 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \ 47 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" 48 49 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \ 46 50 -fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \ 47 51 -nostdlib -nostdinc -pipe 48 52 49 ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \53 ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \ 50 54 -fno-builtin -Wall -Wmissing-prototypes -Werror \ 51 55 -nostdlib -nostdinc \ … … 59 63 AFLAGS = 60 64 61 ifdef REVISION 62 DEFS += "-DREVISION=\"$(REVISION)\"" 63 endif 64 65 ifdef TIMESTAMP 66 DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\"" 67 endif 68 69 -include arch/$(ARCH)/Makefile.inc 65 -include arch/$(KARCH)/Makefile.inc 70 66 -include genarch/Makefile.inc 71 67 … … 84 80 # 85 81 SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;" 86 87 ## Setup kernel configuration88 #89 ifeq ($(CONFIG_DEBUG),y)90 DEFS += -DCONFIG_DEBUG91 endif92 93 ifeq ($(CONFIG_LOG),y)94 DEFS += -DCONFIG_LOG95 endif96 97 ifeq ($(CONFIG_KCONSOLE),y)98 DEFS += -DCONFIG_KCONSOLE99 endif100 101 ifeq ($(CONFIG_DEBUG_SPINLOCK),y)102 DEFS += -DCONFIG_DEBUG_SPINLOCK103 endif104 105 ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y)106 DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT107 endif108 109 ifeq ($(CONFIG_FPU_LAZY),y)110 DEFS += -DCONFIG_FPU_LAZY111 endif112 113 ifeq ($(CONFIG_DEBUG_ALLREGS),y)114 DEFS += -DCONFIG_DEBUG_ALLREGS115 endif116 117 ifeq ($(CONFIG_VHPT),y)118 DEFS += -DCONFIG_VHPT119 endif120 121 ifeq ($(CONFIG_TSB),y)122 DEFS += -DCONFIG_TSB123 endif124 125 ifeq ($(CONFIG_Z8530),y)126 DEFS += -DCONFIG_Z8530127 endif128 129 ifeq ($(CONFIG_NS16550),y)130 DEFS += -DCONFIG_NS16550131 endif132 133 ifeq ($(CONFIG_I8042_INTERRUPT_DRIVEN),y)134 DEFS += -DCONFIG_I8042_INTERRUPT_DRIVEN135 endif136 137 ifeq ($(CONFIG_NS16550_INTERRUPT_DRIVEN),y)138 DEFS += -DCONFIG_NS16550_INTERRUPT_DRIVEN139 endif140 141 ifeq ($(CONFIG_IOSAPIC),y)142 DEFS += -DCONFIG_IOSAPIC143 endif144 145 ifeq ($(CONFIG_VIRT_IDX_DCACHE),y)146 DEFS += -DCONFIG_VIRT_IDX_DCACHE147 endif148 149 ifeq ($(CONFIG_FB),y)150 ifeq ($(ARCH),ia32)151 DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)152 DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)153 DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)154 endif155 156 ifeq ($(ARCH),amd64)157 DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)158 DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)159 DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)160 endif161 162 ifeq ($(ARCH),ia32xen)163 DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)164 DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)165 DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)166 endif167 endif168 169 ifeq ($(CONFIG_UDEBUG),y)170 DEFS += -DCONFIG_UDEBUG171 endif172 82 173 83 ## Simple detection for the type of the host system … … 195 105 LIBDIR = /usr/lib 196 106 CFLAGS = $(GCC_CFLAGS) 107 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 197 108 endif 198 109 … … 206 117 LIBDIR = /usr/lib 207 118 CFLAGS = $(ICC_CFLAGS) 119 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 208 120 endif 209 121 … … 217 129 LIBDIR = /usr/lib 218 130 CFLAGS = $(SUNCC_CFLAGS) 131 DEFS += $(CONFIG_DEFS) 132 DEPEND_DEFS = $(DEFS) 219 133 endif 220 134 … … 228 142 LIBDIR = $(TOOLCHAIN_DIR)/lib 229 143 CFLAGS = $(GCC_CFLAGS) 144 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 230 145 endif 231 146 … … 326 241 327 242 ifeq ($(CONFIG_TEST),y) 328 DEFS += -DCONFIG_TEST329 243 CFLAGS += -Itest/ 330 244 GENERIC_SOURCES += \ … … 335 249 test/debug/mips1.c \ 336 250 test/fault/fault1.c \ 337 test/fpu/fpu1.c \338 test/fpu/sse1.c \339 test/fpu/mips2.c \340 251 test/mm/falloc1.c \ 341 252 test/mm/falloc2.c \ … … 354 265 test/thread/thread1.c \ 355 266 test/sysinfo/sysinfo1.c 267 268 ifeq ($(CONFIG_FPU),y) 269 ifeq ($(KARCH),ia32) 270 TEST_FPU1 = y 271 TEST_SSE1 = y 272 endif 273 274 ifeq ($(KARCH),amd64) 275 TEST_FPU1 = y 276 TEST_SSE1 = y 277 endif 278 279 ifeq ($(KARCH),ia64) 280 TEST_FPU1 = y 281 endif 282 283 ifeq ($(KARCH),mips32) 284 TEST_MIPS2 = y 285 endif 286 endif 287 288 ifeq ($(TEST_FPU1),y) 289 GENERIC_SOURCES += test/fpu/fpu1.c 290 else 291 GENERIC_SOURCES += test/fpu/fpu1_skip.c 292 endif 293 294 ifeq ($(TEST_SSE1),y) 295 GENERIC_SOURCES += test/fpu/sse1.c 296 else 297 GENERIC_SOURCES += test/fpu/sse1_skip.c 298 endif 299 300 ifeq ($(TEST_MIPS2),y) 301 GENERIC_SOURCES += test/fpu/mips2.c 302 else 303 GENERIC_SOURCES += test/fpu/mips2_skip.c 304 endif 305 356 306 endif 357 307 … … 362 312 .PHONY: all build clean archlinks depend disasm 363 313 364 all: ../Makefile.config 314 all: ../Makefile.config ../config.h ../config.defs 365 315 -rm Makefile.depend 366 316 $(MAKE) -C . build … … 371 321 372 322 clean: 373 -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$( ARCH)/_link.ld323 -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(KARCH)/_link.ld 374 324 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; 375 325 for arch in arch/* ; do \ … … 378 328 379 329 archlinks: 380 ln -sfn ../../arch/$( ARCH)/include/ generic/include/arch330 ln -sfn ../../arch/$(KARCH)/include/ generic/include/arch 381 331 ln -sfn ../../genarch/include/ generic/include/genarch 382 332 383 333 depend: archlinks 384 -makedepend -f - -- $(DE FS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null385 386 arch/$( ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in334 -makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null 335 336 arch/$(KARCH)/_link.ld: arch/$(KARCH)/_link.ld.in 387 337 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@ 388 338 389 generic/src/debug/real_map.bin: depend arch/$( ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)339 generic/src/debug/real_map.bin: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) 390 340 echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o 391 $(LD) -T arch/$( ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre341 $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre 392 342 $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump 393 343 tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin … … 395 345 # on architectures, that have bss after symtab 396 346 echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o 397 $(LD) -T arch/$( ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre347 $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre 398 348 $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump 399 349 tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin … … 402 352 echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 403 353 404 kernel.raw: depend arch/$( ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o405 $(LD) -T arch/$( ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map354 kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o 355 $(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map 406 356 407 357 kernel.bin: kernel.raw
Note:
See TracChangeset
for help on using the changeset viewer.