Diff markup
001 OBJCOPY=objcopy 001 OBJCOPY=objcopy
002 LIBGCC := $(shell $(CC) -print-libgcc-file-nam <<
003 EXTRA := $(shell [ -f ../userland/userprogs.ki <<
004 002
005 all: sos_qemu.img termslave !! 003 all: sos_qemu.img
006 004
007 -include ../.mkvars 005 -include ../.mkvars
008 006
009 # The image is the simple concatenation of the 007 # The image is the simple concatenation of the boot sector and the kernel
010 # It may be use in bochs or on a real floppy, 008 # It may be use in bochs or on a real floppy, but NOT in qemu (see below)
011 sos_bsect.img: bsect.bin sos.bin 009 sos_bsect.img: bsect.bin sos.bin
012 cat $^ > $@ 010 cat $^ > $@
013 @echo "[31mYou can use the $@ image i 011 @echo "[31mYou can use the $@ image in bochs or on a real floppy (NOT qemu)[m"
014 012
015 013
016 014
017 015
018 sos_qemu.img: sos_bsect.img 016 sos_qemu.img: sos_bsect.img
019 017
020 cat $< /dev/zero | dd of=$@ bs=1k coun 018 cat $< /dev/zero | dd of=$@ bs=1k count=1440
021 @echo "[31mYou can use the $@ image i 019 @echo "[31mYou can use the $@ image in qemu, bochs, or on a real floppy[m"
022 020
023 021
024 bsect.bin: sos_bsect.elf 022 bsect.bin: sos_bsect.elf
025 $(OBJCOPY) -v -O binary -j .bootsect $ 023 $(OBJCOPY) -v -O binary -j .bootsect $< $@
026 024
027 025
028 sos.bin: sos_bsect.elf 026 sos.bin: sos_bsect.elf
029 $(OBJCOPY) -v -O binary -R .bootsect $ 027 $(OBJCOPY) -v -O binary -R .bootsect $< $@
030 028
031 029
032 030
033 031
034 sos_bsect.elf: bootsect.o compile_kernel 032 sos_bsect.elf: bootsect.o compile_kernel
035 $(LD) --warn-common -T ./sos_bsect.lds 033 $(LD) --warn-common -T ./sos_bsect.lds -o $@ \
036 bootsect.o $(wildcard ../hwcor !! 034 bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)
037 $(EXTRA) $(LIBGCC) <<
038 035
039 compile_kernel: 036 compile_kernel:
040 $(MAKE) -C .. 037 $(MAKE) -C ..
041 038
042 termslave: termslave.c <<
043 cc -Wall -o $@ $< <<
044 <<
045 clean: 039 clean:
046 $(RM) *.img *.elf *.bin *~ *.o *.out t !! 040 $(RM) *.img *.elf *.bin *~ *.o *.out