aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/makefile b/drivers/makefile
index 6a80fec..65bf22d 100644
--- a/drivers/makefile
+++ b/drivers/makefile
@@ -1,11 +1,16 @@
+include ../common.mk
+
CXX_OBJ = cga.o serial.o keyboard.o
-CXX_OBJ := $(addprefix $(OBJ_DIR)/, $(CXX_OBJ))
+CXX_OBJ := $(addprefix $(OBJ_DIR)/libd/, $(CXX_OBJ))
CXX_DEP = $(CXX_OBJ:%.o=%.d)
CXX_JSON = $(CXX_OBJ:.o=.json)
HWH := drivers/hardware.h
autogen := $(autogen) $(HWH)
+.PHONY: all clean
+all: $(OBJ_DIR)/libd.a
+
$(HWH): .config
@echo " GEN $@"
@echo \/\* autogenerated hardware description \*\/ > $(HWH)
@@ -22,12 +27,12 @@ ifdef CONFIG_serial0_enable
endif
-include $(CXX_DEP)
-$(CXX_OBJ) : $(OBJ_DIR)/%.o : %.cc
+$(CXX_OBJ) : $(OBJ_DIR)/libd/%.o : %.cc
@mkdir -p $(@D)
@echo " CXX $<"
@$(CXX) -target $(TARGET) $(CXX_FLAGS) $(CXX_INCLUDE) -MMD -MJ$(subst .o,.json,$@) -c $< -o $@
-%/libd.a: $(CXX_OBJ)
+$(OBJ_DIR)/libd.a: $(CXX_OBJ)
@echo " AR $(@F)"
@$(AR) $(AR_FLAGS) rcs $@ $(CXX_OBJ)