Search code examples
c#visual-studiomakefilethrift

Running different makefiles in windows


I've downloaded Apache Thrift and have created a thrift file that nicely generates code (I'm using csharp). I've now got to the stage of including Thrift in my Visual Studio project (I'm using 2013 version) and am stuck on how to do this.

Thrift includes all the source files I need but just copying them to Visual Studio creates a load of errors. I noticed that there are several makefiles that come with the source: There's a Makefile.am and a Makefile.in. I tried running:

nmake -f Makefile.am
nmake -f Makefile.in

but i keep getting syntax errors.

Any help would be much appreciated.

Here are the syntax errors:

 Makefile.am(73) : fatal error U1034: syntax error : separator missing
Stop.

and:

Makefile.in(16) : fatal error U1035: syntax error : expected ':' or '=' separator
Stop.

Solution

  • As you can see the errors are just basic syntax one's.

    Still a good idea to post the source and the error messages. We don't like guesswork, because it is highly inefficient. And you want quick help, don't you?

    The help I need is what to do with all the different types of makefiles.

    First, I'm not sure why you need a makefile at all. You could easily achieve he same result by calling Thrift in the prebuild step. I do that via batch files, which gives me enough control over the process. But, yes, you could of course also call nmake -f makefile here, but note there is no extension after makefile.

    In a nutshell and without spending too much time on details, the makefile.am and makefile.in are typically GNU automake files. Roughly, during bootstrap.sh && configure these makefile.am files are converted into makefile.in files and finally into makefile files, which then are to be consumed by make or equivalent tools.

    But honestly, on Windows platforms, GNU automake is something that I would consider the option of last resort - if there is any other option available, choose that one.

    Last not least, the tutorial, library and test *.csproj files show at least one way how to integrate Thrift in the prebuild step.