I have this makefile and Im trying to compile using cygwin.I have this linker error make collect2.exe: error: ld returned 1 exit status error, and I don't know how to get rid of it.
####################################### target######################################TARGET = blinkingled####################################### building variables####################################### optimizationOPT = -Og######################################## paths######################################## Build pathBUILD_DIR = build####################################### source####################################### C sourcesSRCS = main_cm0plus.cSRCS += system_tviibe1m_cm0plus.cSRCS += startup.cSRCS += $(wildcard src/drivers/adc/*.c)SRCS += $(wildcard src/drivers/canfd/*.c)SRCS += $(wildcard src/drivers/cpu/*.c)SRCS += $(wildcard src/drivers/crypto/*.c)SRCS += $(wildcard src/drivers/dma/*.c)SRCS += $(wildcard src/drivers/evtgen/*.c)SRCS += $(wildcard src/drivers/flash/*.c)SRCS += $(wildcard src/drivers/gpio/*.c)SRCS += $(wildcard src/drivers/ipc/*.c)SRCS += $(wildcard src/drivers/lin/*.c)SRCS += $(wildcard src/drivers/lvd/*.c)SRCS += $(wildcard src/drivers/mcwdt/*.c)SRCS += $(wildcard src/drivers/mpu/*.c)SRCS += $(wildcard src/drivers/prot/*.c)SRCS += $(wildcard src/drivers/scb/*.c)SRCS += $(wildcard src/drivers/smartio/*.c)SRCS += $(wildcard src/drivers/srom/*.c)SRCS += $(wildcard src/drivers/sysclk/*.c)SRCS += $(wildcard src/drivers/sysflt/*.c)SRCS += $(wildcard src/drivers/sysint/*.c)SRCS += $(wildcard src/drivers/syslib/*.c)SRCS += $(wildcard src/drivers/syspm/*.c)SRCS += $(wildcard src/drivers/sysreset/*.c)SRCS += $(wildcard src/drivers/sysrtc/*.c)SRCS += $(wildcard src/drivers/systick/*.c)SRCS += $(wildcard src/drivers/syswdt/*.c)SRCS += $(wildcard src/drivers/tcpwm/*.c)SRCS += $(wildcard src/drivers/trigmux/*.c)SRCS += $(wildcard src/interrupts/rev_d/*.c)SRCS += $(wildcard src/mw/button/*.c)SRCS += $(wildcard src/mw/flash/*.c)SRCS += $(wildcard src/semihosting/*.c)SRCS += $(wildcard src/swtimer/*.c)SRCS += $(wildcard src/startup/*.c)SRCS += $(wildcard src/system/*.c)# ASM sourcesASM_SOURCES = "C:/data/traveo/TVII_Sample_Driver_Library_7.1.0/tviibe1m/src/startup_cm0plus.s"#startup_cm0plus.s ######################################## binaries#######################################PREFIX = arm-none-eabi-# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)# either it can be added to the PATH environment variable.ifdef GCC_PATHCC = $(GCC_PATH)/$(PREFIX)gccAS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cppCP = $(GCC_PATH)/$(PREFIX)objcopySZ = $(GCC_PATH)/$(PREFIX)sizeelseCC = $(PREFIX)gccAS = $(PREFIX)gcc -x assembler-with-cppCP = $(PREFIX)objcopySZ = $(PREFIX)sizeendifHEX = $(CP) -O ihexBIN = $(CP) -O binary -S######################################## CFLAGS######################################## cpuCPU = -mcpu=cortex-m0plus# fpuFPU = -mfpu=fpv4-sp-d16# float-abiFLOAT-ABI = -mfloat-abi=soft# mcuMCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)# macros for gcc# AS definesAS_DEFS = # C defines#C_DEFS = ../../# AS includesAS_INCLUDES = # C includesINCDIRS = ../../common/hdrINCDIRS += ../../common/hdr/cmsis/includeINCDIRS += ../../common/src/driversINCDIRS += ../../common/src/drivers/sysclkINCDIRS += ../../common/src/drivers/flashINCDIRS += ../../common/src/drivers/syslibINCDIRS += ../../common/src/drivers/mcwdtINCDIRS += ../../tviibe1m/hdr/rev_dINCDIRS += ../../tviibe1m/hdr/rev_d/ipINCDIRS += ../../tviibe1m/src/system/rev_dINCDIRS += ../../tviibe1m/hdr/rev_d/mcuregINCDIRS += ../../tviibe1m/src/drivers/INCDIRS += ../../common/src/drivers/syswdtINCDIRS += ../../common/src/mwINCLUDE = $(addprefix -I,$(INCDIRS))# compile gcc flagsASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sectionsCFLAGS = $(MCU) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections -mthumb -mno-thumb-interwork -mfpu=vfp -msoft-float ifeq ($(DEBUG), 1)CFLAGS += -g -gdwarf-2endif# My C flags:CFLAGS += -Wno-unused-variable# Generate dependency informationCFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"######################################## LDFLAGS######################################## link scriptLDSCRIPT = "c:/data/traveo/TVII_Sample_Driver_Library_7.1.0/tviibe1m/src/linker.ld"# librariesLIBS = -lc -lm -lnosys LIBDIR = LDFLAGS = $(MCU) --specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections# default action: build allall: $(TARGET)blinkingled: main_cm0plus.o system_tviibe1m_cm0plus.o startup.o $(CC) $^ -o $@main_cm0plus.o: main_cm0plus.c $(CC) $(CFLAGS) main_cm0plus.csystem_tviibe1m_cm0plus.o: system_tviibe1m_cm0plus.c cy_project.h cy_device_headers.h $(CC) $(CFLAGS) system_tviibe1m_cm0plus.cstartup.o: startup.c startup_customize.h $(CC) $(CFLAGS) startup.cBIN_NAME = $(addprefix $(BUILD_DIR), $(TARGET)).PHONY: allall: $(BIN_NAME).elfall: $(BIN_NAME).binall: $(BIN_NAME).s19all: $(BIN_NAME).hexall: $(BIN_NAME).lstall: print_size%.bin: %.elf $(CP) -O binary -S $< $@%.s19: %.elf $(CP) -O srec -S $< $@%.hex: %.elf $(OBJCOPY) -O ihex -S $< $@%.lst: %.elf $(CP) -d $< > $@.PHONY: print_sizeprint_size: $(BIN_NAME).elf $(SIZE) $<######################################## build the application######################################## list of objectsOBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))vpath %.c $(sort $(dir $(C_SOURCES)))# list of ASM program objectsOBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))vpath %.s $(sort $(dir $(ASM_SOURCES)))$(BUILD_DIR)/%.o: %.c makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@$(BUILD_DIR)/%.o: %.s makefile | $(BUILD_DIR) $(AS) -c $(CFLAGS) $< -o $@$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) makefile $(CC) $(OBJECTS) $(LDFLAGS) -o $@ $(SZ) $@$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(HEX) $< $@$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) $(BIN) $< $@ $(BUILD_DIR): mkdir $@ ######################################## clean up#######################################clean: -rm -fR $(BUILD_DIR)######################################## dependencies#######################################-include $(wildcard $(BUILD_DIR)/*.d)# *** EOF ***
this is the error im getting:
c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v6-m/nofp\libc.a(lib_a-exit.o): in function `exit':exit.c:(.text.exit+0x18): undefined reference to `_exit'c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\cygwin64\tmp\cc8Euh2e.o: in function `main':main_cm0plus.c:(.text.main+0x2): undefined reference to `SystemInit'c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: main_cm0plus.c:(.text.main+0xa): undefined reference to `Cy_SysEnableApplCore'c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: main_cm0plus.c:(.text.main+0x14): undefined reference to `Cy_GPIO_Pin_Init'c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: main_cm0plus.c:(.text.main+0x1a): undefined reference to `Cy_SysTick_DelayInUs'c:/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: main_cm0plus.c:(.text.main+0x28): undefined reference to `__cm4_vector_base_linker_symbol'collect2.exe: error: ld returned 1 exit statusmake: *** [makefile:172: main_cm0plus.o] Error 1
line 172 is:
main_cm0plus.o: main_cm0plus.c $(CC) $(CFLAGS) main_cm0plus.c
Does anyone know how to solve this problem?thanks