fix multi core compile

This commit is contained in:
zhangsheng 2026-03-10 10:49:05 +08:00
parent a31550c604
commit 578d4312b9

View File

@ -38,12 +38,12 @@ CPP_SRCDIR = $(AllDirs)
CPP_SOURCES = $(foreach d,$(CPP_SRCDIR),$(wildcard $(d)/*.cpp) )
CPP_OBJS = $(patsubst %.cpp, $(OBJ_PATH)/%.o, $(CPP_SOURCES))
default:init compile strip
default: init $(TARGET) strip
$(C_OBJS):$(OBJ_PATH)/%.o:%.c
$(C_OBJS):$(OBJ_PATH)/%.o:%.c | init
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
$(CPP_OBJS):$(OBJ_PATH)/%.o:%.cpp
$(CPP_OBJS):$(OBJ_PATH)/%.o:%.cpp | init
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
init:
@ -55,7 +55,9 @@ test:
@echo "CPP_SOURCES: $(CPP_SOURCES)"
@echo "CPP_OBJS: $(CPP_OBJS)"
compile:$(C_OBJS) $(CPP_OBJS)
compile: $(TARGET)
$(TARGET): $(C_OBJS) $(CPP_OBJS)
$(CC) -O2 -o $(TARGET) $^ $(LINKFLAGS) $(LIBS)
clean:
@ -67,7 +69,7 @@ install: $(TARGET)
uninstall:
rm -f $(PREFIX_BIN)/$(TARGET)
strip:
strip: $(TARGET)
$(STRIP) $(TARGET)
cp $(TARGET) ~/tftpboot