問題爲了使用庫的我需要改變一個生成文件來利用交叉編譯器臂-NONE-EABI-G ++的代替臂-NONE-EABI-GCC;但是,由於某些奇怪的原因,我不斷收到No rule to make target
錯誤。我刪除了依賴關係,只留下了啓動代碼和main,我也試圖使用文件的絕對路徑。但是,我仍然收到錯誤。有沒有人有什麼建議?與生成文件
PROJECT_NAME=test-liv
BUILDDIR = build
LIBDIR = ../common
DEVICE = $(LIBDIR)/STM32F4xx
CORE = $(LIBDIR)/CMSIS
PERIPH = $(LIBDIR)/STM32F4xx_StdPeriph_Driver
PROJHEADERS = inc
PROJ_LIBDIR = lib
#SOURCES = src/main.cpp
SOURCES = startup_stm32f4xx.S
SOURCES += system_stm32f4xx.c
SOURCES += LibraryHacks.cpp
SOURCES += src/main.cpp
#SOURCES += $(PERIPH)/src/
#PROJECT SOURCES
#SOURCES += $(PROJ_LIBDIR)/src/
OBJECTS = $(addprefix $(BUILDDIR)/, $(addsuffix .o, $(abspath $(basename $(SOURCES)))))
INCLUDES += -I$(DEVICE) \
-I$(PROJHEADERS) \
-I$(CORE) \
-I$(PERIPH)/inc \
-I$(PROJ_LIBDIR)/inc \
-Isrc \
-I.
ELF = $(BUILDDIR)/$(PROJECT_NAME).elf
HEX = $(BUILDDIR)/$(PROJECT_NAME).hex
BIN = $(BUILDDIR)/$(PROJECT_NAME).bin
CXX = arm-none-eabi-g++
LD = arm-none-eabi-g++
AR = arm-none-eabi-ar
OBJCOPY = arm-none-eabi-objcopy
GDB = arm-none-eabi-gdb
SIZE = arm-none-eabi-size
CXXFLAGS = -O0 -g -Wall -I.\
-std=c++11 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork \
-mfpu=fpv4-sp-d16 -mfloat-abi=hard \
$(INCLUDES) -DUSE_STDPERIPH_DRIVER
SEMIHOSTING_FLAGS = --specs=rdimon.specs -lc -lrdimon
LDSCRIPT = stm32_flash.ld
LDFLAGS += -T$(LDSCRIPT) -mthumb -mcpu=cortex-m4
$(BIN): $(ELF)
$(OBJCOPY) -O binary $< [email protected]
$(HEX): $(ELF)
$(OBJCOPY) -O ihex $< [email protected]
$(ELF): $(OBJECTS)
$(LD) $(LDFLAGS) $(CFLAGS) $(SEMIHOSTING_FLAGS) -o [email protected] $(OBJECTS) $(LDLIBS)
$(SIZE) [email protected]
$(BUILDDIR)/%.o: %.c
mkdir -p $(dir [email protected])
$(CXX) -c $(CXXFLAGS) $< -o [email protected]
$(BUILDDIR)/%.o: %.S
mkdir -p $(dir [email protected])
$(CXX) -c $(CXXFLAGS) $< -o [email protected]
flash: $(BIN)
st-flash write $(BIN) 0x8000000
debug: $(ELF)
$(GDB) -tui $(ELF)
openocd: $(ELF)
openocd -f board/stm32f4discovery.cfg
all: $(HEX) $(BIN) $(ELF)
functions: all
.PHONY: clean
clean:
rm -rf build
編輯:我刪除了其他依賴,離開LibraryHacks和主,並根據whichone完整的錯誤消息首先它仍然給了我同樣的錯誤
mkdir -p build//*Removed*/
arm-none-eabi-g++ -c -O0 -g -Wall -I. -std=c++11 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=hard -I../common/STM32F4xx -Iinc -I../common/CMSIS -I../common/STM32F4xx_StdPeriph_Driver/inc -Ilib/inc -Isrc -I. -DUSE_STDPERIPH_DRIVER /*Removed*/startup_stm32f4xx.S -o build//*Removed*/startup_stm32f4xx.o
mkdir -p build//*Removed*/
arm-none-eabi-g++ -c -O0 -g -Wall -I. -std=c++11 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork -mfpu=fpv4-sp-d16 -mfloat-abi=hard -I../common/STM32F4xx -Iinc -I../common/CMSIS -I../common/STM32F4xx_StdPeriph_Driver/inc -Ilib/inc -Isrc -I. -DUSE_STDPERIPH_DRIVER /*Removed*/system_stm32f4xx.c -o build//*Removed*/system_stm32f4xx.o
make: *** No rule to make target `build//*Removed*/LibraryHacks.o', needed by `build/hx8352a-lcd.elf'. Stop.
它們在路徑中也沒有空格 – kdgwill
如果你把這個makefile和arm-none-eabi-gcc替換成arm-none-eabi-gcc,它可以正常工作嗎? – Beta
當項目只有C是的,但現在當回到arm-none-eabi-gcc並將標誌修改爲c99時,它給了我完全相同的輸出 – kdgwill