The following sentence is too difficult for me to understand.

A target created in the same directory that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time.

The main question is: which one, 'a target' or 'the same directory', is referred by 'that'?

If only someone would help me break this sentence down into simple ones. Thanks in advance.

  • Hi EastWhite, it would help us to answer your question if you provide a bit more context for this sentence, and if possible a link to the place that you found it. I'm guessing that it's a description of some kind of make utility, but let's not work on guesses...
    – JavaLatte
    Aug 23 '20 at 14:17
  • Hi @JavaLatte. So the antecedent of 'that' can be 'a target' or 'directory', from grammar opinion, right? If it's true. I've understood the sentence. thanks a lot.
    – EastWhite
    Aug 24 '20 at 3:48
  • as far as I am concerned, the sentence is ambiguous. I would want to see the context of the sentence to decide whether it refers to target, same directory, or something that was measured in the previous sentence.
    – JavaLatte
    Aug 24 '20 at 13:09
  • @JavaLatte, It's in the link
    – EastWhite
    Aug 24 '20 at 15:26

The sentence is not at all clear, but having looked at the context, that definitely refers to target. It would have been much clearer written like this:

A target that is created in the same directory and specifies any output of the custom command as a source file ...


My deduction is that the target is a file, so the "that" you have indicated refers to that target.

In that case, the sentence could be improved by setting off the clause this way: "A target, created in the same directory, that specifies any output...". It is still a poor explanation, but at least would clear up the antecedent of 'that'.

I'm going to make a guess or two as to what this is referring to: it sounds like an instruction from an "integrated development environment" (IDE) for a programmer, and the target is a file generated by the "custom command" referred to. Some IDEs allow a user to create a custom command that will generate one or more files, and those files are then used as input to other commands (whether custom or not).

For example, you could have a file that describes a data structure (in JSON, say), and you could create a program that would convert that JSON into a Java class that was a 'bean' for that JSON structure. You could then create a 'custom command' that ran your program, which would use the JSON file to create a Java source file. The IDE's normal Java compilation step could then use the Java source file to generate one or more Java class files, which could then be part of your java program.

If all this guessing is correct, the 'target' referred to would, in this case, be the 'target' referred to in your sentence, and the 'rule' would be one that caused the IDE to compile Java files when indicated.

I think it could be better explained, again assuming all my guessing is correct:

A target that specifies any output of the custom command as a source file, where the target is in the same directory, is given a rule to generate the output using the custom command at build time.

It's also possible that 'target' is an artifact of creating the custom command, so that instead of being the file itself, it only specifies the file. It's hard to tell without more information about the situation.

I hope 'same directory' is clear from context, because there is no clue here as to what directory they mean.

  • I was mostly confused with grammar. According to the context, 'that' is 'a target'. That's what confused me. so, from grammar opinion, 'that' can be referred to as 'a target' or 'directory', right? if it is true. I've understood the sentence.
    – EastWhite
    Aug 24 '20 at 3:42
  • The 'that' that you've bolded could, grammatically, refer to either the 'target' or the 'directory'; without any context, I would tend to think it referred to the 'target'.
    – rcook
    Aug 24 '20 at 12:06
  • On what evidence do you base your deduction?
    – JavaLatte
    Aug 24 '20 at 13:10
  • Because "created in the same directory" looks to me like a clause inserted into other information, and 'that' comes after it. Because we don't normally think of a directory as being capable of "specifying any output", and certainly not "as a source file".
    – rcook
    Aug 24 '20 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .