suff.c (296637) | suff.c (297040) |
---|---|
1/* $NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $ */ | 1/* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */ |
2 3/* 4 * Copyright (c) 1988, 1989, 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. 9 * --- 54 unchanged lines hidden (view full) --- 64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 68 * SUCH DAMAGE. 69 */ 70 71#ifndef MAKE_NATIVE | 2 3/* 4 * Copyright (c) 1988, 1989, 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. 9 * --- 54 unchanged lines hidden (view full) --- 64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 68 * SUCH DAMAGE. 69 */ 70 71#ifndef MAKE_NATIVE |
72static char rcsid[] = "$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"; | 72static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"; |
73#else 74#include <sys/cdefs.h> 75#ifndef lint 76#if 0 77static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; 78#else | 73#else 74#include <sys/cdefs.h> 75#ifndef lint 76#if 0 77static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; 78#else |
79__RCSID("$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"); | 79__RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"); |
80#endif 81#endif /* not lint */ 82#endif 83 84/*- 85 * suff.c -- 86 * Functions to maintain suffix lists and find implicit dependents 87 * using suffix transformation rules --- 1801 unchanged lines hidden (view full) --- 1889 char *eoarch; /* End of archive portion */ 1890 char *eoname; /* End of member portion */ 1891 GNode *mem; /* Node for member */ 1892 static const char *copy[] = { 1893 /* Variables to be copied from the member node */ 1894 TARGET, /* Must be first */ 1895 PREFIX, /* Must be second */ 1896 }; | 80#endif 81#endif /* not lint */ 82#endif 83 84/*- 85 * suff.c -- 86 * Functions to maintain suffix lists and find implicit dependents 87 * using suffix transformation rules --- 1801 unchanged lines hidden (view full) --- 1889 char *eoarch; /* End of archive portion */ 1890 char *eoname; /* End of member portion */ 1891 GNode *mem; /* Node for member */ 1892 static const char *copy[] = { 1893 /* Variables to be copied from the member node */ 1894 TARGET, /* Must be first */ 1895 PREFIX, /* Must be second */ 1896 }; |
1897 LstNode ln, nln; /* Next suffix node to check */ |
|
1897 int i; /* Index into copy and vals */ 1898 Suff *ms; /* Suffix descriptor for member */ 1899 char *name; /* Start of member's name */ 1900 1901 /* 1902 * The node is an archive(member) pair. so we must find a 1903 * suffix for both of them. 1904 */ --- 45 unchanged lines hidden (view full) --- 1950 1951 1952 /* 1953 * Set the other two local variables required for this target. 1954 */ 1955 Var_Set(MEMBER, name, gn, 0); 1956 Var_Set(ARCHIVE, gn->name, gn, 0); 1957 | 1898 int i; /* Index into copy and vals */ 1899 Suff *ms; /* Suffix descriptor for member */ 1900 char *name; /* Start of member's name */ 1901 1902 /* 1903 * The node is an archive(member) pair. so we must find a 1904 * suffix for both of them. 1905 */ --- 45 unchanged lines hidden (view full) --- 1951 1952 1953 /* 1954 * Set the other two local variables required for this target. 1955 */ 1956 Var_Set(MEMBER, name, gn, 0); 1957 Var_Set(ARCHIVE, gn->name, gn, 0); 1958 |
1959 /* 1960 * Set $@ for compatibility with other makes 1961 */ 1962 Var_Set(TARGET, gn->name, gn, 0); 1963 1964 /* 1965 * Now we've got the important local variables set, expand any sources 1966 * that still contain variables or wildcards in their names. 1967 */ 1968 for (ln = Lst_First(gn->children); ln != NULL; ln = nln) { 1969 nln = Lst_Succ(ln); 1970 SuffExpandChildren(ln, gn); 1971 } 1972 |
|
1958 if (ms != NULL) { 1959 /* 1960 * Member has a known suffix, so look for a transformation rule from 1961 * it to a possible suffix of the archive. Rather than searching 1962 * through the entire list, we just look at suffixes to which the 1963 * member's suffix may be transformed... 1964 */ | 1973 if (ms != NULL) { 1974 /* 1975 * Member has a known suffix, so look for a transformation rule from 1976 * it to a possible suffix of the archive. Rather than searching 1977 * through the entire list, we just look at suffixes to which the 1978 * member's suffix may be transformed... 1979 */ |
1965 LstNode ln; | |
1966 SuffixCmpData sd; /* Search string data */ 1967 1968 /* 1969 * Use first matching suffix... 1970 */ 1971 sd.len = eoarch - gn->name; 1972 sd.ename = eoarch; 1973 ln = Lst_Find(ms->parents, &sd, SuffSuffIsSuffixP); --- 23 unchanged lines hidden (view full) --- 1997 * archive. 1998 */ 1999 if (OP_NOP(gn->type)) { 2000 gn->type |= OP_DEPENDS; 2001 } 2002 2003 /* 2004 * Flag the member as such so we remember to look in the archive for | 1980 SuffixCmpData sd; /* Search string data */ 1981 1982 /* 1983 * Use first matching suffix... 1984 */ 1985 sd.len = eoarch - gn->name; 1986 sd.ename = eoarch; 1987 ln = Lst_Find(ms->parents, &sd, SuffSuffIsSuffixP); --- 23 unchanged lines hidden (view full) --- 2011 * archive. 2012 */ 2013 if (OP_NOP(gn->type)) { 2014 gn->type |= OP_DEPENDS; 2015 } 2016 2017 /* 2018 * Flag the member as such so we remember to look in the archive for |
2005 * its modification time. | 2019 * its modification time. The OP_JOIN | OP_MADE is needed because this 2020 * target should never get made. |
2006 */ | 2021 */ |
2007 mem->type |= OP_MEMBER; | 2022 mem->type |= OP_MEMBER | OP_JOIN | OP_MADE; |
2008} 2009 2010/*- 2011 *----------------------------------------------------------------------- 2012 * SuffFindNormalDeps -- 2013 * Locate implicit dependencies for regular targets. 2014 * 2015 * Input: --- 637 unchanged lines hidden --- | 2023} 2024 2025/*- 2026 *----------------------------------------------------------------------- 2027 * SuffFindNormalDeps -- 2028 * Locate implicit dependencies for regular targets. 2029 * 2030 * Input: --- 637 unchanged lines hidden --- |