Raspberry makefile

Jac*_*cob 1 c makefile raspberry-pi

我正在尝试将程序从我的cloud9-ide移动到我的覆盆子.但是当我移动它们时,makefile不再有效.

#
# Makefile
#
# Computer Science 50
# Problem Set 5
#


# compiler to use
CC = clang

# flags to pass compiler
CFLAGS = -ggdb3 -O0 -Qunused-arguments -std=c11 -Wall -Werror

# name for executable
EXE = myTest

# space-separated list of header files
HDRS = i2cContinuousRead.h

# space-separated list of libraries, if any,
# each of which should be prefixed with -l
LIBS =

# space-separated list of source files
SRCS = myTest.c i2cContinuousRead.c

# automatically generated list of object files
OBJS = $(SRCS:.c=.o)


# default target
$(EXE): $(OBJS) $(HDRS) Makefile
    $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)

# dependencies 
$(OBJS): $(HDRS) Makefile

# housekeeping
clean:
    rm -f core $(EXE) *.o
Run Code Online (Sandbox Code Playgroud)

我得到错误输出

clang -ggdb3  -Qunused-arguments -std=c11 -Wall -Werror   -c -o myTest.o myTest.c
make: clang: Command not found
<builtin>: recipe for target 'myTest.o' failed
make: *** [myTest.o] Error 127
Run Code Online (Sandbox Code Playgroud)

我试图更新sudo apt-get install build-essential

如果jessy,我有一个全新的安装.

有小费吗?

e.j*_*dar 5

不知道你为什么要用clang进行编译,但是在makefile中使用CC = gcc让你用gcc编译你的应用程序,但是如果你真的需要clang,你可以用它来安装它

sudo apt-get install clang llvm