bond/mk/stdrules.mk
secXsQuared 9256f5b575 - Refactored Makefile + included dependencies.
- asm and ld files referencing c symbols are now generated by c preprocessor instead of duplicate definition.
- Finished kernel memory layout. Unfinished init code.
2018-02-11 22:26:03 -05:00

29 lines
770 B
Makefile

# The source rules.mk defines:
# SRC_$(d) for all c source files
# SRCAS_$(d) for all asm source files
# SRCIN_$(d) for all in(preprocessor) source files
# Compiles all c and in source files and generate dependencies
# Adds c and asm object files to $OBJ variable
# Adds all generated files to $CLEAN variable
OBJ_$(d) := $(SRC_$(d):.c=.o)
OBJAS_$(d) := $(SRCAS_$(d):.asm=.a)
OBJIN_$(d) := $(SRCIN_$(d):.in=)
DEP_$(d) := $(SRC_$(d):.c=.d) $(SRCIN_$(d):.in=.d)
$(OBJ_$(d)): %.o: %.c
$(COMP)
$(GDEP)
$(OBJAS_$(d)): %.a: %.asm
$(COMPAS)
$(OBJIN_$(d)): %: %.in
$(PREP)
$(GDEP)
# append all OBJECTS to OBJ
OBJ := $(OBJ) $(OBJ_$(d)) $(OBJAS_$(d))
CLEAN := $(CLEAN) $(OBJ_$(d)) $(OBJAS_$(d)) $(OBJIN_$(d)) $(DEP_$(d))
include $(DEP_$(d))