problem make files are below:
MAKECOMMON
Code: Select all
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
BASE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
BUILD_DIR := build
CXX = i686-linux-gnu-g++-10
CC = i686-linux-gnu-gcc-10
FLAGS = -g -lgcc -MMD -MP -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough -Wno-expansion-to-defined -Os -fno-exceptions -fno-rtti -std=c++2a -Wno-sized-deallocation -fno-sized-deallocation -nostdlib -nostdinc -nostdinc++ -ffreestanding -nostartfiles -DSANITIZE_PTRS -DDEBUG
INCLUDE_FLAGS = \
-I$(BASE_DIR) \
-I$(BASE_DIR)/libs \
-I$(BASE_DIR)/libs/CLib
LDFLAGS = \
-Wl,-T linker.ld \
-L$(BASE_DIR)/Libraries/CLib \
-g -ffreestanding -nostdlib -nostartfiles -no-pie
$(BUILD_DIR)/%.s.o: %.s
$(CXX) -g -MD -no-pie -lgcc -nostartfiles -c $< -o $@
$(BUILD_DIR)/%.cpp.o: %.cpp
@echo "CXX $<"; $(CXX) -MD -c $< -o $@ $(FLAGS) $(INCLUDE_FLAGS)
$(BUILD_DIR)/%.c.o: %.c
@echo "CXX $<"; $(CC) -MD -c $< -o $@ $(FLAGS) $(INCLUDE_FLAGS)
Code: Select all
include $(BASE_DIR)/MAKECOMMON
CLIB = CLib
CLIB_SOURCES = \
stdio/prinf.c
CLIB_OBJS = $(addprefix $(BUILD_DIR)/$(CLIB)/,$(CLIB_SOURCES:.c=.c.o))
$(CLIB): $(CLIB_OBJS)
@echo "CLib linked";$(CXX) -o $(BUILD_DIR)/isodir/boot/clib.so $(CLIB_OBJS) $(LDFLAGS)
Code: Select all
hecking if target is up-to-date: make -q -f MakeFile Debug
Running command: make -f MakeFile Debug
kernel/Kboot.cpp: In function ‘void kernel_main(uint32_t, multiboot_info_t*)’:
kernel/Kboot.cpp:56:31: warning: unused parameter ‘multiboot_magic’ [-Wunused-parameter]
56 | void kernel_main(uint32_t multiboot_magic, multiboot_info_t *multiboot)
| ~~~~~~~~~^~~~~~~~~~~~~~~
kernel/Kboot.cpp:56:66: warning: unused parameter ‘multiboot’ [-Wunused-parameter]
56 | void kernel_main(uint32_t multiboot_magic, multiboot_info_t *multiboot)
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~
CXX kernel/Kboot.cpp
i686-linux-gnu-g++-10 -g -MD -no-pie -lgcc -nostartfiles -c kernel/boot.s -o build/kernel/boot.s.o
make: *** No rule to make target 'build/CLib/stdio/prinf.c.o', needed by 'CLib'. Stop.
Kernel linked
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 2 warning(s) (0 minute(s), 0 second(s))