Make: cannot find makedepend

I am trying to run the following makefile

CMDLINE_SRC=$(wildcard commandLine/*.c)
CMDLINE_OBJS = $(CMDLINE_SRC:.c=.o)
EXECUTABLES = $(CMDLINE_SRC:.c=)

LIB_SRC=$(wildcard c/*.c)
LIB_OBJ = $(LIB_SRC:.c=.o)
LIB_OUT = lib/libclinrisk.a

INCLUDES = -I include

# compiler
CC = gcc
CCFLAGS = 
LDFLAGS = 

# library paths
LIBS = -Llib -lclinrisk -lm

.SUFFIXES: .c

default: dep executables

executables: $(EXECUTABLES)
    cp $(EXECUTABLES) executables

$(EXECUTABLES): $(LIB_OUT)

.c:
    $(CC) $(INCLUDES) $(LDFLAGS) $< -o $@ $(LIBS)

.c.o:
    $(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

$(LIB_OUT): $(LIB_OBJ)
    ar rcs $(LIB_OUT) $(LIB_OBJ)

depend: dep

dep:
    makedepend -- $(CFLAGS) -- -I /usr/include/linux $(INCLUDES) $(LIB_SRC)

clean:
    rm -f $(LIB_OBJ) $(LIB_OUT) Makefile.bak
    rm -f $(CMDLINE_OBJ) $(CMDLINE_PROGS) 
    rm -f executables/*

# DO NOT DELETE

      

and getting the following error message:

$ make
makedepend --  -- -M
make: makedepend: Command not found
make: *** [dep] Error 127

      

I understand that I may not have makedepend install as if I were pressing tab after typing in make I get:

$ make <TAB>
clean        default      dep          depend       executables  makefile

      

If so that I don't have makedepend installed, how to install and specify

makedepend -- $(CFLAGS) -- -I /usr/include/linux $(INCLUDES) $(LIB_SRC)

      

what should he point to?

thank!

UPDATE: Davids' answer solved the problem ...

however i am now stuck:

$ make
makedepend --  -- -I /usr/include/linux -I include 
cp  executables
cp: missing destination file operand after `executables'
Try `cp --help' for more information.
make: *** [executables] Error 1

      

I suspect this is a problem with the actual makefile ....

+3


source to share


1 answer


You will miss the tool makedepend

.

Install it by compiling from source (so you are not distro dependent) following these instructions:



Download and install makedepend

+3


source







All Articles