Shop OBEX P1 Docs P2 Docs Learn Events
Guidance on setting up Eclipse to build. — Parallax Forums

Guidance on setting up Eclipse to build.

photomankcphotomankc Posts: 943
edited 2012-08-09 01:34 in Propeller 1
Ok on my bigger workstations I have to admit I got real cozy with Eclipse doing the dot completion, header/source switching, auto function skeleton, stuff. Is there any guidance on how I can get Eclipse to just be able to build the project? I don't care if I still use SimpleIDE to load the program but getting as far as building with Eclipse would be kind of cool. Right now I do it a bit like Aurduino and edit in Eclipse and build/load with SimpleIDE. Don't really know where to start to get Eclipse configured to use PropGCC to compile and link.

Comments

  • jazzedjazzed Posts: 11,803
    edited 2012-08-08 22:47
    Here's a simple example I put together last year on Eclipse Indigo.
    You can even run it with the loader if the configuration is right.

    There are challenges though.

    * I have no idea if just copying the .zip folder will work.
    * The project must be selected at all times (why does it ever get deselected?).
    * Can't pass input on the output window to a program.
    * User must manually terminate the program if the terminal is used.
    * Ctrl+C in the output window doesn't work.

    Netbeans can also be used. Both are equally hard to configure.

    attachment.php?attachmentid=94792&d=1344491590
  • amossamamossam Posts: 35
    edited 2012-08-09 01:34
    photomankc wrote: »
    Ok on my bigger workstations I have to admit I got real cozy with Eclipse doing the dot completion, header/source switching, auto function skeleton, stuff. Is there any guidance on how I can get Eclipse to just be able to build the project? I don't care if I still use SimpleIDE to load the program but getting as far as building with Eclipse would be kind of cool. Right now I do it a bit like Aurduino and edit in Eclipse and build/load with SimpleIDE. Don't really know where to start to get Eclipse configured to use PropGCC to compile and link.

    Hey!
    I'm using Eclipse Juno on OSX, but this should work, you only need to adjust paths...

    So, I'm using C/C++ project with MakeFile Project / Empty Project -> "Other Toolchain"

    Then, i create Makefile with folowing content (you should adjuct paths...):
    (in SRC line you just write filenames in your project...)
    CC            = /opt/Development/parallax/parallax/bin/propeller-elf-gcc
    CFLAGS         = -Os -mlmm -I . -I /opt/Development/parallax/parallax/propeller-elf/include -L. -ltiny -Wall -fno-exceptions
    NM             = propeller-elf-nm
    
    SRC            =    main.cpp
    OBJ            =    $(SRC:.cpp=.o)
    EXE            =    main
    
    all: $(SRC) $(EXE)
    
    $(EXE):    $(OBJ)
        @(cd build; $(CC) $(LDFLAGS) $(OBJ) -o $@)
    
    %.o:    %.cpp
        @(mkdir -p build)
        @(cd build; $(CC) $(CFLAGS) -c ../$< -o $@)
    
    clean:
        @(rm -rf build)
    
    

    And then in Project settings, C/C++ Build -> Enviroment I just insert INCLUDE variable with path to propeller include headers.
    Also in Project settings, Run/Debug settings, I add new launch settings with following:
    C/C++ Application:
    "/opt/Development/parallax/parallax/bin/propeller-load"
    and in Arguments:
    -I /opt/Development/parallax/parallax/propeller-load
    -b QUICKSTART
    -p /dev/tty.usbserial-A100S8K4
    ${workspace_loc}/${project_path}/build/main
    -e
    -r
    -S
    

    Code completiton, warnings works, everything. when i build project it builds it, and when i run project it uploads it to propeller...

    my 1 cent...
Sign In or Register to comment.