在qtopia错误上创建一个文件

时间:2014-04-11 16:22:34

标签: c++ linux

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

Makefile代码:

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

1 个答案:

答案 0 :(得分:1)

您无法自行执行Makefile文件。您需要使用make命令。