Jacob
Jacob

Reputation: 371

Raspberry makefile

I am trying to move a program from my cloud9-ide to my raspberry. But when I move them the makefile no longer works.

#
# 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

I get the error output

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

I tried to update sudo apt-get install build-essential

I have a fresh install if jessy.

Any tips?

Upvotes: 1

Views: 311

Answers (2)

TeaMonkie
TeaMonkie

Reputation: 169

It seems you haven't installed clang on your system. You can install it as suggested by e.jahandar or use the standard gcc compiler shipped with the linux distro jessy.

Upvotes: 3

e.jahandar
e.jahandar

Reputation: 1763

Not sure why you're compiling with clang, but letting CC = gcc in makefile let you compile your application with gcc, but if you really need clang, you can install it with

sudo apt-get install clang llvm

Upvotes: 5

Related Questions