42_KFS/libbozo/Makefile

39 lines
632 B
Makefile
Raw Permalink Normal View History

SSRC := $(shell find src -name '*.s')
CSRC := $(shell find src -name '*.c')
OBJ := $(patsubst src/%.c,obj/%.o,$(CSRC))\
$(patsubst src/%.s,obj/%.o,$(SSRC))
2024-09-07 08:40:46 -04:00
CC := i386-elf-gcc
CFLAGS := -std=gnu99 -ffreestanding -O2 -Wall -Wextra -iquoteheaders -c
2024-09-07 08:40:46 -04:00
AS := i386-elf-as
ASFLAGS :=
AR := ar
ARFLAGS :=
2024-09-07 08:40:46 -04:00
NAME = libbozo.a
obj/%.o: src/%.s
mkdir -p $(dir $@)
$(AS) $(ASFLAGS) $< -o $@
obj/%.o: src/%.c
2024-09-07 08:40:46 -04:00
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $< -o $@
all : $(NAME)
clean :
rm -rf obj
2024-09-07 08:40:46 -04:00
fclean : clean
rm -rf build
2024-09-07 08:40:46 -04:00
$(NAME) : $(OBJ)
mkdir -p build
$(AR) -rc build/$(NAME) $(OBJ)
2024-09-07 08:40:46 -04:00
re: fclean all
.PHONY: clean fclean all re