Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   WindRiver & Git - Makefile (http://www.chiefdelphi.com/forums/showthread.php?t=86020)

Tanner 05-06-2010 11:46

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

byteit101 05-06-2010 14:31

Re: WindRiver & Git - Makefile
 
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.

Tanner 05-06-2010 14:51

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by byteit101 (Post 965459)
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:
Code:

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

-Tanner

Radical Pi 05-06-2010 15:10

Re: WindRiver & Git - Makefile
 
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?

byteit101 05-06-2010 16:47

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by Tanner (Post 965462)
Because otherwise I get:
Code:

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

-Tanner

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.

Tanner 06-06-2010 13:43

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by byteit101 (Post 965480)
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.

Quote:

Originally Posted by Radical Pi (Post 965466)
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?

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

Radical Pi 06-06-2010 13:53

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by Tanner (Post 965584)
How do people using SVN manage the makefile

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

byteit101 06-06-2010 13:54

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by Tanner (Post 965584)
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.

How are you importing it?
Quote:

Originally Posted by Tanner (Post 965584)
How do people using SVN manage the makefile?

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

Tanner 08-06-2010 08:17

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by byteit101 (Post 965586)
How are you importing it?

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.

Quote:

Originally Posted by byteit101 (Post 965586)
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

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

Mike Soukup 08-06-2010 13:53

Re: WindRiver & Git - Makefile
 
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.

Pat Fairbank 09-06-2010 00:17

Re: WindRiver & Git - Makefile
 
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.

Quote:

  • 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.


Radical Pi 09-06-2010 16:21

Re: WindRiver & Git - Makefile
 
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

byteit101 09-06-2010 18:26

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by Radical Pi (Post 966021)
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

Tanner 13-06-2010 17:14

Re: WindRiver & Git - Makefile
 
Quote:

Originally Posted by Pat Fairbank (Post 965969)
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.

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


All times are GMT -5. The time now is 12:23.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi