values, /* If a variable, the values */
action; /* If a target, the action number */
%type <same> target assignment actions action tokens token
makefile : lines END_OF_FILE;
target : tokens ':' tokens
$$ = add_depends($1, $3);
assignment : token '=' tokens
static int last_char, last_saved = 0;
static int column = 0, lineno = 1;
static string_t *strings = 0;
fprintf(stderr, "line %d, column %d: %s\n", lineno, column, s);
add_depends(list1, list2)
if (tokens->moretokens == 0) {
tokens->moretokens = token;
for (ptr = tokens; ptr->moretokens; ptr = ptr->moretokens) {
if ((ptr = (same_t *)malloc(sizeof *ptr)) == 0) {
fprintf(stderr, "No more space for tokens!\n");
i = (i<<3) + *string ^ ((i>>28)&0x7);
int length = strlen(string);
hashval = hashof(string, length);
for (ptr = strings; ptr; ptr = ptr->next) {
if ((ptr->hashval == hashval) && (ptr->length == length)) {
if (memcmp(string, ptr->string, length) == 0) {
if ((ptr = (string_t *)malloc(sizeof *ptr)) == 0) {
fprintf(stderr, "No space to add string *%s*!\n", string);
if ((ptr->string = malloc(length+1)) == 0) {
fprintf(stderr, "No space to add literal *%s*!\n", string);
memcpy(ptr->string, string, length+1);
#define ret_token(c) if (bufptr != buffer) { \
yylval.string = lookup(buffer); \
#define save(c) { last_char = c; last_saved = 1; }
#define Return(c) if (yydebug) { \
static char buffer[100], *bufptr = buffer;
static int eof_found = 0;
fprintf(stderr, "End of file ignored.\n");
while ((c = Getchar()) != EOF) {
while (((c = Getchar()) != EOF) && (c != '\n')) {
if (bufptr[-1] == '\\') {