Added search paths similar to that of the linker and compiler.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4217 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2009-09-24 14:49:52 +00:00
parent 6aee0eff04
commit 6da6da78ae
5 changed files with 57 additions and 10 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 2000-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 2000-2009, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -76,3 +76,23 @@ char* FindInclude (const char* Name)
void InitIncludePaths (void)
/* Initialize the include path search list */
{
/* Add some standard paths to the include search path */
AddSearchPath ("", INC_STD); /* Current directory */
/* Add some compiled in search paths if defined at compile time */
#ifdef CA65_INC
AddSearchPath (CA65_INC, INC_STD);
#endif
/* Add specific paths from the environment */
AddSearchPathFromEnv ("CA65_INC", INC_STD);
/* Add paths relative to a main directory defined in an env var */
AddSubSearchPathFromEnv ("CC65_HOME", "asminc", INC_STD);
}

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 2000-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 2000-2009, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -52,6 +52,9 @@ char* FindInclude (const char* Name);
* the complete path, if found, return 0 otherwise.
*/
void InitIncludePaths (void);
/* Initialize the include path search list */
/* End of incpath.h */

View File

@@ -796,6 +796,9 @@ int main (int argc, char* argv [])
/* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "ca65");
/* Initialize the include search paths */
InitIncludePaths ();
/* Enter the base lexical level. We must do that here, since we may
* define symbols using -D.
*/

View File

@@ -10,7 +10,12 @@ EXE = ca65
# Library dir
COMMON = ../common
CFLAGS = -g -O2 -Wall -W -std=c89 -I$(COMMON)
# Several search paths. You may redefine these on the command line
CA65_INC = \"/usr/lib/cc65/asminc/\"
CFLAGS = -g -O2 -Wall -W -std=c89
CFLAGS += -I$(COMMON)
CFLAGS += -DCA65_INC=$(CA65_INC)
CC = gcc
EBIND = emxbind
LDFLAGS =