Re: [cc65] Compile problem

Date view Thread view Subject view

From: Adam Dunkels (adam_at_sics.se)
Date: 2001-12-10 21:48:25


On Monday 10 December 2001 20:03, you wrote:
> AD> I think that the behavour that ca65/cc65 exhibits is the more common
> AD> behaviour. I haven't come across any compilers that lets you specify
> "include AD> file relative to where this file lives" (but then I haven't
> come across very AD> many compilers).  The common behaviour is that
> #include files are searched AD> relative to all -I paths and some default
> paths (., /usr/include and friends AD> as well as a few others).
>
> eh? just try this... create 2 .h files in the same directory, let one
> of them include the other using its filename ONLY. now create a .c
> file somewhere else in your filesystem and include the previous .h
> file (the one that includes the other that is ;=)) using a relative
> path.

But the big question is why you would want to do just that? What is there to 
gain by using

#include "../a/very/long/and/troublesome/path/file.h"

instead of 

#include "file.h"

and specifying -I../a/very/long/and/troublesome/path to ca65 or cc65?

The latter is much more practical when the long and troublesome path suddenly 
changes; instead of having to go through every .c file and change the path, 
only the makefile has to be changed.

> AD> CFLAGS = -I../src/include -I../src/arch/cc65/include
> -I../src/include/ipv4
>
> AD> This way, all includes are kept in diffrent directories and the paths
> are AD> relative to the makefile and not to the root of the filesystem.
>
> this makes another assumption though...that is cc65 beeing installed
> at a specific location. mmmmh

Huh? What does that have to do with which C compilers are installed and where 
they are located?

> however, trying relative paths in the -I line might be a working
> solution for what i want to do... didnt think of that :o)

The -I flag is a very good way to deal with having include files scattered 
around. 

/adam
-- 
Adam Dunkels <adam_at_sics.se>
http://www.sics.se/~adam
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:44 CET