2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
4 * This file is part of Jam - see jam.c for Copyright information.
8 * search.c - find a target along $(SEARCH) or $(LOCATE)
10 * 11/04/02 (seiwald) - const-ing for string literals
16 # include "timestamp.h"
18 # include "variable.h"
30 /* Parse the filename */
32 path_parse( target
, f
);
37 if ((varlist
= var_get("LOCATE")))
39 f
->f_root
.ptr
= varlist
->string
;
40 f
->f_root
.len
= strlen( varlist
->string
);
42 path_build( f
, buf
, 1 );
45 printf( "locate %s: %s\n", target
, buf
);
47 timestamp( buf
, time
);
51 else if ((varlist
= var_get("SEARCH")))
55 f
->f_root
.ptr
= varlist
->string
;
56 f
->f_root
.len
= strlen( varlist
->string
);
58 path_build( f
, buf
, 1 );
61 printf( "search %s: %s\n", target
, buf
);
63 timestamp( buf
, time
);
68 varlist
= list_next( varlist
);
72 /* Look for the obvious */
73 /* This is a questionable move. Should we look in the */
74 /* obvious place if SEARCH is set? */
79 path_build( f
, buf
, 1 );
82 printf( "search %s: %s\n", target
, buf
);
84 timestamp( buf
, time
);