www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/24/01:15:59

Date: Wed, 23 Nov 1994 20:28:44 -0800 (PST)
From: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
To: "Peter K. Campbell" <p DOT campbell AT trl DOT OZ DOT AU>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu, p DOT campbell AT trl DOT OZ DOT AU
Subject: Re: Make depend on DOS?

On Thu, 24 Nov 1994, Peter K. Campbell wrote:

> This would merely be annoying, except for the fact that I can find
> nothing to automatically generate dependencies, which means it looks
> like I have to go through and add a useless:
> 	name.o: name.c
> line for every one of my source files.
> 

For the name.o: name.c you can of course just use

.o.c :
	gcc $(CFLAGS) -c $< -o $@


You can use the -M or -MM options to gcc, which generate dependency
files:

.PHONY: depend
depend :
	gcc -MM *.c *.cc > makefile.dep

The difference between -M and -MM is that -MM does not include
the system header files (actually anything included with the <>
syntax) in the list of dependencies.

Gordon


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019