aboutsummaryrefslogtreecommitdiff
path: root/libk
diff options
context:
space:
mode:
Diffstat (limited to 'libk')
-rw-r--r--libk/makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/libk/makefile b/libk/makefile
index eafa98c..7a0483d 100644
--- a/libk/makefile
+++ b/libk/makefile
@@ -1,12 +1,14 @@
+include ../common.mk
+
CXX_OBJ = string/integerview.o string/memory.o \
memory/allocator.o \
stdlib/abort.o stdlib/console.o stdlib/virtual.o
-CXX_OBJ := $(addprefix $(OBJ_DIR)/, $(CXX_OBJ))
+CXX_OBJ := $(addprefix $(OBJ_DIR)/libk/, $(CXX_OBJ))
CXX_DEP = $(CXX_OBJ:%.o=%.d)
CXX_JSON = $(CXX_OBJ:.o=.json)
TEST_CXX_OBJ = test/types.o test/string.o test/result.o test/quicksort.o
-TEST_CXX_OBJ := $(addprefix $(OBJ_DIR)/, $(TEST_CXX_OBJ))
+TEST_CXX_OBJ := $(addprefix $(OBJ_DIR)/libk/, $(TEST_CXX_OBJ))
TEST_CXX_DEP = $(TEST_CXX_OBJ:%.o=%.d)
.PHONY: all test clean
@@ -14,12 +16,12 @@ all: $(OBJ_DIR)/libk.a
test: $(TEST_CXX_OBJ)
-include $(CXX_DEP)
-$(CXX_OBJ) : $(OBJ_DIR)/%.o : %.cc
+$(CXX_OBJ) : $(OBJ_DIR)/libk/%.o : %.cc
@mkdir -p $(@D)
@echo " CXX $<"
@$(CXX) -target $(TARGET) $(CXX_FLAGS) $(CXX_INCLUDE) -MMD -MJ$(subst .o,.json,$@) -c $< -o $@
-%/libk.a: $(CXX_OBJ)
+$(OBJ_DIR)/libk.a: $(CXX_OBJ)
@echo " AR $(@F)"
@$(AR) $(AR_FLAGS) rcs $@ $(CXX_OBJ)