Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] how to use makedepend?



Hello tlugers,

How come makedepend doesn't recursively include included directories?
I got '$ make depend' to find all the files it said were needed and
add them to a Makefile, but I need to include the whole path to the
directory where every header is located. If makedepend saves time, it
should figure out locations automatically, right?
How can  I tell makedepend that on Ubuntu 8.10, stdarg.h is located
in/usr/lib/gcc/avr/4.3.0/include/stdarg.h without me putting the path,
down to the directory, in the Makefile?

Thanks,
Miles


here's what I had to add to my Makefile to get makedepend to stop complaining:

DEPEND=makedepend $(CFLAGS) -I/usr/include/linux -I/usr/lib/gcc
-I/usr/lib/gcc/i486-linux-gnu/4.3/include
depend: $(OBJECTS)
        $(DEPEND) $(SRCS)

here's the rest of the files I was using, as they were when I was
still getting errors:

[file hello.c]
#include "hello.h"
int main() {
    printf("Hello world.");
    return 0;
}

[file hello.h]
#ifndef _HELLO_H
#define _HELLO_H
#include <stdio.h>
#endif // _HELLO_H

[Makefile, causes warnings below when running '$ make depend']
SRCS=hello.c hello.h
CC=gcc
CFLAGS =
OBJECTS = hello.o
DEPEND=makedepend $(CFLAGS) #-I/usr/include/linux -I/usr/lib/gcc
-I/usr/lib/gcc/i486-linux-gnu/4.3/include
project1: $(OBJECTS)
        $(CC) $(OBJECTS) -o hello.out
depend: $(OBJECTS)
        $(DEPEND) $(SRCS)

[the warnings from '$ make depend']
mcolman@example.com:~/src/tmake$ make depend
makedepend   hello.c hello.h
makedepend: warning:  hello.c (reading /usr/include/stdio.h, line 34):
cannot find include file "stddef.h"
        not in /usr/include/stddef.h
makedepend: warning:  hello.c (reading /usr/include/_G_config.h, line
15): cannot find include file "stddef.h"
        not in /usr/include/stddef.h
makedepend: warning:  hello.c (reading /usr/include/wchar.h, line 52):
cannot find include file "stddef.h"
        not in /usr/include/stddef.h
makedepend: warning:  hello.c (reading /usr/include/libio.h, line 53):
cannot find include file "stdarg.h"
        not in /usr/include/stdarg.h


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links