winavr + custom Makefile + cygwin-style drive names breaks

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

Hi All:

I have a problem I can't seem to find an easy solution for:

I have a large number of source files in my project, for which I have adapted the excellent Makefile from the WinAVR base set. That all works fine, however now I am trying to change the Makefile to work in a similar method to that described here:

http://mad-scientist.net/make/mu...

This also seems to work well, however avr-gcc barfs when confronted with the cygwin-style full pathnames (eg, /cygdrive/f/path/to/source/foo.c) - saying "no such file or directory".

Anyone found this little problem before, or even better, managed to solve it?

Cheers,
mvdw

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

I think you would need to run make within the cygwin shell in order for that drive path to be valid.

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

atomicdog wrote:
I think you would need to run make within the cygwin shell in order for that drive path to be valid.

I *do* run make from within the cygwin shell, but avr-gcc doesn't like the path. If I manually change the pathname to f:/path/to/source it works (still within the cygwin shell).

Looks like the workaround may be to pipe the pathnames through sed in order to change them to avr-gcc friendly versions.

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

A lot of this depends on what you are trying to accomplish.

Are you trying to be able to build your project in
different environments/OSs - where regardless of the OS
being used to build the project,
it creates the same final build image.

OR...

Or are trying to be able to build your project on one
OS and there are multiple builds that are different
depending on the target OS?

Or is it a combination of both?

How you proceed can vary greatly depending on what you
are wanting/needing to do.

--- bill

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

Basically what I have is a set of source code that is common to 3 or 4 different projects (slightly different hardware, but essentially similar), then as well as that for each project there is an additional set of source code that depends on the application.

There is a large set of common source code that I'd like to maintain in a separate directory, which has inside it (for example) memory locations or variables that differ between the different hardware sets; these are defined in an include file which changes depending on the project.

So, there is a 'lib' directory with a whole lot of common source code, then each project has its own directory with a main.c, project-defs.h and various other sources.

The total number of source code files in lib is around 50, while the application source file count is more like 10.

Note that the avr processor will differ depending on the hardware, too.

So, what I want after all this is a build system that will:

* Build the same hex file for the same project under windows, linux and OSX (assuming gcc & libc version is the same of course);
* Build from a largely common set of sources, for several different sets of hardware, into a different target directory for each project.

At the moment I have just copied the entire source tree into each project and trimmed it down or added files to get the projects compiled, but now that I have a 3rd set of hardware, with another number to come in the future I want to reduce the code maintenance required.

Note that my modus operandi is to compile everything from a bash shell using 'make'; this is platform independent and up until now has worked well.

Note also that I have solved the cygwin pathname problem, but it has uncovered a more insidious problem - it skips over the object file creation and tries instead to link the (non-existent) .o files...

The cygwin path problem is solved by adding the following to the top of the Makefile:

MYSRCDIR = $(shell echo $(SRCDIR) | sed 's_^/cygdrive/\([a-z]\)/_\1:/_g')

and changing all references to $(SRCDIR) with $(MYSRCDIR) (including all the VPATH references).

Edit: Attached Makefile & target.mk I am using for reference

Attachment(s):