Fix for SF bug #1060749: focusWindowMS (macro.c) causes crash.
[nedit.git] / makefiles / Makefile.depend
blob8b0f52054693bb92f7b9e92a617ee043ebb7e980
1 # $Id: Makefile.depend,v 1.5 2003/05/20 00:27:55 n8gray Exp $
3 # This is a _generic_ Makefile to generate a dependency file
4 # using GNUmake and gcc.
5 # Advantage of this method (as compared to "makedepend(1)")
6 # is that one can easily filter out dependencies on
7 # non-application (i.e. system) headers using the -MM flag
8 # of gcc. The reason to demand GNUMake is basically to have a nice,
9 # simple rule for $(SRCS) as done below (and for the variable
10 # transformations).
11 # So one doesn't have to modify this file and manually add/update
12 # the source file list!
14 # To use it just you probably just have to edit the
15 # variables in the *CONFIG section* as you see fit.
18 # ***************** CONFIG section *****************
20 GCC=gcc
21 DEFINES=
22 CPPFLAGS=-I$(HOME)/include
23 DEPENDFILE=dependencies
24 SHELL=/bin/sh
26 # Headers are required to determine _all_ files
27 # on which the dependency file itself may depend
28 SRCS=$(wildcard *.c)
29 HDRS=$(wildcard ../source/*.h) $(wildcard ../util/*.h)
31 # *************** End CONFIG section ************
35 # ************** Now the generic part ***********
37 .SUFFIXES: .c .o. deps
38 .PHONY: all default deps new
41 DEPS=$(SRCS:.c=.deps)
43 default: all
45 # This is the more conservative approach
46 full: clean new deps
48 # And this a more sophisticated one
49 all: $(DEPENDFILE)
51 # Remove old file, create new one and add CVS info line at top
52 new:
53         /bin/rm -f $(DEPENDFILE)
54         echo '# $$''Id''$$' >$(DEPENDFILE)
57 $(DEPENDFILE): new $(SRCS) $(HDRS)
58         $(GCC) $(CPPFLAGS) $(DEFINES) -MM $(SRCS) >>$(DEPENDFILE)
60 deps: $(DEPS)
62 %.deps: %.c
63         $(GCC) $(CPPFLAGS) $(DEFINES) -MM $< >>$(DEPENDFILE)
65 verify_config: