Home | History | Annotate | Download | only in make

Lines Matching refs: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 {
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;
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)
252 /* Change the value of a Suffix variable, adjusting the reference counts. */
254 Suffix_Reassign(Suffix **var, Suffix *suff)
262 /* Set a Suffix variable to NULL, adjusting the reference count. */
264 Suffix_Unassign(Suffix **var)
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)
319 Suffix_IsSuffix(const Suffix *suff, size_t nameLen, const char *nameEnd)
324 static Suffix *
330 Suffix *suff = ln->datum;
338 static Suffix *
358 SuffixList_Unref(SuffixList *list, Suffix *suff)
368 Suffix_Free(Suffix *suff)
380 Punt("Internal error deleting suffix `%s' with refcount = %d",
392 /* Remove the suffix from the list, and free if it is otherwise unused. */
394 SuffixList_Remove(SuffixList *list, Suffix *suff)
400 DEBUG1(SUFF, "Removing suffix \"%s\"\n", suff->name);
406 * Insert the suffix into the list, keeping the list ordered by suffix
410 SuffixList_Insert(SuffixList *list, Suffix *suff)
413 Suffix *listSuff = NULL;
436 Relate(Suffix *srcSuff, Suffix *targSuff)
442 static Suffix *
445 Suffix *suff = bmake_malloc(sizeof *suff);
490 * suffixes, try a single-suffix transformation as well.
495 ParseTransform(const char *str, Suffix **out_src, Suffix **out_targ)
498 Suffix *single = NULL;
501 * Loop looking first for a suffix that matches the start of the
507 Suffix *src = ln->datum;
515 Suffix *targ = FindSuffixByName(str + src->nameLen);
526 * There was a suffix that encompassed the entire string, so we
527 * assume it was a transformation to the null suffix (thank you
528 * POSIX; search for "single suffix" or "single-suffix").
544 * concatenation of two known suffixes such as ".c.o" or a single suffix
550 Suffix *src, *targ;
570 Suffix *srcSuff;
571 Suffix *targSuff;
626 Suffix *srcSuff, *targSuff;
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)
681 * See if it is a transformation from this suffix to another suffix.
685 Suffix *to = FindSuffixByName(toName);
693 * See if it is a transformation from another suffix to this suffix.
697 Suffix *from = FindSuffixByNameLen(name,
716 UpdateTarget(GNode *target, Suffix *suff, bool *inout_removedMain)
718 Suffix *srcSuff, *targSuff;
743 * a new suffix, it seems wrong that this transformation would be
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)
803 /* Add the suffix to the end of the list of known suffixes. */
809 Suffix *suff = FindSuffixByName(name);
815 DEBUG1(SUFF, "Adding suffix \"%s\"\n", suff->name);
820 * Look for any existing transformations from or to this suffix.
827 /* Return the search path for the given suffix, or NULL. */
831 Suffix *suff = FindSuffixByName(name);
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;
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);
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);
963 Candidate_New(char *name, char *prefix, Suffix *suff, Candidate *parent,
984 Suffix *suff, const char *debug_tag MAKE_ATTR_UNUSED)
1000 * Add all candidates to the list that can be formed by applying a suffix to
1008 Suffix *suff = ln->datum;
1012 * If the suffix has been marked as the NULL suffix,
1013 * also create a candidate for a file with no suffix
1144 Suffix *suff; /* Suffix of the matching candidate */
1170 * The node matches the prefix, see if it has a known suffix.
1177 * It even has a known suffix, see if there's a transformation
1178 * defined between the node's suffix and the target's suffix.
1404 * If the node has a known suffix, use that path,
1410 Suffix *suff = gn->suffix;
1424 * XXX: Here we can save the suffix so we don't have to do
1430 DEBUG1(SUFF, "suffix is \"%s\"...\n", suff->name);
1450 ApplyTransform(GNode *tgn, GNode *sgn, Suffix *tsuff, Suffix *ssuff)
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)
1509 /* Use first matching suffix... */
1515 Suffix *suff = ln->datum;
1537 Suffix *memSuff;
1542 * suffix for both of them.
1554 *eoname = '\0'; /* Nuke parentheses during suffix search */
1555 *eoarch = '\0'; /* So a suffix can be found */
1562 * variables to locate its suffix. This allows us to figure out the
1563 * suffix to use for the archive without having to do a quadratic
1564 * search over the suffix list, backtracking for each one.
1578 memSuff = mem->suffix;
1580 DEBUG0(SUFF, "using null suffix\n");
1626 * search path, assuming all libraries end in ".a" (if the suffix
1634 Suffix *suff = FindSuffixByName(LIBSUFF);
1636 Suffix_Reassign(&gn->suffix, suff);
1639 Suffix_Unassign(&gn->suffix);
1660 Suffix *suff = ln->datum;
1684 DEBUG1(SUFF, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name);
1690 * Only use the default suffix rules if we don't have commands
1692 * define suffix rules if the gnode had children but we don't do
1701 DEBUG0(SUFF, "adding suffix rules\n");
1728 * Suffix known for the thing -- trim the suffix off
1734 Suffix_Reassign(&gn->suffix, targ->suff);
1745 * known suffix.
1747 Suffix_Unassign(&gn->suffix);
1788 * the proper suffix for the target is (in case there are two
1789 * suffixes one of which is a suffix of the other) and we can't know
1808 /* Handle target of unknown suffix... */
1813 * suffix(es), try and find an existing file/target that
1820 * No known transformations -- use the first suffix
1829 * Work up the transformation path to find the suffix
1854 DEBUG1(SUFF, "\tNo valid suffix on %s\n", gn->name);
1862 * If the suffix indicates that the target is a library, mark that in
1899 * transformation rule used to get from the src suffix to the targ
1900 * suffix. Note that this causes the commands list of the original
1910 Suffix_Reassign(&src->node->suffix, src->suff);
1933 Suffix_Reassign(&gn->suffix, src->suff);
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);
2020 "Desired null suffix %s not defined",
2037 * Create null suffix for single-suffix rules (POSIX). The thing
2038 * doesn't actually go on the suffix list or everyone will think
2039 * that's its suffix.
2071 const Suffix *suff = ln->datum;
2078 Suffix_Print(const Suffix *suff)
2136 Suffix *suff;