It is currently Tue Aug 11, 2020 9:27 pm


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [Resolved] Makefile Missing Separator Error
PostPosted: Mon Jan 30, 2012 2:08 am 

Joined: Sun Jan 29, 2012 12:42 pm
Posts: 5
Hi, everyone!

First, I'd like to preface this bug report with the caveat that my level of coding experience is minimal-- so it might be the case that there's no bug here and I've just set up my development environment incorrectly.

Some background info on my setup:
Windows 7 Professional SP1 (64-bit)
Visual Studio 2010 Express Edition
CMake 2.8
Latest versions of Qt, Doxygen, and Cygwin (with the "make" package installed)
PolyVox downloaded from Git (Friday, Jan 27, 2012)

Following the "Building PolyVox" guide, I run the following command (from within PolyVox's "build" directory):
Code:
cmake "Visual Studio 10" ..

The command executes with no errors.

But, when I try to run "make" in any of the following ways...
Code:
make
make install
make test

...I encounter the following error:
Code:
Makefile:26: *** missing separator. Stop.

Opening up build\Makefile in Notepad, here's what it looks like around line 26 (line numbers added by me just for this post, for clarity):
Code:
19: # A target that is always out of date.
20: cmake_force:
21: .PHONY : cmake_force
22:
23: #=============================================================================
24: # Set environment variables for the build.
25:
26: !IF "$(OS)" == "Windows_NT"
27: NULL=
28: !ELSE
29: NULL=nul
30: !ENDIF
31: SHELL = cmd.exe

Now, I am able to circumvent the error by editing this makefile (despite the warning issued within the makefile that it is generated by cmake and should not be edited). I comment out the following lines, like so:
Code:
24: # Set environment variables for the build.
25:
26: #!IF "$(OS)" == "Windows_NT"
27: #NULL=
28: #!ELSE
29: #NULL=nul
30: #!ENDIF
31: SHELL = cmd.exe

This is perhaps a little reckless on my part, since I have no idea how the makefile works, but... after saving these changes and running the "make" command again (or "make install", or "make test"), the VC++ project files, solutions, etc appear and everything appears to be okay... however, there are no executable examples yet... I'm not sure if that is normal behavior?

Next, I open the PolyVox Visual Studio Solution ("PolyVox.sln") with Visual C++. I hit "F7" to build everything. After that is finished, executables appear in build\examples\<example name>\Debug... for example:
Code:
build\examples\Basic\Debug\BasicExample.exe

The executables run okay, and from this point it seems that the build is finished.

Next, I ran through the same steps with the latest stable snapshot, PolyVox-GIT-2e4bf67.zip (11th December 2011). Behavior is exactly the same.

Summary: The main point of concern here is the Makefile (or maybe the make command, technically) is reporting an error. It's possible I've set up CMake incorrectly or that I'm using the wrong "make" command (Note that I'm using the "make" package downloadable through Cygwin's "setup.exe" application). It appears that I've kludged my way around it for now, but I thought I'd post this issue to the forums just in case it's a bug or in case anyone else has run up against the same problem I did.


Lastly, thanks to the PolyVox developers for your hard work on this library! The potential is has as both a learning tool for me, not to mention as a platform for some awesome-looking games, is amazing. Much appreciation!

-DM


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Makefile Missing Separator Error
PostPosted: Mon Jan 30, 2012 9:24 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hi,

I thought you needed the '-G' switch to CMake to specify the generator? Maybe I'm wrong as on my system it defaults to the correct one, but I thought it would be like:

Code:
cmake -G "Visual Studio 10" ..


Be sure to look at the output of 'cmake -help' (or whatever it is called) to verify this.

When you issue the 'cmake' command above this should cause the Visual Studio solution/projects to be generated. You don't need to call 'make' for this to happen. You should just run 'cmake' and then open the solution straight away to build it.

Actually, you don't need 'make' at all (you don't even need Cygwin installed). Visual Studio comes with it's own compiler and build system. 'make' is really a Linux thing. There may be some confusion if you have multiple systems installed in this way... I've never really tried it.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Makefile Missing Separator Error
PostPosted: Mon Jan 30, 2012 6:25 pm 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
As David says, you need to use the '-G' flag to CMake to tell it to use a specific generator. I assume that since you have Cygwin and minGW installed, it was defaulting to "MinGW Makefiles". Try it with the flag David suggested and see if it helps.

Otherwise, the manual suggests using the CMake GUI since it will ask you for the generator explicitly.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Makefile Missing Separator Error
PostPosted: Mon Jan 30, 2012 9:30 pm 

Joined: Sun Jan 29, 2012 12:42 pm
Posts: 5
Thank you both for taking the time to respond.

Using the '-G' flag with CMake from the command line works beautifully for me, as does using the CMake GUI (testing with the latest Git files from Jan 27, 2012)

I just didn't quite read the manual thoroughly enough-- I took the comment about reading the Linux section too literally and tried to follow the Linux instructions for Windows. Of all the things to get tripped up on, it was my reading comprehension that did me in. Sorry about that!

I probably ought to educate myself on these tools more, too; I was just so anxious to get the examples running, that I made some hasty mistakes in getting things set up. Thanks again, both.

-DM


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net