X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Ffilepath.c;h=aa7d547e275f50f441e2020ff40acbe5f088a3af;hb=35e1184901ca38bdb2e56d154ed3b71f6096eacc;hp=7cbc24ac1c6ae7d39214faaca0ffea3d59d43a5e;hpb=cb688729aff5f1b77b7c4d60f6f69cd728f8dc06;p=cc65 diff --git a/src/ld65/filepath.c b/src/ld65/filepath.c index 7cbc24ac1..aa7d547e2 100644 --- a/src/ld65/filepath.c +++ b/src/ld65/filepath.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2003-2009, Ullrich von Bassewitz */ +/* (C) 2003-2010, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -33,14 +33,23 @@ -/* common */ -#include "searchpath.h" - /* ld65 */ #include "filepath.h" +/*****************************************************************************/ +/* Data */ +/*****************************************************************************/ + + + +SearchPath* LibSearchPath; /* Library path */ +SearchPath* ObjSearchPath; /* Object file path */ +SearchPath* CfgSearchPath; /* Config file path */ + + + /*****************************************************************************/ /* Code */ /*****************************************************************************/ @@ -50,29 +59,36 @@ void InitSearchPaths (void) /* Initialize the path search list */ { + /* Create the search path lists */ + LibSearchPath = NewSearchPath (); + ObjSearchPath = NewSearchPath (); + CfgSearchPath = NewSearchPath (); + /* Always search all stuff in the current directory */ - AddSearchPath ("", SEARCH_LIB | SEARCH_OBJ | SEARCH_CFG); + AddSearchPath (LibSearchPath, ""); + AddSearchPath (ObjSearchPath, ""); + AddSearchPath (CfgSearchPath, ""); /* Add some compiled in search paths if defined at compile time */ #if defined(LD65_LIB) - AddSearchPath (LD65_LIB, SEARCH_LIB); + AddSearchPath (LibSearchPath, LD65_LIB); #endif #if defined(LD65_OBJ) - AddSearchPath (LD65_OBJ, SEARCH_OBJ); + AddSearchPath (ObjSearchPath, LD65_OBJ); #endif #if defined(LD65_CFG) - AddSearchPath (LD65_CFG, SEARCH_CFG); + AddSearchPath (CfgSearchPath, LD65_CFG); #endif /* Add specific paths from the environment */ - AddSearchPathFromEnv ("LD65_CFG", SEARCH_CFG); - AddSearchPathFromEnv ("LD65_LIB", SEARCH_LIB); - AddSearchPathFromEnv ("LD65_OBJ", SEARCH_OBJ); + AddSearchPathFromEnv (LibSearchPath, "LD65_LIB"); + AddSearchPathFromEnv (ObjSearchPath, "LD65_OBJ"); + AddSearchPathFromEnv (CfgSearchPath, "LD65_CFG"); /* Add paths relative to a main directory defined in an env var */ - AddSubSearchPathFromEnv ("CC65_HOME", "cfg", SEARCH_CFG); - AddSubSearchPathFromEnv ("CC65_HOME", "lib", SEARCH_LIB); - AddSubSearchPathFromEnv ("CC65_HOME", "obj", SEARCH_OBJ); + AddSubSearchPathFromEnv (LibSearchPath, "CC65_HOME", "lib"); + AddSubSearchPathFromEnv (ObjSearchPath, "CC65_HOME", "obj"); + AddSubSearchPathFromEnv (CfgSearchPath, "CC65_HOME", "cfg"); }