#ident "@(#)r-gmake.dep 1.13 06/07/21 " ########################################################################### # Written 1996 by J. Schilling ########################################################################### # # Dependency building rules for gmake # ########################################################################### # Copyright (c) J. Schilling ########################################################################### # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # See the file CDDL.Schily.txt in this distribution for details. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file CDDL.Schily.txt from this distribution. ########################################################################### DEP_SUFFIX= .d RMDEP= $(RM) $(RM_FORCE) $@ ___C++DEP_FILES= $(C++FILES:%.C=%.d) __C++DEP_FILES= $(___C++DEP_FILES:%.cc=%.d) _C++DEP_FILES= $(__C++DEP_FILES:%.cpp=%.d) C++DEP_FILES= $(_C++DEP_FILES:%.cxx=%.d) C++PDEP_FILES= $(C++DEP_FILES:%=$(ARCHDIR)/%) DEP_FILE= $(CFILES:%.c=%.d) $(C++DEP_FILES) PDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) PALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) $(ARCHDIR)/$(TARGET).dep DEP_DEP= $(ARCHDIR)/Dnull ########################################################################### depend: rmdep $(DEP_FILE) rmdep: $(RM) $(RM_FORCE) $(PALLDEP_FILE) ########################################################################### # # Make the complete path to the architecture subdirectory. # ########################################################################### $(ARCHDIR): $(MKDIR) -p $@ ########################################################################### # # Generate dependency file(s). # This rules is checked when the dependency file(s) are included. # # Modify the the path for .o files to reflect that they are placed in # $(ARCHDIR). Add the dependency file itself to each line so that # the dependencies will be rebuilt if a source is newer that the # appropriate dependency file. # ########################################################################### $(ARCHDIR)/%.d: %.c $(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o \1.d:;' > $@ $(ARCHDIR)/%.d: %.C $(MKC++DEP) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o \1.d:;' > $@ $(ARCHDIR)/%.d: %.cc $(MKC++DEP) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o \1.d:;' > $@ $(ARCHDIR)/%.d: %.cpp $(MKC++DEP) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o \1.d:;' > $@ $(ARCHDIR)/%.d: %.cxx $(MKC++DEP) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o \1.d:;' > $@ #$(DEP_FILE): $(DEP_DEP) $(CFILES) # $(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $(^:%$(DEP_DEP)=%) \ # | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(DEP_FILE):;' > $@ $(PDEP_FILE): $(DEP_DEP) $(PDEP_FILE): $(DEP_DEP) $(DEP_DEP): $(ARCHDIR) @if [ ! -f $@ ]; then \ echo > $@; \ fi ########################################################################### # # Include the dependency file(s) generated from the rules above. # ########################################################################### -include $(PDEP_FILE)