Compare commits

..

No commits in common. "bfaa31de54d184c510a61c5609a20f9dbd47f232" and "4e302452c1486fd00198c654301c082bffecb782" have entirely different histories.

2 changed files with 16 additions and 24 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
build build
obj obj
isodir

View File

@ -1,9 +1,3 @@
BUILDDIR := build
SOURCEDIR := src
OBJECTDIR := obj
NAME := bozOS
AS := i386-elf-as AS := i386-elf-as
ASFLAGS := ASFLAGS :=
CC := i386-elf-gcc CC := i386-elf-gcc
@ -12,42 +6,39 @@ LD := $(CC)
LDFLAGS := -T boot/linker.ld -ffreestanding -O2 -nostdlib LDFLAGS := -T boot/linker.ld -ffreestanding -O2 -nostdlib
LIBS := ./libbozo/build/libbozo.a -lgcc LIBS := ./libbozo/build/libbozo.a -lgcc
SSRC := $(wildcard $(SOURCEDIR)/*.s) SSRC := $(wildcard src/*.s)
CSRC := $(wildcard $(SOURCEDIR)/*.c) CSRC := $(wildcard src/*.c)
OBJ := $(patsubst $(SOURCEDIR)/%.c,$(OBJECTDIR)/%.o,$(CSRC))\ OBJ := $(patsubst src/%.c,obj/%.o,$(CSRC))\
$(patsubst $(SOURCEDIR)/%.s,$(OBJECTDIR)/%.o,$(SSRC)) $(patsubst src/%.s,obj/%.o,$(SSRC))
NAME := bozOS
all: $(NAME) all: $(NAME)
$(OBJECTDIR)/%.o: $(SOURCEDIR)/%.s obj/%.o: src/%.s
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(AS) $(ASFLAGS) $< -o $@ $(AS) $(ASFLAGS) $< -o $@
$(OBJECTDIR)/%.o: $(SOURCEDIR)/%.c obj/%.o: src/%.c
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CC) $(CCFLAGS) -c $< -o $@ $(CC) $(CCFLAGS) -c $< -o $@
$(NAME): $(OBJ) $(NAME): $(OBJ)
make -C libbozo make -C libbozo
mkdir -p $(BUILDDIR)/ mkdir -p build/
$(LD) $(LDFLAGS) -o $(BUILDDIR)/$(NAME).bin $(OBJ) $(LIBS) $(LD) $(LDFLAGS) -o build/$(NAME).bin $(OBJ) $(LIBS)
run: $(NAME) run: $(NAME)
qemu-system-i386 -kernel $(BUILDDIR)/$(NAME).bin qemu-system-i386 -kernel build/$(NAME).bin
iso: $(NAME) iso: $(NAME)
mkdir -p isodir/boot/grub mkdir -p isodir/boot/grub
cp $(BUILDDIR)/$(NAME).bin isodir/boot/bozOS.bin cp build/$(NAME).bin isodir/boot/bozOS.bin
cp config/grub.cfg isodir/boot/grub/grub.cfg cp config/grub.cfg isodir/boot/grub/grub.cfg
grub-mkrescue -o $(BUILDDIR)/bozOS.iso isodir grub-mkrescue -o build/bozOS.iso isodir
rm -rf isodir
run_iso: iso run_iso: iso
qemu-system-i386 -cdrom $(BUILDDIR)/bozOS.iso qemu-system-i386 -cdrom build/bozOS.iso
debug: iso
qemu-system-i386 -s -S $(BUILDDIR)/bozOS.iso
clean: clean:
make -C libbozo clean make -C libbozo clean
@ -55,7 +46,7 @@ clean:
fclean: clean fclean: clean
make -C libbozo fclean make -C libbozo fclean
rm -rf $(BUILDDIR)/ rm -rf build/
re: fclean all re: fclean all