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