1
#ident "@(#)r-smake.dep 1.8 02/10/11 "
2
###########################################################################
3
# Written 1996 by J. Schilling
4
###########################################################################
6
# Dependency building rules for smake
8
###########################################################################
9
# This program is free software; you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2, or (at your option)
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program; see the file COPYING. If not, write to
21
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22
###########################################################################
24
RMDEP= $(RM) $(RM_FORCE) $(ARCHDIR)/$@
25
DEP_FILE= $(CFILES:%.c=%.d)
26
PDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d)
27
PALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(ARCHDIR)/$(TARGET).dep
28
###########################################################################
29
depend: rmdep $(DEP_FILE)
32
$(RM) $(RM_FORCE) $(PALLDEP_FILE)
34
###########################################################################
36
# Make the complete path to the architecture subdirectory.
38
###########################################################################
42
###########################################################################
44
# Generate dependency file(s).
45
# This rules is checked when the dependency file(s) are included.
47
# Modify the the path for .o files to reflect that they are placed in
48
# $(ARCHDIR). Add the dependency file itself to each line so that
49
# the dependencies will be rebuilt if a source is newer that the
50
# appropriate dependency file.
52
###########################################################################
54
$(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $< \
55
| sed -e 's;^\(.*\)\.o[ ]*:;\1.o \1.d:;' > $(ARCHDIR)/$@
58
$(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $< \
59
| sed -e 's;^\(.*\)\.o[ ]*:;\1.o \1.d:;' > $(ARCHDIR)/$@
65
# $(MKDEP) $(CPPFLAGS) -f - $(CFILES) \
66
# | sed -e 's;^\(.*\.o[ ]*:\);$(ARCHDIR)/\1;' > $@
68
###########################################################################
70
# Include the dependency file(s) generated from the rules above.
72
###########################################################################
73
include Dnull $(DEP_FILE)