def get_dep_outname(self, infilenames):
    if (self.depfile is None):
        raise InvalidArguments('Tried to get depfile name for custom_target that does not have depfile defined.')
    if len(infilenames):
        plainname = os.path.basename(infilenames[0])
        basename = os.path.splitext(plainname)[0]
        return self.depfile.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname)
    else:
        if (('@BASENAME@' in self.depfile) or ('@PLAINNAME@' in self.depfile)):
            raise InvalidArguments('Substitution in depfile for custom_target that does not have an input file.')
        return self.depfile
def get_dep_outname(self, infilenames):
    if (self.depfile is None):
        raise InvalidArguments('Tried to get depfile name for custom_target that does not have depfile defined.')
    if len(infilenames):
        plainname = os.path.basename(infilenames[0])
        basename = os.path.splitext(plainname)[0]
        return self.depfile.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname)
    else:
        if (('@BASENAME@' in self.depfile) or ('@PLAINNAME@' in self.depfile)):
            raise InvalidArguments('Substitution in depfile for custom_target that does not have an input file.')
        return self.depfile