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 7) and /Makefile (Article 9)


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 CP=cp
021 LIBGCC := $(shell $(CC) -print-libgcc-file-nam !! 021 STRIP=strip
                                                   >> 022 CFLAGS  = -Wall -nostdinc -ffreestanding -DKERNEL_SOS -O -g
                                                   >> 023 LIBGCC  = $(shell $(CC) -print-libgcc-file-name) # To benefit from FP/64bits artihm.
022 LDFLAGS = --warn-common -nostdlib                 024 LDFLAGS = --warn-common -nostdlib
023 OBJECTS = bootstrap/multiboot.o                   025 OBJECTS = bootstrap/multiboot.o                                 \
024           hwcore/idt.o hwcore/gdt.o               026           hwcore/idt.o hwcore/gdt.o                             \
025           hwcore/swintr.o hwcore/swintr_wrappe    027           hwcore/swintr.o hwcore/swintr_wrappers.o              \
026           hwcore/exception.o hwcore/exception_    028           hwcore/exception.o hwcore/exception_wrappers.o        \
027           hwcore/irq.o hwcore/irq_wrappers.o h    029           hwcore/irq.o hwcore/irq_wrappers.o hwcore/i8259.o     \
028           hwcore/paging.o                      !! 030           hwcore/paging.o hwcore/i8254.o                        \
029           hwcore/i8254.o drivers/x86_videomem. << 
030           hwcore/cpu_context.o hwcore/cpu_cont    031           hwcore/cpu_context.o hwcore/cpu_context_switch.o      \
031           hwcore/mm_context.o                     032           hwcore/mm_context.o                                   \
032           sos/kmem_vmm.o sos/kmem_slab.o sos/k    033           sos/kmem_vmm.o sos/kmem_slab.o sos/kmalloc.o          \
033           sos/physmem.o sos/klibc.o               034           sos/physmem.o sos/klibc.o                             \
034           sos/thread.o sos/kwaitq.o               035           sos/thread.o sos/kwaitq.o                             \
035           sos/time.o sos/sched.o sos/ksynch.o     036           sos/time.o sos/sched.o sos/ksynch.o                   \
036           sos/process.o sos/syscall.o             037           sos/process.o sos/syscall.o                           \
037           sos/assert.o sos/main.o sos/mouse_si !! 038           sos/assert.o sos/main.o sos/mouse_sim.o               \
038           sos/uaccess.o sos/calcload.o            039           sos/uaccess.o sos/calcload.o                          \
039           userland/userprogs.kimg sos/test-art !! 040           sos/umem_vmm.o sos/binfmt_elf32.o                     \
                                                   >> 041           drivers/x86_videomem.o drivers/bochs.o                \
                                                   >> 042           drivers/zero.o drivers/mem.o                          \
                                                   >> 043           drivers/kbd.o drivers/kbdmapfr.o                      \
                                                   >> 044           drivers/tty.o drivers/serial.o drivers/console.o      \
                                                   >> 045           sos/hash.o sos/fs.o sos/fs_nscache.o                  \
                                                   >> 046           drivers/fs_virtfs.o sos/chardev.o                     \
                                                   >> 047           userland/userprogs.kimg
040                                                   048 
041 KERNEL_OBJ   = sos.elf                            049 KERNEL_OBJ   = sos.elf
                                                   >> 050 KERNEL_LOAD  = sos.gz
042 MULTIBOOT_IMAGE = fd.img                          051 MULTIBOOT_IMAGE = fd.img
043 PWD := $(shell pwd)                            !! 052 PWD := $(shell pwd | sed 's/"/\\\"/g;s/\$$/\\\$$/g')
044                                                   053 
045 # Main target                                     054 # Main target
046 all: $(MULTIBOOT_IMAGE)                           055 all: $(MULTIBOOT_IMAGE)
047                                                   056 
048 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ)              !! 057 $(MULTIBOOT_IMAGE): $(KERNEL_LOAD)
049         ./support/build_image.sh $@ $<            058         ./support/build_image.sh $@ $<
050                                                   059 
                                                   >> 060 $(KERNEL_LOAD): $(KERNEL_OBJ)
                                                   >> 061         $(CP) $< $<.strip && $(STRIP) -sx -R .comment $<.strip
                                                   >> 062         gzip < $<.strip > $@
                                                   >> 063 
051 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds       064 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
052         $(LD) $(LDFLAGS) -T ./support/sos.lds     065         $(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS) $(LIBGCC)
053         -nm -C $@ | cut -d ' ' -f 1,3 > sos.ma    066         -nm -C $@ | cut -d ' ' -f 1,3 > sos.map
054         size $@                                   067         size $@
055                                                   068 
056 -include .mkvars                                  069 -include .mkvars
057                                                   070 
058 # Create the userland programs to include in t    071 # Create the userland programs to include in the kernel image
059 userland/userprogs.kimg: FORCE                    072 userland/userprogs.kimg: FORCE
060         $(MAKE) -C userland                       073         $(MAKE) -C userland
061                                                   074 
062 # Create objects from C source code               075 # Create objects from C source code
063 %.o: %.c                                          076 %.o: %.c
064         $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@   !! 077         $(CC) "-I$(PWD)" -c "$<" $(CFLAGS) -o "$@"
065                                                   078 
066 # Create objects from assembler (.S) source co    079 # Create objects from assembler (.S) source code
067 %.o: %.S                                          080 %.o: %.S
068         $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_S !! 081         $(CC) "-I$(PWD)" -c "$<" $(CFLAGS) -DASM_SOURCE=1 -o "$@"
069                                                   082 
070 FORCE:                                            083 FORCE:
071         @                                         084         @
072                                                   085 
073 # Clean directory                                 086 # Clean directory
074 clean:                                            087 clean:
075         $(RM) *.img *.o mtoolsrc *~ menu.txt * !! 088         $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.strip *.map
076         $(RM) *.log *.out bochs*               !! 089         $(RM) *.log *.out bochs* sos.gz
077         $(RM) bootstrap/*.o bootstrap/*~          090         $(RM) bootstrap/*.o bootstrap/*~
078         $(RM) drivers/*.o drivers/*~              091         $(RM) drivers/*.o drivers/*~
079         $(RM) hwcore/*.o hwcore/*~                092         $(RM) hwcore/*.o hwcore/*~
080         $(RM) sos/*.o sos/*~                      093         $(RM) sos/*.o sos/*~
081         $(RM) support/*~                          094         $(RM) support/*~
082         $(RM) extra/*~                            095         $(RM) extra/*~
                                                   >> 096         $(MAKE) -C extra clean
083         $(MAKE) -C userland clean                 097         $(MAKE) -C userland clean
                                                      

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