forked from PoliEcho-holding-org/kern
MAJOR REWRITE
- 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
This commit is contained in:
+9
-7
@@ -1,14 +1,16 @@
|
||||
include ../defaults.mk
|
||||
|
||||
INC = ./include
|
||||
SRC = ./src
|
||||
BIN = ./bin
|
||||
|
||||
SRCS_C = $(shell find . -name '*.c')
|
||||
SRCS_S = $(shell find . -name '*.s')
|
||||
OBJS = $(patsubst %.c, $(BIN)/%.o, $(SRCS_C)) \
|
||||
$(patsubst %.s, $(BIN)/%.s.o, $(SRCS_S))
|
||||
SRCS_C = $(shell find $(SRC) -name '*.c')
|
||||
SRCS_S = $(shell find $(SRC) -name '*.s')
|
||||
OBJS = $(patsubst $(SRC)/%.c, $(BIN)/%.o, $(SRCS_C)) \
|
||||
$(patsubst $(SRC)/%.s, $(BIN)/%.s.o, $(SRCS_S))
|
||||
|
||||
LINKER = ./linker.ld
|
||||
OUT = ./kernel.elf
|
||||
OUT = ./kern.bin
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
@@ -16,11 +18,11 @@ all: $(OUT)
|
||||
$(OUT): $(OBJS)
|
||||
$(LD) $(LDFLAGS) -T$(LINKER) -o $@ $^
|
||||
|
||||
$(BIN)/%.o: %.c
|
||||
$(BIN)/%.o: $(SRC)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -I$(INC) -c -o $@ $<
|
||||
|
||||
$(BIN)/%.s.o: %.s
|
||||
$(BIN)/%.s.o: $(SRC)/%.s
|
||||
@mkdir -p $(dir $@)
|
||||
$(AS) $(ASFLAGS) -felf32 -o $@ $<
|
||||
|
||||
|
||||
Reference in New Issue
Block a user