2000-06-14 08:18:19 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* */
|
2013-05-09 11:56:54 +00:00
|
|
|
/* incpath.c */
|
2000-06-14 08:18:19 +00:00
|
|
|
/* */
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Include path handling for cc65 */
|
2000-06-14 08:18:19 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
2013-05-04 03:25:06 +00:00
|
|
|
/* (C) 2000-2013, Ullrich von Bassewitz */
|
2009-09-22 11:49:53 +00:00
|
|
|
/* Roemerstrasse 52 */
|
|
|
|
/* D-70794 Filderstadt */
|
|
|
|
/* EMail: uz@cc65.org */
|
2000-06-14 08:18:19 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
/* */
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
/* */
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
/* distribution. */
|
|
|
|
/* */
|
|
|
|
/*****************************************************************************/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-10-10 20:40:36 +00:00
|
|
|
/* cc65 */
|
2000-06-14 08:18:19 +00:00
|
|
|
#include "incpath.h"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Data */
|
2000-05-28 13:40:48 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-03 21:12:14 +00:00
|
|
|
SearchPaths* SysIncSearchPath; /* System include path */
|
|
|
|
SearchPaths* UsrIncSearchPath; /* User include path */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-09 10:54:15 +00:00
|
|
|
/*****************************************************************************/
|
2013-05-09 11:56:54 +00:00
|
|
|
/* Code */
|
2010-05-09 10:54:15 +00:00
|
|
|
/*****************************************************************************/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2003-05-27 21:48:05 +00:00
|
|
|
void InitIncludePaths (void)
|
|
|
|
/* Initialize the include path search list */
|
|
|
|
{
|
2010-05-09 10:54:15 +00:00
|
|
|
/* Create the search path lists */
|
|
|
|
SysIncSearchPath = NewSearchPath ();
|
|
|
|
UsrIncSearchPath = NewSearchPath ();
|
2013-05-04 03:25:06 +00:00
|
|
|
}
|
|
|
|
|
2010-05-09 10:54:15 +00:00
|
|
|
|
2009-09-22 11:49:53 +00:00
|
|
|
|
2013-05-04 03:25:06 +00:00
|
|
|
void FinishIncludePaths (void)
|
|
|
|
/* Finish creating the include path search lists. */
|
|
|
|
{
|
2009-09-22 11:49:53 +00:00
|
|
|
/* Add specific paths from the environment */
|
2010-05-09 10:54:15 +00:00
|
|
|
AddSearchPathFromEnv (SysIncSearchPath, "CC65_INC");
|
|
|
|
AddSearchPathFromEnv (UsrIncSearchPath, "CC65_INC");
|
2009-09-22 11:49:53 +00:00
|
|
|
|
2013-05-04 03:25:06 +00:00
|
|
|
/* Add paths relative to a main directory defined in an env. var. */
|
2010-05-09 10:54:15 +00:00
|
|
|
AddSubSearchPathFromEnv (SysIncSearchPath, "CC65_HOME", "include");
|
2013-05-04 03:25:06 +00:00
|
|
|
|
|
|
|
/* Add some compiled-in search paths if defined at compile time. */
|
2014-03-03 21:12:14 +00:00
|
|
|
#if defined(CC65_INC) && !defined(_WIN32)
|
2022-04-25 16:52:46 +00:00
|
|
|
AddSearchPath (SysIncSearchPath, CC65_INC);
|
2013-05-04 03:25:06 +00:00
|
|
|
#endif
|
2013-05-06 21:20:56 +00:00
|
|
|
|
|
|
|
/* Add paths relative to the parent directory of the Windows binary. */
|
2022-04-27 21:11:01 +00:00
|
|
|
AddSubSearchPathFromBin (SysIncSearchPath, "include");
|
2003-05-27 21:48:05 +00:00
|
|
|
}
|