WindRiver & Git - Makefile

Hi all,

Been playing with using C++ to program the robot instead of LabVIEW and I’ve been using Git as my VCS.

Things are working fine except for the Makefile. I haven’t programmed in C++ for years so I’m not sure if this is how things are done or what. I noticed the makefile has a lot of exact paths (C:/Users/Tanner/blah/blah) which doesn’t work too well in a VCS unless everyone has my computer (doubtful) and they don’t want to compile.

So what I’m asking is there a way to modify the Makefile so it can play a bit more nicely with Git?

-Tanner

Why are you putting the makefiles under version control? If you are using WindRiver you don’t even need to know what makefiles are.
Just put the actual code under control.

Because otherwise I get:

C:\windriver\vxworks-6.3\host\x86-win32\bin\make.exe: *** No targets specified and no makefile found.  Stop.

Hm?

-Tanner

what if you create a project on each machine that will be using the versioning to create the makefiles, then import the versioned files into the project?

does WR do this to you for every new project? I haven’t seen this myself, and it shouldn’t do it at all unless you messed with it.

No, WindRiver handles it and I never see this unless I take it away.

I’m confused how WindRiver is going to compile fine without the makefiles. Maybe I’m importing the project wrongly into WindRiver, but I’m not seeing how it can be done otherwise.

This probably one way of doing things, though it might be a bit interesting to manage when a file is added/deleted in the repository. WindRiver might not notice it.

How do people using SVN manage the makefile?

-Tanner

SVN is built into Wind River (or it’s an eclipse extension - I don’t remember) so everything is handled automatically

How are you importing it?

I don’t, I just use the subclipse plugin and it takes care of it all. the only files that I dont see in the project that it svn’s are .cproject .project .wrmakefile and .wrproject
EDIT: found EGit, a git plugin for eclipse/windriver: http://www.eclipse.org/egit/download/ I would import from the git source when it is installed

Well, I couldn’t figure much out how to get WindRiver to detect a project existed (outside of playing the project folder in the Wordspace directory), but the File -> Import seemed to work. I’m not sure on the specifics (at work right now), but that’s pretty much it.

Hm, that’s strange. I wonder what magic it does.

I’ll have to try the EGit when I get home. Might give me better results.

-Tanner

I don’t have the computer with me right now that I use for FIRST development, so I don’t know the specific instructions, but I’ll try from memory.

We use SVN to host just our code. No makefiles, no project files, just .cpp & .h. Each developer then creates a project using one of the sample projects as a base, cleans out all the default code files, renames the project, etc. Then we import (I believe that’s the correct menu option, but I’m not certain) the directory that contains all our SVN code. Our code is then buildable. When someone adds or removes a file, it’s necessary to refresh the file browser tree.

I’ve done it on SVN with just .h and .cpp files. Here is a procedure I wrote a couple of years ago for the guys on my team (I updated it a bit, but there may be mistakes).

We use TortoiseSVN, hence the Windows Explorer right-click-menu bit.

  • Run Wind River Workbench 3.0.
  • Go to File->New->Example…
  • Select VxWorks Downloadable Kernel Module Sample Project and click Next
  • Select FRC Default Program and click Finish
  • Right-click on BuiltinDefaultCode in the Project Explorer and select Rename.
  • Enter the desired project name.
  • In the [project name] project in the Project Explorer, delete BuildinDefaultCode.cpp and sample.txt.
  • In Windows Explorer, navigate to C:\WindRiver\workspace.
  • Right-click on the [project name] folder and select SVN Checkout…
  • Enter [svn path] as the repository URL.
  • Enter ‘C:\WindRiver\workspace[project name]’ as the checkout directory.
  • Click OK; when the ‘folder not empty’ warning pops up, click Yes.
  • Right-click in the Project Explorer and select Refresh.
  • Right-click the [project name] project, and go to Build Options->Clean Project. The project should now be set up.

Actually, there is an option to create a project from an SVN repo. I think it’s Import->SVN. It’s what we use, and it works well

Almost, Import>SVN>Checkout Projects From SVN
or you could use
New>Project>SVN>Checkout Projects From SVN

We used this also

This method seems to work fine when using Git. I’ll do a write up in a bit once I’m done converting my repo to make sure it really works.

Thanks all.

Edit: Though it doesn’t work too well with branches (cause when you go back to the same branch, they won’t exist anymore thus WindRiver whines). Not sure if there is a way to get git to not delete those files.

-Tanner