Permalink
Browse files

more Makefile fixes

  • Loading branch information...
1 parent 81f20e1 commit 09ee8d281646db0f9d992575d4f89309ee5a1519 @jezze committed Sep 26, 2011
Showing with 68 additions and 69 deletions.
  1. +68 −69 build/Makefile
View
@@ -68,45 +68,45 @@ kernel: arch-${ARCH} modules
@${GCC} ${GCCFLAGS} ${DIR_SOURCE_KERNEL}/shell.c -o ${DIR_SOURCE_KERNEL}/shell.o
@${GCC} ${GCCFLAGS} ${DIR_SOURCE_KERNEL}/vfs.c -o ${DIR_SOURCE_KERNEL}/vfs.o
@${LD} ${LDFLAGS} \
- ${DIR_SOURCE_KERNEL}/initrd.o \
- ${DIR_SOURCE_KERNEL}/kernel.o \
- ${DIR_SOURCE_KERNEL}/log.o \
- ${DIR_SOURCE_KERNEL}/modules.o \
- ${DIR_SOURCE_KERNEL}/shell.o \
- ${DIR_SOURCE_KERNEL}/vfs.o \
- ${DIR_SOURCE_MODULES}/elf/elf.o \
- ${DIR_SOURCE_MODULES}/tty/tty.o \
- ${DIR_ARCH}/kernel/arch.o \
- ${DIR_ARCH}/kernel/cpu.o \
- ${DIR_ARCH}/kernel/fpu.o \
- ${DIR_ARCH}/kernel/fpus.o \
- ${DIR_ARCH}/kernel/gdt.o \
- ${DIR_ARCH}/kernel/gdts.o \
- ${DIR_ARCH}/kernel/idt.o \
- ${DIR_ARCH}/kernel/idts.o \
- ${DIR_ARCH}/kernel/init.o \
- ${DIR_ARCH}/kernel/irqs.o \
- ${DIR_ARCH}/kernel/isrs.o \
- ${DIR_ARCH}/kernel/irq.o \
- ${DIR_ARCH}/kernel/isr.o \
- ${DIR_ARCH}/kernel/mmu.o \
- ${DIR_ARCH}/kernel/syscall.o \
- ${DIR_ARCH}/kernel/tss.o \
- ${DIR_ARCH}/kernel/tsss.o \
- ${DIR_ARCH}/modules/ata/ata.o \
- ${DIR_ARCH}/modules/io/io.o \
- ${DIR_ARCH}/modules/io/ios.o \
- ${DIR_ARCH}/modules/kbd/kbd.o \
- ${DIR_ARCH}/modules/pci/pci.o \
- ${DIR_ARCH}/modules/pit/pit.o \
- ${DIR_ARCH}/modules/rtc/rtc.o \
- ${DIR_ARCH}/modules/serial/serial.o \
- ${DIR_ARCH}/modules/vga/vga.o \
- ${DIR_SOURCE_LIB}/memory.o \
- ${DIR_SOURCE_LIB}/file.o \
- ${DIR_SOURCE_LIB}/string.o \
- ${DIR_ARCH}/lib/calls.o \
- -o root/boot/kernel
+ ${DIR_SOURCE_KERNEL}/initrd.o \
+ ${DIR_SOURCE_KERNEL}/kernel.o \
+ ${DIR_SOURCE_KERNEL}/log.o \
+ ${DIR_SOURCE_KERNEL}/modules.o \
+ ${DIR_SOURCE_KERNEL}/shell.o \
+ ${DIR_SOURCE_KERNEL}/vfs.o \
+ ${DIR_SOURCE_MODULES}/elf/elf.o \
+ ${DIR_SOURCE_MODULES}/tty/tty.o \
+ ${DIR_ARCH}/kernel/arch.o \
+ ${DIR_ARCH}/kernel/cpu.o \
+ ${DIR_ARCH}/kernel/fpu.o \
+ ${DIR_ARCH}/kernel/fpus.o \
+ ${DIR_ARCH}/kernel/gdt.o \
+ ${DIR_ARCH}/kernel/gdts.o \
+ ${DIR_ARCH}/kernel/idt.o \
+ ${DIR_ARCH}/kernel/idts.o \
+ ${DIR_ARCH}/kernel/init.o \
+ ${DIR_ARCH}/kernel/irqs.o \
+ ${DIR_ARCH}/kernel/isrs.o \
+ ${DIR_ARCH}/kernel/irq.o \
+ ${DIR_ARCH}/kernel/isr.o \
+ ${DIR_ARCH}/kernel/mmu.o \
+ ${DIR_ARCH}/kernel/syscall.o \
+ ${DIR_ARCH}/kernel/tss.o \
+ ${DIR_ARCH}/kernel/tsss.o \
+ ${DIR_ARCH}/modules/ata/ata.o \
+ ${DIR_ARCH}/modules/io/io.o \
+ ${DIR_ARCH}/modules/io/ios.o \
+ ${DIR_ARCH}/modules/kbd/kbd.o \
+ ${DIR_ARCH}/modules/pci/pci.o \
+ ${DIR_ARCH}/modules/pit/pit.o \
+ ${DIR_ARCH}/modules/rtc/rtc.o \
+ ${DIR_ARCH}/modules/serial/serial.o \
+ ${DIR_ARCH}/modules/vga/vga.o \
+ ${DIR_SOURCE_LIB}/memory.o \
+ ${DIR_SOURCE_LIB}/file.o \
+ ${DIR_SOURCE_LIB}/string.o \
+ ${DIR_ARCH}/lib/calls.o \
+ -o ${DIR_IMAGE}/boot/kernel
ramdisk: kernel
@cp ${DIR_ARCH}/modules/ata/ata.o ${DIR_IMAGE}/lib/modules/ata.ko
@@ -150,42 +150,41 @@ ramdisk: kernel
@find ${DIR_IMAGE} -depth -print | cpio -ov > initrd.cpio
@mv initrd.tar ${DIR_IMAGE}/boot
@mv initrd.cpio ${DIR_IMAGE}/boot
-
image:
@dd if=/dev/zero of=fudge.img bs=512 count=2880
- @dd if=root/boot/grub/stage1 conv=notrunc of=fudge.img bs=512 seek=0
- @dd if=root/boot/grub/stage2 conv=notrunc of=fudge.img bs=512 seek=1
+ @dd if=${DIR_IMAGE}/boot/grub/stage1 conv=notrunc of=fudge.img bs=512 seek=0
+ @dd if=${DIR_IMAGE}/boot/grub/stage2 conv=notrunc of=fudge.img bs=512 seek=1
@dd if=menu.lst conv=notrunc of=fudge.img bs=512 seek=200
- @dd if=root/boot/kernel conv=notrunc of=fudge.img bs=512 seek=300
- @dd if=root/boot/initrd.tar conv=notrunc of=fudge.img bs=512 seek=400
+ @dd if=${DIR_IMAGE}/boot/kernel conv=notrunc of=fudge.img bs=512 seek=300
+ @dd if=${DIR_IMAGE}/boot/initrd.tar conv=notrunc of=fudge.img bs=512 seek=400
@sh x86-write-image.sh
iso:
- @genisoimage -R -b boot/grub/iso9660_stage1_5 -no-emul-boot -boot-load-size 4 -boot-info-table -o fudge.iso root
+ @genisoimage -R -b boot/grub/iso9660_stage1_5 -no-emul-boot -boot-load-size 4 -boot-info-table -o fudge.iso ${DIR_IMAGE}
clean:
@rm -f fudge.img
@rm -f fudge.iso
- @rm -f root/lib/modules/*.ko
- @rm -f root/bin/cat
- @rm -f root/bin/cd
- @rm -f root/bin/clear
- @rm -f root/bin/cpu
- @rm -f root/bin/date
- @rm -f root/bin/echo
- @rm -f root/bin/elf
- @rm -f root/bin/hello
- @rm -f root/bin/ls
- @rm -f root/bin/reboot
- @rm -f root/bin/shell
- @rm -f root/bin/tar
- @rm -f root/bin/timer
- @rm -f root/bin/vga
- @rm -f root/boot/kernel
- @rm -f root/boot/initrd
- @rm -f root/boot/initrd.tar
- @rm -f root/boot/initrd.cpio
+ @rm -f ${DIR_IMAGE}/lib/modules/*.ko
+ @rm -f ${DIR_IMAGE}/bin/cat
+ @rm -f ${DIR_IMAGE}/bin/cd
+ @rm -f ${DIR_IMAGE}/bin/clear
+ @rm -f ${DIR_IMAGE}/bin/cpu
+ @rm -f ${DIR_IMAGE}/bin/date
+ @rm -f ${DIR_IMAGE}/bin/echo
+ @rm -f ${DIR_IMAGE}/bin/elf
+ @rm -f ${DIR_IMAGE}/bin/hello
+ @rm -f ${DIR_IMAGE}/bin/ls
+ @rm -f ${DIR_IMAGE}/bin/reboot
+ @rm -f ${DIR_IMAGE}/bin/shell
+ @rm -f ${DIR_IMAGE}/bin/tar
+ @rm -f ${DIR_IMAGE}/bin/timer
+ @rm -f ${DIR_IMAGE}/bin/vga
+ @rm -f ${DIR_IMAGE}/boot/kernel
+ @rm -f ${DIR_IMAGE}/boot/initrd
+ @rm -f ${DIR_IMAGE}/boot/initrd.tar
+ @rm -f ${DIR_IMAGE}/boot/initrd.cpio
@rm -f ../arch/arm/kernel/*.o
@rm -f ../arch/arm/lib/*.o
@rm -f ../arch/x86/kernel/*.o
@@ -198,9 +197,9 @@ clean:
@rm -f ../arch/x86/modules/rtc/*.o
@rm -f ../arch/x86/modules/serial/*.o
@rm -f ../arch/x86/modules/vga/*.o
- @rm -f ../bin/*.o
- @rm -f ../kernel/*.o
- @rm -f ../lib/*.o
- @rm -f ../modules/elf/*.o
- @rm -f ../modules/tty/*.o
+ @rm -f ${DIR_SOURCE_BIN}/*.o
+ @rm -f ${DIR_SOURCE_KERNEL}/*.o
+ @rm -f ${DIR_SOURCE_LIB}/*.o
+ @rm -f ${DIR_SOURCE_MODULES}/elf/*.o
+ @rm -f ${DIR_SOURCE_MODULES}/tty/*.o

0 comments on commit 09ee8d2

Please sign in to comment.