c++ - 制作一个关于 qtopia 错误的文件

标签 c++ linux

我正在尝试在 friendlyARM qtopia 2.2.0 上编译程序 但我遇到了一些错误,坦率地说,我不知道自己在做什么。

生成文件代码:

IDIR =./
CC=gcc
CFLAGS=-I$(IDIR)

ODIR=obj
LDIR =./

LIBS=-lgd -lrt

_DEPS = main.h Makefile
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))

_OBJ = main.o serial.o fb.o menu_main.o timer.o cmdin.o buzzer.o statemachine.o inout.o network.o text_file_input.o text_file_input_oven.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))


$(ODIR)/%.o: %.c $(DEPS)
    $(CC) -c -o $@ $< $(CFLAGS)

main: $(OBJ)
    gcc -o $@ $^ $(CFLAGS) $(LIBS)

.PHONY: clean

clean:
    rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ 

错误代码:

/sdcard/images/makef # Makefile
Makefile: line 1: IDIR: not found
Makefile: line 3: IDIR: not found
Makefile: line 6: LDIR: not found
Makefile: line 8: -lrt: not found
Makefile: line 10: _DEPS: not found
Makefile: line 11: IDIR: not found
Makefile: line 11: _DEPS: not found
Makefile: line 11: patsubst: not found
Makefile: line 11: DEPS: not found
Makefile: line 13: _OBJ: not found
Makefile: line 14: ODIR: not found
Makefile: line 14: _OBJ: not found
Makefile: line 14: patsubst: not found
Makefile: line 14: OBJ: Permission denied
Makefile: line 17: ODIR: not found
Makefile: line 17: DEPS: not found
Makefile: line 17: /%.o:: not found
Makefile: line 18: CC: not found
Makefile: line 18: CFLAGS: not found
Makefile: line 18: can't open : no such file
Makefile: line 18: -c: not found
Makefile: line 20: OBJ: Permission denied
Makefile: line 20: main:: not found
Makefile: line 21: CFLAGS: not found
Makefile: line 21: LIBS: not found
Makefile: line 21: gcc: not found
Makefile: line 23: .PHONY:: not found
Makefile: line 25: clean:: not found
Makefile: line 26: ODIR: not found
Makefile: line 26: INCDIR: not found

最佳答案

您不能执行 Makefile 文件本身。您需要使用 make 命令。

关于c++ - 制作一个关于 qtopia 错误的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23017826/

相关文章:

c++ - 我不明白如何在 C++ 中创建和使用动态数组

c++ - 如何制作Qt委托(delegate)编辑器 'sticky'

linux - 通过 git 获取新的和修改的(真实状态)文件

php - SQL Server 中当前选择的数据库

javascript - 为什么 Mozilla Firefox 会抛出语法错误?

java - 将多继承 C++ 代码移植到 Java

c++ - 我如何将 'int' 的数组初始化为 c++11 中的类成员?

c++ - 将原始数据输出到扬声器

linux - Mac OSX 文件权限具有 '@' - 如何删除该 '@'

linux - 起订量 : running "moq": exec: "moq": executable file not found in $PATH