parse.h revision 146177
1139825Simp/*-
280708Sjake * Copyright (c) 1988, 1989, 1990, 1993
380708Sjake *	The Regents of the University of California.  All rights reserved.
480708Sjake * Copyright (c) 1989 by Berkeley Softworks
580708Sjake * All rights reserved.
680708Sjake *
780708Sjake * This code is derived from software contributed to Berkeley by
880708Sjake * Adam de Boor.
980708Sjake *
1080708Sjake * Redistribution and use in source and binary forms, with or without
1180708Sjake * modification, are permitted provided that the following conditions
1280708Sjake * are met:
1380708Sjake * 1. Redistributions of source code must retain the above copyright
1480708Sjake *    notice, this list of conditions and the following disclaimer.
1580708Sjake * 2. Redistributions in binary form must reproduce the above copyright
1680708Sjake *    notice, this list of conditions and the following disclaimer in the
1780708Sjake *    documentation and/or other materials provided with the distribution.
1880708Sjake * 3. All advertising materials mentioning features or use of this software
1980708Sjake *    must display the following acknowledgement:
2080708Sjake *	This product includes software developed by the University of
2180708Sjake *	California, Berkeley and its contributors.
2280708Sjake * 4. Neither the name of the University nor the names of its contributors
2380708Sjake *    may be used to endorse or promote products derived from this software
2480708Sjake *    without specific prior written permission.
2580708Sjake *
2680708Sjake * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2780708Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2880708Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2980708Sjake * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30115164Skan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3180708Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3280708Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33143140Sjoerg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34143140Sjoerg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35143140Sjoerg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36114216Skan * SUCH DAMAGE.
37114216Skan *
3880708Sjake * $FreeBSD: head/usr.bin/make/parse.h 146177 2005-05-13 08:53:00Z harti $
39114216Skan */
4080708Sjake
4180708Sjake#ifndef parse_h_470eeb9a
42#define	parse_h_470eeb9a
43
44#include <stdio.h>
45
46#include "util.h"
47
48struct GNode;
49struct Lst;
50
51/*
52 * Error levels for parsing. PARSE_FATAL means the process cannot continue
53 * once the makefile has been parsed. PARSE_WARNING means it can. Passed
54 * as the first argument to Parse_Error.
55 */
56#define	PARSE_WARNING	2
57#define	PARSE_FATAL	1
58
59/*
60 * Definitions for the "local" variables. Used only for clarity.
61 */
62#define	TARGET		"@"	/* Target of dependency */
63#define	OODATE		"?"	/* All out-of-date sources */
64#define	ALLSRC		">"	/* All sources */
65#define	IMPSRC		"<"	/* Source implied by transformation */
66#define	PREFIX		"*"	/* Common prefix */
67#define	ARCHIVE		"!"	/* Archive in "archive(member)" syntax */
68#define	MEMBER		"%"	/* Member in "archive(member)" syntax */
69
70#define	FTARGET		"@F"	/* file part of TARGET */
71#define	DTARGET		"@D"	/* directory part of TARGET */
72#define	FIMPSRC		"<F"	/* file part of IMPSRC */
73#define	DIMPSRC		"<D"	/* directory part of IMPSRC */
74#define	FPREFIX		"*F"	/* file part of PREFIX */
75#define	DPREFIX		"*D"	/* directory part of PREFIX */
76
77void Parse_Error(int, const char *, ...);
78Boolean Parse_AnyExport(void);
79Boolean Parse_IsVar(char *);
80void Parse_DoVar(char *, struct GNode *);
81void Parse_AddIncludeDir(char *);
82void Parse_File(const char *, FILE *);
83void Parse_FromString(char *, int);
84void Parse_MainName(struct Lst *);
85
86#endif /* parse_h_470eeb9a */
87