Building from source: broken makefile on github?

Home Forums TinyG TinyG Support Building from source: broken makefile on github?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9451
    bdurbrow
    Member

    OK, so I tried to download the release version of the source from github, and it looks like github mangled the makefile in the current version.

    It has a bunch of stuff like this in it, which make is choking on:

    <<<<<<< HEAD:firmware/tinyg/default/Makefile
    CFLAGS += -gdwarf-2 -std=gnu99 -Wall -DF_CPU=32000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
    =======
    CFLAGS += -gdwarf-2 -std=gnu99 -Wall -DF_CPU=32000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
    >>>>>>> refs/heads/edge:firmware/tinyg/default/Makefile
    CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

    I don’t claim to be an expert on makefiles, or github in general, but this looks like a patch file didn’t get merged correctly???

    FWIW, I’m on a Mac, with OS X 10.11.3; Xcode 7.2.1 (7C1002); and CrossPack 20131216 installed.

    #9452
    cmcgrath5035
    Moderator

    I don’t speak MAC, I’ll ask Riley to stop by.

    This is tinyG Master or tinyG Edge, or tinyG2?

    #9453
    bdurbrow
    Member

    It’s tinyG Master and I’m hoping to build for an Xmega 192a3u. Edge seems to be missing that stuff in the makefile; I haven’t had a chance to try to reconcile the differences (if any) between edge and master’s makefile yet.

    FWIW, the makefile should be the same between Linux and Mac builds (or conventional UNIX as well for that matter); as they are done at the POSIX layer. If the build process on Windows is using something like cygwin, then it would be the exact same makefile (and IIRC, Atmel Studio does use a version of GNU Make???).

    Note that I haven’t modified the makefile yet to build for the u version of the Xmega 192a3; this is just an out of the box build. This can be reproduced by: starting with a Mac with Xcode and CrossPack installed; download the master .zip from github and unpack it; open the Xcode project in ./TinyG/firmware; and select “Build” from the product menu. I presume you will get similar results on Linux from a similar process; and I *think* a makefile-based build on Windows will also fail.

    Unless it gets fixed first; when I get a chance I’ll download Atmel Studio into a Windows 10 VM and see if I can get the master .zip to build there.

    #9454
    bdurbrow
    Member

    Correction: it’s one commit back from current that edge is missing that stuff from the makefile.

    #9468
    bdurbrow
    Member

    OK, I’ve gotten it to compile.

    I’ve thrown up my modified makefile on PasteBin:

    http://pastebin.com/86bFPeza

    I haven’t yet tested it on actual hardware; as what I have has an atxmega192a3u in it (note the u at the end of the part number), and there are some naming conflicts that show up when you switch to that part number (‘USB’ is defined by Atmel on that part, but TinyG uses ‘USB’ to refer to the USB-to-serial chip that’s connected to one of the USARTs on the Xmega; so I’m going to have to find the naming conflicts and rename them. Thank goodness for grep!).

    Also, for anybody using CrossPack, you’ll need to edit the Xcode file’s project-wide settings to account for the compiler being in a different location. The settings you are looking for is in the project-wide build settings; as a user-defined parameter; set PATH to $(PATH):/usr/local/CrossPack-AVR/bin

    #9470
    bdurbrow
    Member

    Forgot to mention something: I also had to turn off __CANNED_TESTS and __TEST_99 in tiny.h due to a link error (it seems that the version of avr-gcc I have is generating a short jump when a long jump is needed?).

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.