os/kernel/Makefile
2019-05-24 09:51:45 -05:00

23 lines
410 B
Makefile

C_SOURCES = $(wildcard *.c cpu/$(PLAT)/*.c)
ASM = $(wildcard cpu/$(PLAT)/*.asm)
S_ASM = $(wildcard cpu/$(PLAT)/*.s)
OBJ = $(C_SOURCES:.c=.o)
ASM_OBJ = $(S_ASM:.s=.o)
S_ASM_OBJ = $(ASM:.asm=.o)
kernel.a: $(OBJ) $(ASM_OBJ) $(S_ASM_OBJ)
@$(AR) rcs $@ $^
%.o: %.c
@$(CC) -I../sysroot/usr/include $(CFLAGS) -c $< -o $@
%.o: %.asm
@$(NASM) $< -o $@
%.o: %.s
@$(AS) $< -o $@
clean:
@rm -rf *.o cpu/*/*.o