Code: Select all
CC = i586-elf-gcc
CFLAGS = -Wall -Wextra -nostdlib -fno-builtin -nostartfiles -nodefaultlibs
LD = i586-elf-ld
ASM = nasm
ASMFLAGS = -f elf
SRCDIRS = src #no subdirectory for now
SRC_C := $(wildcard $(addsuffix *.c, $(SRCDIRS))) #c
SRC_S := $(wildcard $(addsuffix *.s, $(SRCDIRS))) #asm
SRCFILES = $(SRC_C) $(SRC_S)
HEADERS := $(wildcard $(addsuffix *.h, $(SRCDIRS)))
OBJDIR = build/obj
OBJ_C := $(addprefix $(OBJDIR)/, $(addsuffix .o, $(notdir $(SRC_C))))
OBJ_S := $(addprefix $(OBJDIR)/, $(addsuffix .o, $(notdir $(SRC_S))))
OBJFILES = $(OBJ_C) $(OBJ_S)
BUILD_DIR = build/bin
Code: Select all
$(OBJ_C): $(SRC_C)
compile command here, as a foreach