4Fermer6
ElBartoLe 11/10/2016 à 09:15
Sous FreeBSD on a mkdep pour ca :

Makefile:CC?= cc SRCS= main.c test.c OBJS= $(SRCS:.c=.o) NAME= test CFLAGS= -Wall ${NAME}: ${OBJS} ${CC} ${OBJS} -o ${NAME} clean: rm -f ${OBJS} ${NAME} depend: mkdep ${SRCS}
main.c:#include "test.h" int main(int argc, char *argv[]) { test(); return (0); }
test.c:#include <stdio.h> void test(void) { printf("Test\n"); }
test.hvoid test(void);
Quand je "make depend" ca cree un .depend avec les dependance que make(1) interprete automatiquement

.depend:# main.c test.c main.o: main.c test.h test.o: test.c /usr/include/stdio.h /usr/include/sys/cdefs.h \ /usr/include/sys/_null.h /usr/include/sys/_types.h \ /usr/include/machine/_types.h /usr/include/x86/_types.h \ /usr/include/machine/_limits.h /usr/include/x86/_limits.h