forked from PoliEcho-holding-org/kern
- 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
581 B
Makefile
32 lines
581 B
Makefile
include ../defaults.mk
|
|
|
|
INC = ./include
|
|
SRC = ./src
|
|
BIN = ./bin
|
|
|
|
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 = ./kern.bin
|
|
|
|
.PHONY: all clean
|
|
|
|
all: $(OUT)
|
|
$(OUT): $(OBJS)
|
|
$(LD) $(LDFLAGS) -T$(LINKER) -o $@ $^
|
|
|
|
$(BIN)/%.o: $(SRC)/%.c
|
|
@mkdir -p $(dir $@)
|
|
$(CC) $(CFLAGS) -I$(INC) -c -o $@ $<
|
|
|
|
$(BIN)/%.s.o: $(SRC)/%.s
|
|
@mkdir -p $(dir $@)
|
|
$(AS) $(ASFLAGS) -felf32 -o $@ $<
|
|
|
|
clean:
|
|
rm -fr $(BIN) $(OUT)
|
|
|