SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /Makefile (Article 6.5) and /Makefile (Article 7.5)


001 ## Copyright (C) 2004,2005  The SOS Team          001 ## Copyright (C) 2004,2005  The SOS Team
002 ##                                                002 ##
003 ## This program is free software; you can redi    003 ## This program is free software; you can redistribute it and/or
004 ## modify it under the terms of the GNU Genera    004 ## modify it under the terms of the GNU General Public License
005 ## as published by the Free Software Foundatio    005 ## as published by the Free Software Foundation; either version 2
006 ## of the License, or (at your option) any lat    006 ## of the License, or (at your option) any later version.
007 ##                                                007 ## 
008 ## This program is distributed in the hope tha    008 ## This program is distributed in the hope that it will be useful,
009 ## but WITHOUT ANY WARRANTY; without even the     009 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
010 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR    010 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011 ## GNU General Public License for more details    011 ## GNU General Public License for more details.
012 ##                                                012 ## 
013 ## You should have received a copy of the GNU     013 ## You should have received a copy of the GNU General Public License
014 ## along with this program; if not, write to t    014 ## along with this program; if not, write to the Free Software
015 ## Foundation, Inc., 59 Temple Place - Suite 3    015 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016 ## USA.                                           016 ## USA. 
017                                                   017 
018 CC=gcc                                            018 CC=gcc
019 LD=ld                                             019 LD=ld
020 CFLAGS  = -Wall -nostdinc -ffreestanding -DKER    020 CFLAGS  = -Wall -nostdinc -ffreestanding -DKERNEL_SOS
                                                   >> 021 LIBGCC := $(shell $(CC) -print-libgcc-file-name) # To benefit from FP/64bits artihm.
021 LDFLAGS = --warn-common -nostdlib                 022 LDFLAGS = --warn-common -nostdlib
022 OBJECTS = bootstrap/multiboot.o                   023 OBJECTS = bootstrap/multiboot.o                                 \
023           hwcore/idt.o hwcore/gdt.o               024           hwcore/idt.o hwcore/gdt.o                             \
                                                   >> 025           hwcore/swintr.o hwcore/swintr_wrappers.o              \
024           hwcore/exception.o hwcore/exception_    026           hwcore/exception.o hwcore/exception_wrappers.o        \
025           hwcore/irq.o hwcore/irq_wrappers.o h    027           hwcore/irq.o hwcore/irq_wrappers.o hwcore/i8259.o     \
026           hwcore/paging.o                         028           hwcore/paging.o                                       \
027           hwcore/i8254.o drivers/x86_videomem.    029           hwcore/i8254.o drivers/x86_videomem.o drivers/bochs.o \
028           hwcore/cpu_context.o hwcore/cpu_cont    030           hwcore/cpu_context.o hwcore/cpu_context_switch.o      \
                                                   >> 031           hwcore/mm_context.o                                   \
029           sos/kmem_vmm.o sos/kmem_slab.o sos/k    032           sos/kmem_vmm.o sos/kmem_slab.o sos/kmalloc.o          \
030           sos/physmem.o sos/klibc.o               033           sos/physmem.o sos/klibc.o                             \
031           sos/thread.o sos/kwaitq.o               034           sos/thread.o sos/kwaitq.o                             \
032           sos/time.o sos/sched.o sos/ksynch.o     035           sos/time.o sos/sched.o sos/ksynch.o                   \
033           sos/assert.o sos/main.o sos/mouse_si !! 036           sos/process.o sos/syscall.o                           \
                                                   >> 037           sos/assert.o sos/main.o sos/mouse_sim.o               \
                                                   >> 038           sos/uaccess.o sos/calcload.o                          \
                                                   >> 039           sos/umem_vmm.o sos/binfmt_elf32.o                     \
                                                   >> 040           drivers/zero.o drivers/mem.o                          \
                                                   >> 041           userland/userprogs.kimg
034                                                   042 
035 KERNEL_OBJ   = sos.elf                            043 KERNEL_OBJ   = sos.elf
036 MULTIBOOT_IMAGE = fd.img                          044 MULTIBOOT_IMAGE = fd.img
037 PWD := $(shell pwd)                               045 PWD := $(shell pwd)
038                                                   046 
039 # Main target                                     047 # Main target
040 all: $(MULTIBOOT_IMAGE)                           048 all: $(MULTIBOOT_IMAGE)
041                                                   049 
042 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ)                 050 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ)
043         ./support/build_image.sh $@ $<            051         ./support/build_image.sh $@ $<
044                                                   052 
045 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds       053 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
046         $(LD) $(LDFLAGS) -T ./support/sos.lds  !! 054         $(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS) $(LIBGCC)
047         -nm -C $@ | cut -d ' ' -f 1,3 > sos.ma    055         -nm -C $@ | cut -d ' ' -f 1,3 > sos.map
048         size $@                                   056         size $@
049                                                   057 
050 -include .mkvars                                  058 -include .mkvars
051                                                   059 
                                                   >> 060 # Create the userland programs to include in the kernel image
                                                   >> 061 userland/userprogs.kimg: FORCE
                                                   >> 062         $(MAKE) -C userland
                                                   >> 063 
052 # Create objects from C source code               064 # Create objects from C source code
053 %.o: %.c                                          065 %.o: %.c
054         $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@      066         $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@
055                                                   067 
056 # Create objects from assembler (.S) source co    068 # Create objects from assembler (.S) source code
057 %.o: %.S                                          069 %.o: %.S
058         $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_S    070         $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_SOURCE=1 -o $@
059                                                   071 
060 FORCE:                                            072 FORCE:
061         @                                         073         @
062                                                   074 
063 # Clean directory                                 075 # Clean directory
064 clean:                                            076 clean:
065         $(RM) *.img *.o mtoolsrc *~ menu.txt *    077         $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
066         $(RM) *.log *.out bochs*                  078         $(RM) *.log *.out bochs*
067         $(RM) bootstrap/*.o bootstrap/*~          079         $(RM) bootstrap/*.o bootstrap/*~
068         $(RM) drivers/*.o drivers/*~              080         $(RM) drivers/*.o drivers/*~
069         $(RM) hwcore/*.o hwcore/*~                081         $(RM) hwcore/*.o hwcore/*~
070         $(RM) sos/*.o sos/*~                      082         $(RM) sos/*.o sos/*~
071         $(RM) support/*~                          083         $(RM) support/*~
072         $(RM) extra/*~                            084         $(RM) extra/*~
                                                   >> 085         $(MAKE) -C userland clean
                                                      

source navigation ] diff markup ] identifier search ] general search ]