head     1.1;
branch   1.1.1;
access   ;
symbols  proj:1.1.1.1 start:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2006.07.06.10.14.57;  author kaurikim;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2006.07.06.10.14.57;  author kaurikim;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#
# i386/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
# 19990713  Artur Skawina <skawina@@geocities.com>
#           Added '-march' and '-mpreferred-stack-boundary' support
#

LD=$(CROSS_COMPILE)ld -m elf_i386
# -m option is Emulate the emulation linker.


OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
# binary name copy ϴµ sectionname .note .comment -S ī 


LDFLAGS=-e stext
#   ġ stext ɺ


LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)
# -T Ŀ ũƮ  Ͽ ũ϶ .  $(TOPDIR)/arch/i386/vmlinux.lds ũƮ  ̿ؼ ũ


CFLAGS += -pipe
# -pipe  Ҷ  ӽϰ ϸ鼭 Ѵ.  ӵ  ü ִ.


# prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
# Ϸ stack boundary 2 ϸ -mpreferred-stack-boundary=2 ɼ ߰.  ߰.



# Ʒ  ӽ . ӽſ ȭ ̳ʸ  ȭ .
ifdef CONFIG_M386
CFLAGS += -march=i386
endif

ifdef CONFIG_M486
CFLAGS += -march=i486
endif

ifdef CONFIG_M586
CFLAGS += -march=i586
endif

ifdef CONFIG_M586TSC
CFLAGS += -march=i586
endif

ifdef CONFIG_M586MMX
CFLAGS += -march=i586
endif

ifdef CONFIG_M686
CFLAGS += -march=i686
endif

ifdef CONFIG_MPENTIUMIII
CFLAGS += -march=i686
endif

ifdef CONFIG_MPENTIUM4
CFLAGS += -march=i686
endif

ifdef CONFIG_MK6
CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
endif

ifdef CONFIG_MK7
CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi) 
endif

ifdef CONFIG_MCRUSOE
CFLAGS += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
endif

ifdef CONFIG_MWINCHIPC6
CFLAGS += -march=i586
endif

ifdef CONFIG_MWINCHIP2
CFLAGS += -march=i586
endif

ifdef CONFIG_MWINCHIP3D
CFLAGS += -march=i586
endif

ifdef CONFIG_MCYRIXIII
CFLAGS += -march=i486 -malign-functions=0 -malign-jumps=0 -malign-loops=0
endif



HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
# .. ̳    init_task.



SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib
# Ű  κ  丮 Īϴ±.


CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES)
# ׷ ϰ core?  kernel μ úκа ޸  κ core̱.


LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a
# ...  ̺.. string.o ctype.o errno.o  ǥ Ʈ ī̺ Ǿ.  ȭ 
#  ϳ  ڵ带 Ǽ .


ifdef CONFIG_MATH_EMULATION
SUBDIRS += arch/i386/math-emu
DRIVERS += arch/i386/math-emu/math.o
endif
# εҼ  ķƮ    ڵ



arch/i386/kernel: dummy
	$(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel
# $(TOPDIR)/Makefile: linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
	
	

arch/i386/mm: dummy
	$(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm

MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
# -C ɼ 丮 ٲٱ  ɼԴϴ.  arch/i386/Makefile $(TOPDIR)/Makefile includeǱ  
# ̷ -Cɼ ٿ Դϴ.



vmlinux: arch/i386/vmlinux.lds
#  ߿ κ. ld linkҶ ̿ϴ ũƮ Դϴ.


#[root@@server i386]# cat vmlinux.lds 
#/* ld script to make i386 Linux kernel
# * Written by Martin Mares <mj@@atrey.karlin.mff.cuni.cz>;
# */
#OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
# output_format  ũ  elf32-i386

#OUTPUT_ARCH(i386)
#  ŰĴ i386

#ENTRY(_start)
# _start arch/i386/kernel/head.S  Ǿ ֽϴ.   ư text segment  ġ
 

#SECTIONS
#{
#  . = 0xC0000000 + 0x100000;
#  ġ 0xC0000000ε angel պκ  0xC0100000 
# angel angelbootڵ



# Ŀ text segment κ б 
#  _text = .;                    /* Text and read-only data */
#  .text : {
#        *(.text)
#        *(.fixup)
#        *(.gnu.warning)
#        } = 0x9090
#
#  _etext = .;                   /* End of text section */
#  .rodata : { *(.rodata) *(.rodata.*) }
#  .kstrtab : { *(.kstrtab) }
#
#  . = ALIGN(16);                /* Exception table */
#  __start___ex_table = .;
#  __ex_table : { *(__ex_table) }
#  __stop___ex_table = .;
#
#  __start___ksymtab = .;        /* Kernel symbol table */
#  __ksymtab : { *(__ksymtab) }
#  __stop___ksymtab = .;
#


# data segment 
#  .data : {                     /* Data */
#        *(.data)
#        CONSTRUCTORS
#        }
#
#  _edata = .;                   /* End of data section */
#
#  . = ALIGN(8192);              /* init_task */
#  .data.init_task : { *(.data.init_task) }
#
#  . = ALIGN(4096);              /* Init code and data */
#  __init_begin = .;
#  .text.init : { *(.text.init) }
#  .data.init : { *(.data.init) }
#  . = ALIGN(16);
#  __setup_start = .;
#  .setup.init : { *(.setup.init) }
#  __setup_end = .;
#  __initcall_start = .;
#  .initcall.init : { *(.initcall.init) }
#  __initcall_end = .;
#  . = ALIGN(4096);
#  __init_end = .;
#
#  . = ALIGN(4096);
#  .data.page_aligned : { *(.data.idt) }
#
#  . = ALIGN(32);
#  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
#



# bss ʱȭ ʴ ޸ 
#  __bss_start = .;              /* BSS */
#  .bss : {
#        *(.bss)
#        }
#  _end = . ;
#



# exitڵ  Ŀ̹ Ե  (Ŀ exit )
#  /* Sections to be discarded */
#  /DISCARD/ : {
#        *(.text.exit)
#        *(.data.exit)
#        *(.exitcall.exit)
#        }
#


#  /* Stabs debugging sections.  */
#  .stab 0 : { *(.stab) }
#  .stabstr 0 : { *(.stabstr) }
#  .stab.excl 0 : { *(.stab.excl) }
#  .stab.exclstr 0 : { *(.stab.exclstr) }
#  .stab.index 0 : { *(.stab.index) }
#  .stab.indexstr 0 : { *(.stab.indexstr) }
#  .comment 0 : { *(.comment) }
#}
 


FORCE: ;

.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
		clean archclean archmrproper archdep
# .PHONY 




# MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot

# $(TOPDIR)/Makefile  
#vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o init/do_mounts.o linuxsubdirs
#        $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o init/do_mounts.o \
#                --start-group \
#                $(CORE_FILES) \
#                $(DRIVERS) \
#                $(NETWORKS) \
#                $(LIBS) \
#                --end-group \
#                -o vmlinux
#        $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map




zImage: vmlinux
	@@$(MAKEBOOT) zImage

bzImage: vmlinux
	@@$(MAKEBOOT) bzImage

compressed: zImage

zlilo: vmlinux
	@@$(MAKEBOOT) BOOTIMAGE=zImage zlilo

tmp:
	@@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: vmlinux
	@@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo

zdisk: vmlinux
	@@$(MAKEBOOT) BOOTIMAGE=zImage zdisk

bzdisk: vmlinux
	@@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk

install: vmlinux
	@@$(MAKEBOOT) BOOTIMAGE=bzImage install

archclean:
	@@$(MAKEBOOT) clean

archmrproper:

archdep:
	@@$(MAKEBOOT) dep
@


1.1.1.1
log
@linux 2.4.20 분석
@
text
@@
