parse.c (160574) | parse.c (167330) |
---|---|
1/*- 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1989 by Berkeley Softworks 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. --- 25 unchanged lines hidden (view full) --- 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)parse.c 8.3 (Berkeley) 3/19/94 39 */ 40 41#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1989 by Berkeley Softworks 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Adam de Boor. --- 25 unchanged lines hidden (view full) --- 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)parse.c 8.3 (Berkeley) 3/19/94 39 */ 40 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/usr.bin/make/parse.c 160574 2006-07-22 14:00:31Z obrien $"); | 42__FBSDID("$FreeBSD: head/usr.bin/make/parse.c 167330 2007-03-08 09:16:11Z fjoe $"); |
43 44/*- 45 * parse.c -- 46 * Functions to parse a makefile. 47 * 48 * Most important structures are kept in Lsts. Directories for 49 * the #include "..." function are kept in the 'parseIncPath' Lst, while 50 * those for the #include <...> are kept in the 'sysIncPath' Lst. The --- 1014 unchanged lines hidden (view full) --- 1065 case Silent: 1066 beSilent = TRUE; 1067 break; 1068 case ExPath: 1069 LST_FOREACH(ln, &paths) 1070 Path_Clear(Lst_Datum(ln)); 1071 break; 1072 case Posix: | 43 44/*- 45 * parse.c -- 46 * Functions to parse a makefile. 47 * 48 * Most important structures are kept in Lsts. Directories for 49 * the #include "..." function are kept in the 'parseIncPath' Lst, while 50 * those for the #include <...> are kept in the 'sysIncPath' Lst. The --- 1014 unchanged lines hidden (view full) --- 1065 case Silent: 1066 beSilent = TRUE; 1067 break; 1068 case ExPath: 1069 LST_FOREACH(ln, &paths) 1070 Path_Clear(Lst_Datum(ln)); 1071 break; 1072 case Posix: |
1073 is_posix = TRUE; |
|
1073 Var_Set("%POSIX", "1003.2", VAR_GLOBAL); 1074 break; 1075 default: 1076 break; 1077 } 1078 1079 } else if (specType == MFlags) { 1080 /* --- 973 unchanged lines hidden (view full) --- 2054 Suff_EndTransform(Lst_Datum(ln)); 2055 } 2056 Lst_Destroy(&targets, ParseHasCommands); 2057 inLine = FALSE; 2058 } 2059} 2060 2061/** | 1074 Var_Set("%POSIX", "1003.2", VAR_GLOBAL); 1075 break; 1076 default: 1077 break; 1078 } 1079 1080 } else if (specType == MFlags) { 1081 /* --- 973 unchanged lines hidden (view full) --- 2055 Suff_EndTransform(Lst_Datum(ln)); 2056 } 2057 Lst_Destroy(&targets, ParseHasCommands); 2058 inLine = FALSE; 2059 } 2060} 2061 2062/** |
2062 * parse_include | 2063 * xparse_include |
2063 * Parse an .include directive and push the file onto the input stack. 2064 * The input is the line minus the .include. A file spec is a string 2065 * enclosed in <> or "". The former is looked for only in sysIncPath. 2066 * The latter in . and the directories specified by -I command line 2067 * options 2068 */ 2069static void 2070xparse_include(char *file, int sinclude) --- 108 unchanged lines hidden (view full) --- 2179 */ 2180 fullname = Path_FindFile(file, &sysIncPath); 2181 } 2182 2183 if (fullname == NULL) { 2184 *cp = endc; 2185 if (!sinclude) 2186 Parse_Error(PARSE_FATAL, "Could not find %s", file); | 2064 * Parse an .include directive and push the file onto the input stack. 2065 * The input is the line minus the .include. A file spec is a string 2066 * enclosed in <> or "". The former is looked for only in sysIncPath. 2067 * The latter in . and the directories specified by -I command line 2068 * options 2069 */ 2070static void 2071xparse_include(char *file, int sinclude) --- 108 unchanged lines hidden (view full) --- 2180 */ 2181 fullname = Path_FindFile(file, &sysIncPath); 2182 } 2183 2184 if (fullname == NULL) { 2185 *cp = endc; 2186 if (!sinclude) 2187 Parse_Error(PARSE_FATAL, "Could not find %s", file); |
2188 else 2189 Main_AddSourceMakefile(file); |
|
2187 free(file); 2188 return; 2189 } | 2190 free(file); 2191 return; 2192 } |
2193 Main_AddSourceMakefile(fullname); |
|
2190 free(file); 2191 2192 /* 2193 * We set up the name of the file to be the absolute 2194 * name of the include file so error messages refer to the right 2195 * place. 2196 */ 2197 ParsePushInput(fullname, NULL, NULL, 0); --- 333 unchanged lines hidden --- | 2194 free(file); 2195 2196 /* 2197 * We set up the name of the file to be the absolute 2198 * name of the include file so error messages refer to the right 2199 * place. 2200 */ 2201 ParsePushInput(fullname, NULL, NULL, 0); --- 333 unchanged lines hidden --- |