# HG changeset patch # User mir3636 # Date 1539698016 -32400 # Node ID 74b19f0bedc558a87d6be2d751b0ae987804dd04 # Parent 70754edc1f50f5559a6decfa8eb13dd167d15c5c update diff -r 70754edc1f50 -r 74b19f0bedc5 Makefile --- a/Makefile Wed Oct 10 18:50:50 2018 +0900 +++ b/Makefile Tue Oct 16 22:53:36 2018 +0900 @@ -1,17 +1,22 @@ -# target name -TARGET=ipl +CLANG=/Users/mitsuki/workspace/llvm/CbC_build/bin/clang -target i386-pc-linux +CSO=bootpack.c +OBJ=bootpack.o nasmfunc.o c/haribote-context.o # dependencies asmhead.bin : asmhead.asm nasm -f elf32 -g -o asmhead.bin asmhead.asm nasmfunc.o : nasmfunc.asm nasm -f elf32 -g -o nasmfunc.o nasmfunc.asm -#bootpack.bin : bootpack.c nasmfunc.o -# gcc -m32 -nostdlib -Wl,--oformat,binary bootpack.c nasmfunc.o -T os.ls -o bootpack.bin -bootpack.o : bootpack.c - clang -target i386-pc-linux -c bootpack.c -o bootpack.o -bootpack.bin : bootpack.o nasmfunc.o - i386-elf-ld -m elf_i386 -e HariMain -o bootpack.bin -T os.ls bootpack.o nasmfunc.o +%.c : %.cbc + perl generate_stub_haribote.pl -o $*.c $*.cbc +haribote-context.c : $(CSO) + perl generate_context_harib.pl -o haribote $(CSO) +haribote-context.o : haribote-context.c + $(CLANG) -g -c -Wall c/haribote-context.c -o c/haribote-context.o +%.o : %.c + $(CLANG) -c $*.c -o $*.o +bootpack.bin : $(OBJ) + i386-elf-ld -m elf_i386 -e HariMain -o bootpack.bin -T os.ls $(OBJ) haribote.sys : asmhead.bin bootpack.bin cat asmhead.bin bootpack.bin > haribote.sys iplelf.bin : iplelf.asm @@ -25,7 +30,7 @@ make -r haribote.img kernel.elf: asmhead.bin bootpack.o nasmfunc.o - i386-elf-ld -m elf_i386 -e asmhead -o kernel.elf -T os.ls asmhead.bin bootpack.o nasmfunc.o -Map kernel.map + i386-elf-ld -m elf_i386 -e asmhead -o kernel.elf -T os.ls asmhead.bin $(OBJ) -Map kernel.map elf.img : iplelf.bin kernel.elf mformat -f 1440 -C -B iplelf.bin -i elf.img ::