我的 Makefile to AVR 项目没有编译程序

问题描述

我一直在学习 make 程序。我想通过 AtMega8 对 LCD 进行编程并使用 Makefile 对其进行编译。我写了这个基本代码:

man find

我写了这个 Makefile:

#ifndef __AVR_ATmega8__
#define __AVR_ATmega8__
#endif
 
#define F_CPU 8000000UL
 
#include <avr/io.h>
#include <util/delay.h>
#include "hd44780.h"
 
 
int main(void)
{   
    lcd_init();
    lcd_clrscr();
    lcd_puts("Hello World");
 
    while (1);
 
    return 0;
}

编译时make显示错误:

all: main.hex clean
 
main.o: main.cpp hd44780.h
    avr-gcc -Wall -Os -mmcu=atmega8 -c $< -o $@
 
main.elf: main.o
    avr-gcc -Wall -Os -mmcu=atmega8 -o main.elf main.o
 
main.hex: main.elf
    avr-objcopy -j .text -j .data -O ihex main.elf main.hex
    avr-size --format=avr --mcu=atmega8 main.elf
 
.PHONY: clean
clean:
    rm main.o main.elf

有什么问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...