From: Mike McCarty (jmccarty_at_ssd.usa.alcatel.com)
Date: 2002-01-08 01:41:11
Been on vacation, so sorry this is late. I thought this might help the OP. On Wed, 12 Dec 2001, Ullrich von Bassewitz wrote: > Hi! > > On Tue, Dec 11, 2001 at 08:40:01PM +0100, groepaz wrote: > > 1) at program start, get current working dir and remember that > > It's not as simple as that, since DOS has a current directory per drive. > Things like > > d:..\..\include > > are completely legal. The example above would be a path relative to the > current directory on drive d: [snip] > Path handling in Windows/DOS is a mess, especially of you start to add UNC > network paths (which are also legal paths). > > So I would be really glad if you could find another solution for your > problem :-) Another way to solve this is to make part of the path come from ENVIRONMENT VARIABLES, which most MAKE programs can read. One executes a command to set a given build environment, which sets the environment variables. These are read by the make program, and get put into the -I paths. I have used this technique regularly. It keeps path names out of my source (where it is a major pain), and allows my makefiles to be generic as well (where the pain is a little less acute, but still present). As an example, one could have -I$(INCLPATH1)/ -I$(INCLPATH2)/ The environment variables for a DOS machine with target 1 might be INCLPATH1=D:\CC65\INCLUDE\SYSTEM1 INCLPATH2=F:\COMPILERS\MYSTUFF\SYSTEM1 and for target 2 (or debug environment 2) INCLPATH1=D:\CC65\INCLUDE\SYSTEM2 INCLPATH2=F:\COMPILERS\MYSTUFF\SYSTEM2 whereas on a Unix machine they might be INCLPATH1=/cc65/include/system1 INCLPATH2=/compilers/mystuff/system1 and INCLPATH1=/cc65/include/system2 INCLPATH2=/compilers/mystuff/system2 Note that #include <../debug.h> Works just fine using this technique. Naturally, one would pick different names for the paths, indicating their use. They might be DEBUG_INCLUDE_PATH and MY_STANDARD_STUFF_PATH. Mike -- char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} This message made from 100% recycled bits. I can explain it for you, but I can't understand it for you. I don't speak for Alcatel <- They make me say that. ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo_at_musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2002-01-08 01:43:27 CET