begging for the way to include C file in another folder

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, guys,

I still can't get a way to include a C source file in another folder in makefile.

I want to include a C source file from a fixed harddisk path, say I want to lnclude this file:
f:/abc/abc.c
and I also want to include the file from the same folder as the makefile been placed.

I tried the following in the makefile:

...
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c f:/abc/abc.c
...

then compiler said:

Quote:

> "make.exe" all
makefile:528: *** multiple target patterns. Stop.

> Process Exit Code: 2
> Time Taken: 00:01

Anyone can help me with this simple problem?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try using the unix representation of DOS drives like this:

SRC = $(TARGET).c /f/abc/abc.c

Nigel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Start a new GCC project with AVR Studio.
Use the generated Makefile by AVR Studio.
Add some source files from different locations to the project.
Save the project.
Take a look at the generated Makefile.

In some points the generated Makefiles from AVR Studio have disadvantages,
but handling of source files in different folders is solved well and is
worth to take a look at it.

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, thanks guys, I will try

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Nigel, it doesn't work.
The compiler said:

Quote:

make.exe: *** No rule to make target `obj/f/abc/abc.o', needed by `abc.elf'. Stop.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW, the makefile I'm using is the one came with WINAVR 20060421

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I just tried :

SRC += ../../abc/abc.c

then it's working, but the absolute address:

SRC += f:/abc/abc.c

doesn't work.

So how to make absolute address work???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hehe, got it work now.

with

#include 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hhhmm. I just tried for myself using

SRC = F:/abc/VERSION.c MODEL.c ANAL.c

and it works.

If the file is missing however then the "no rule ..." message is displayed.

Nigel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do not forget the case sensitive nature of the commands

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:
Hhhmm. I just tried for myself using

SRC = F:/abc/VERSION.c MODEL.c ANAL.c

and it works.

If the file is missing however then the "no rule ..." message is displayed.

Nigel

Out of curiosity, may I ask what exactly that last file is for? :shock:

The "no rule" is the standard make error for when it can't find a file. That includes if the case of the filename is incorrect, as you've discovered.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
Out of curiosity, may I ask what exactly that last file is for? :shock:

Reading-Analysis.c of course ... what were you thinking? :wink:

Nigel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well..
No I am not going there!!

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:
abcminiuser wrote:
Out of curiosity, may I ask what exactly that last file is for? :shock:

Reading-Analysis.c of course ... what were you thinking? :wink:

Nigel

Ah, of course! Glad we got to the bottom of that then!

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK so somebody is prepared to go there (colonials).

Keep it simple it will not bite as hard