Lines Matching full:suffix

72  * Maintain suffix lists and find implicit dependents using suffix
81 * Extend the search path of each suffix to include the
90 * Suff_AddSuffix Add the passed string as another known suffix.
92 * Suff_GetPath Return the search path for the given suffix.
95 * Mark the given suffix as denoting an include file.
97 * Suff_AddLib Mark the given suffix as denoting a library.
100 * Add another transformation to the suffix graph.
102 * Suff_SetNull Define the suffix to consider the suffix of
106 * a target based on its suffix. Returns the
140 * Counter for assigning suffix numbers.
141 * TODO: What are these suffix numbers used for?
146 * A suffix such as ".c" or ".o" that may be used in suffix transformation
149 typedef struct Suffix { struct
150 /* The suffix itself, such as ".c" */
155 * This suffix marks include files. Their search path ends up in the
160 * This suffix marks library files. Their search path ends up in the
165 * The empty suffix.
167 * XXX: What is the difference between the empty suffix and the null
168 * suffix?
174 /* The path along which files of this suffix may be found */
177 /* The suffix number; TODO: document the purpose of this number */
186 } Suffix; argument
205 /* The suffix on the file. */
206 Suffix *suff;
239 /* The NULL suffix is used when a file has no known suffix */
240 static Suffix *nullSuff;
241 /* The empty suffix required for POSIX single-suffix transformation rules */
242 static Suffix *emptySuff;
245 static Suffix *
246 Suffix_Ref(Suffix *suff) in Suffix_Ref()
252 /* Change the value of a Suffix variable, adjusting the reference counts. */
254 Suffix_Reassign(Suffix **var, Suffix *suff) in Suffix_Reassign()
262 /* Set a Suffix variable to NULL, adjusting the reference count. */
264 Suffix_Unassign(Suffix **var) in Suffix_Unassign()
287 * See if suff is a suffix of str, and if so, return the pointer to the suffix
308 * See if suff is a suffix of name, and if so, return the end of the prefix
312 Suffix_TrimSuffix(const Suffix *suff, size_t nameLen, const char *nameEnd) in Suffix_TrimSuffix()
319 Suffix_IsSuffix(const Suffix *suff, size_t nameLen, const char *nameEnd) in Suffix_IsSuffix()
324 static Suffix *
330 Suffix *suff = ln->datum; in FindSuffixByNameLen()
338 static Suffix *
358 SuffixList_Unref(SuffixList *list, Suffix *suff) in SuffixList_Unref()
368 Suffix_Free(Suffix *suff) in Suffix_Free()
380 Punt("Internal error deleting suffix `%s' with refcount = %d", in Suffix_Free()
392 /* Remove the suffix from the list, and free if it is otherwise unused. */
394 SuffixList_Remove(SuffixList *list, Suffix *suff) in SuffixList_Remove()
400 DEBUG1(SUFF, "Removing suffix \"%s\"\n", suff->name); in SuffixList_Remove()
406 * Insert the suffix into the list, keeping the list ordered by suffix
410 SuffixList_Insert(SuffixList *list, Suffix *suff) in SuffixList_Insert()
413 Suffix *listSuff = NULL; in SuffixList_Insert()
436 Relate(Suffix *srcSuff, Suffix *targSuff) in Relate()
442 static Suffix *
445 Suffix *suff = bmake_malloc(sizeof *suff); in Suffix_New()
490 * suffixes, try a single-suffix transformation as well.
495 ParseTransform(const char *str, Suffix **out_src, Suffix **out_targ) in ParseTransform()
498 Suffix *single = NULL; in ParseTransform()
501 * Loop looking first for a suffix that matches the start of the in ParseTransform()
507 Suffix *src = ln->datum; in ParseTransform()
515 Suffix *targ = FindSuffixByName(str + src->nameLen); in ParseTransform()
526 * There was a suffix that encompassed the entire string, so we in ParseTransform()
527 * assume it was a transformation to the null suffix (thank you in ParseTransform()
528 * POSIX; search for "single suffix" or "single-suffix"). in ParseTransform()
544 * concatenation of two known suffixes such as ".c.o" or a single suffix
550 Suffix *src, *targ; in Suff_IsTransform()
570 Suffix *srcSuff; in Suff_AddTransform()
571 Suffix *targSuff; in Suff_AddTransform()
626 Suffix *srcSuff, *targSuff; in Suff_EndTransform()
663 * transformation involving this suffix and another, existing suffix, the
666 * The appropriate links will be made between this suffix and others if
671 * suff Suffix to rebuild
674 RebuildGraph(GNode *transform, Suffix *suff) in RebuildGraph()
681 * See if it is a transformation from this suffix to another suffix. in RebuildGraph()
685 Suffix *to = FindSuffixByName(toName); in RebuildGraph()
693 * See if it is a transformation from another suffix to this suffix. in RebuildGraph()
697 Suffix *from = FindSuffixByNameLen(name, in RebuildGraph()
716 UpdateTarget(GNode *target, Suffix *suff, bool *inout_removedMain) in UpdateTarget()
718 Suffix *srcSuff, *targSuff; in UpdateTarget()
743 * a new suffix, it seems wrong that this transformation would be in UpdateTarget()
784 * Look at all existing targets to see if adding this suffix will make one
785 * of the current targets mutate into a suffix rule.
788 * suffix rules.
791 UpdateTargets(Suffix *suff) in UpdateTargets()
803 /* Add the suffix to the end of the list of known suffixes. */
809 Suffix *suff = FindSuffixByName(name); in Suff_AddSuffix()
815 DEBUG1(SUFF, "Adding suffix \"%s\"\n", suff->name); in Suff_AddSuffix()
820 * Look for any existing transformations from or to this suffix. in Suff_AddSuffix()
827 /* Return the search path for the given suffix, or NULL. */
831 Suffix *suff = FindSuffixByName(name); in Suff_GetPath()
840 * The search path of each suffix can be defined using the special target
841 * '.PATH<suffix>'.
843 * If paths were specified for the ".h" suffix, the directories are stuffed
845 * '-I'. The same is done for the ".a" suffix, except the variable is called
857 Suffix *suff = ln->datum; in Suff_ExtendPaths()
884 * Add the given suffix as a type of file which gets included.
886 * To have an effect, the suffix must already exist.
892 Suffix *suff = FindSuffixByName(suffName); in Suff_AddInclude()
898 * Add the given suffix as a type of file which is a library.
900 * To have an effect, the suffix must already exist.
906 Suffix *suff = FindSuffixByName(suffName); in Suff_AddLib()
963 Candidate_New(char *name, char *prefix, Suffix *suff, Candidate *parent, in Candidate_New()
984 Suffix *suff, const char *debug_tag MAKE_ATTR_UNUSED) in CandidateList_Add()
1000 * Add all candidates to the list that can be formed by applying a suffix to
1008 Suffix *suff = ln->datum; in CandidateList_AddCandidatesFor()
1012 * If the suffix has been marked as the NULL suffix, in CandidateList_AddCandidatesFor()
1013 * also create a candidate for a file with no suffix in CandidateList_AddCandidatesFor()
1144 Suffix *suff; /* Suffix of the matching candidate */ in FindCmds()
1170 * The node matches the prefix, see if it has a known suffix. in FindCmds()
1177 * It even has a known suffix, see if there's a transformation in FindCmds()
1178 * defined between the node's suffix and the target's suffix. in FindCmds()
1404 * If the node has a known suffix, use that path,
1410 Suffix *suff = gn->suffix; in Suff_FindPath()
1424 * XXX: Here we can save the suffix so we don't have to do in Suff_FindPath()
1430 DEBUG1(SUFF, "suffix is \"%s\"...\n", suff->name); in Suff_FindPath()
1450 ApplyTransform(GNode *tgn, GNode *sgn, Suffix *tsuff, Suffix *ssuff) in ApplyTransform()
1497 * Member has a known suffix, so look for a transformation rule from
1498 * it to a possible suffix of the archive.
1501 * suffixes to which the member's suffix may be transformed.
1504 ExpandMember(GNode *gn, const char *eoarch, GNode *mem, Suffix *memSuff) in ExpandMember()
1509 /* Use first matching suffix... */ in ExpandMember()
1515 Suffix *suff = ln->datum; in ExpandMember()
1537 Suffix *memSuff; in FindDepsArchive()
1542 * suffix for both of them. in FindDepsArchive()
1554 *eoname = '\0'; /* Nuke parentheses during suffix search */ in FindDepsArchive()
1555 *eoarch = '\0'; /* So a suffix can be found */ in FindDepsArchive()
1562 * variables to locate its suffix. This allows us to figure out the in FindDepsArchive()
1563 * suffix to use for the archive without having to do a quadratic in FindDepsArchive()
1564 * search over the suffix list, backtracking for each one. in FindDepsArchive()
1578 memSuff = mem->suffix; in FindDepsArchive()
1580 DEBUG0(SUFF, "using null suffix\n"); in FindDepsArchive()
1626 * search path, assuming all libraries end in ".a" (if the suffix
1634 Suffix *suff = FindSuffixByName(LIBSUFF); in FindDepsLib()
1636 Suffix_Reassign(&gn->suffix, suff); in FindDepsLib()
1639 Suffix_Unassign(&gn->suffix); in FindDepsLib()
1660 Suffix *suff = ln->datum; in FindDepsRegularKnown()
1684 DEBUG1(SUFF, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); in FindDepsRegularUnknown()
1690 * Only use the default suffix rules if we don't have commands in FindDepsRegularUnknown()
1692 * define suffix rules if the gnode had children but we don't do in FindDepsRegularUnknown()
1701 DEBUG0(SUFF, "adding suffix rules\n"); in FindDepsRegularUnknown()
1728 * Suffix known for the thing -- trim the suffix off in FindDepsRegularPath()
1734 Suffix_Reassign(&gn->suffix, targ->suff); in FindDepsRegularPath()
1745 * known suffix. in FindDepsRegularPath()
1747 Suffix_Unassign(&gn->suffix); in FindDepsRegularPath()
1788 * the proper suffix for the target is (in case there are two in FindDepsRegular()
1789 * suffixes one of which is a suffix of the other) and we can't know in FindDepsRegular()
1808 /* Handle target of unknown suffix... */ in FindDepsRegular()
1813 * suffix(es), try and find an existing file/target that in FindDepsRegular()
1820 * No known transformations -- use the first suffix in FindDepsRegular()
1829 * Work up the transformation path to find the suffix in FindDepsRegular()
1854 DEBUG1(SUFF, "\tNo valid suffix on %s\n", gn->name); in FindDepsRegular()
1862 * If the suffix indicates that the target is a library, mark that in in FindDepsRegular()
1899 * transformation rule used to get from the src suffix to the targ in FindDepsRegular()
1900 * suffix. Note that this causes the commands list of the original in FindDepsRegular()
1910 Suffix_Reassign(&src->node->suffix, src->suff); in FindDepsRegular()
1933 Suffix_Reassign(&gn->suffix, src->suff); in FindDepsRegular()
1968 * The search continues on all paths from the root suffix until a file is
2009 * Define which suffix is the null suffix.
2011 * Need to handle the changing of the null suffix gracefully so the old
2017 Suffix *suff = FindSuffixByName(name); in Suff_SetNull()
2020 "Desired null suffix %s not defined", in Suff_SetNull()
2037 * Create null suffix for single-suffix rules (POSIX). The thing in Suff_Init()
2038 * doesn't actually go on the suffix list or everyone will think in Suff_Init()
2039 * that's its suffix. in Suff_Init()
2071 const Suffix *suff = ln->datum; in PrintSuffNames()
2078 Suffix_Print(const Suffix *suff) in Suffix_Print()
2136 Suffix *suff; in Suff_NamesStr()