mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
- Kernel got pretty much deleted, will be rewriting in following days - Bootloader got rewritten, stage1 works, stage2 will be written in following days - Libc is still the same - User will contains userspace stuff - Rewrote makefiles again - Got rid of backup (see previous commits for that) - Image has 1 MBR partition for FAT32 which contains 'kern.bin' file - Remade info files to be more "big project" style (all caps plain text) - Added some dumb docs
32 lines
633 B
Makefile
32 lines
633 B
Makefile
include ../defaults.mk
|
|
|
|
BIN = ./bin
|
|
STAGE1_SRC = ./stage1
|
|
STAGE2_SRC = ./stage2
|
|
|
|
STAGE1_SRCS = $(wildcard $(STAGE1_SRC)/*.s)
|
|
STAGE2_SRCS = $(wildcard $(STAGE2_SRC)/*.c)
|
|
STAGE2_OBJS = $(patsubst $(STAGE2_SRC)/%.c, $(BIN)/%.o, $(STAGE2_SRCS))
|
|
|
|
LINKER = $(STAGE2_SRC)/linker.ld
|
|
STAGE1 = stage1.bin
|
|
STAGE2 = stage2.bin
|
|
|
|
.PHONY: all clean
|
|
|
|
all: $(STAGE1) $(STAGE2)
|
|
|
|
$(STAGE1): $(STAGE1_SRCS)
|
|
$(AS) $(ASFLAGS) -fbin -o $@ $(STAGE1_SRC)/bootsect.s
|
|
|
|
$(STAGE2): $(STAGE2_OBJS)
|
|
$(LD) $(LDFLAGS) -T$(LINKER) -o $@ $^
|
|
|
|
$(BIN)/%.o: $(STAGE2_SRC)/%.c
|
|
@mkdir -p $(dir $@)
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -fr $(BIN) $(STAGE1) $(STAGE2)
|
|
|