Name a directory which is searched for include files. The option may be
used more than once to specify more than one directory to search. The
current directory is always searched first before considering any
- additional directories.
+ additional directories. See also the section about <ref id="search-paths"
+ name="search paths">.
<tag><tt>-U, --auto-import</tt></tag>
<p>
+
+<sect>Search paths<label id="search-paths"><p>
+
+Include files are searched in the following places:
+
+<enum>
+<item>The current directory.
+<item>The value of the environment variable <tt/CA65_INC/ if it is defined.
+<item>A subdirectory named <tt/asminc/ of the directory defined in the
+ environment variable <tt/CC65_HOME/, if it is defined.
+<item>Any directory added with the <tt/-I/ option on the command line.
+</enum>
+
+
+
<sect>Input format<p>
<sect1>Assembler syntax<p>
/* */
/* */
/* */
-/* (C) 2000-2003 Ullrich von Bassewitz */
-/* Rö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 */
+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);
+}
+
+
+
/* */
/* */
/* */
-/* (C) 2000-2003 Ullrich von Bassewitz */
-/* Rö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 */
* the complete path, if found, return 0 otherwise.
*/
+void InitIncludePaths (void);
+/* Initialize the include path search list */
+
/* End of incpath.h */
/* 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.
*/
# 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 =