#ident "@(#)r-make.dep 1.10 15/03/26 " ########################################################################### # Written 1996 by J. Schilling ########################################################################### # # Dependency building rules for make # ########################################################################### # 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. # A copy of the CDDL is also available via the Internet at # http://www.opensource.org/licenses/cddl1.txt # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file CDDL.Schily.txt from this distribution. ########################################################################### # Note that we currently do not support C++ with Sun make as Sun make # only allows one file to folllow a include directive # DEP_SUFFIX= .dep RMDEP= $(RM) $(RM_FORCE) $@ ___C++DEP_FILES= $(C++FILES:%.C=$(ARCHDIR)/%.d) __C++DEP_FILES= $(___C++DEP_FILES:%.cc=$(ARCHDIR)/%.d) _C++DEP_FILES= $(__C++DEP_FILES:%.cpp=$(ARCHDIR)/%.d) C++DEP_FILES= $(_C++DEP_FILES:%.cxx=$(ARCHDIR)/%.d) C++PDEP_FILES= $(C++DEP_FILES) DEP_FILE= $(ARCHDIR)/$(TARGET).dep PDEP_FILE= $(ARCHDIR)/$(TARGET).dep 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. # Make $(ARCHDIR)/man as well here to avoid this directory to become root # owned when root later calls "make install". # ########################################################################### $(ARCHDIR) $(ARCHDIR)/man: $(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)/%.dep: %.c $(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $< \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(DEP_FILE):;' > $@ $(DEP_FILE): $(DEP_DEP) $(CFILES) $(MKDEP) $(CPPFLAGS) $(MKDEP_OUT) $(CFILES) \ | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(DEP_FILE):;' > $@ $(DEP_DEP): @if [ ! -f $@ ]; then \ echo " ==> MAKING DIRECTORY \"$(ARCHDIR)\""; \ $(_MKDIR) -p $(ARCHDIR); \ echo " ==> MAKING DIRECTORY \"$(ARCHDIR)/man\""; \ $(_MKDIR) -p $(ARCHDIR)/man; \ echo > $@; \ fi ########################################################################### # # Include the dependency file(s) generated from the rules above. # ########################################################################### include $(DEP_FILE)