what is make file? - brew-framework

What is the need of Make File? IN which situation we have to alter that file for Brew Application?

The makefile is usually used to build for the device (ARM) build of the project (with visual studio being used to build for the emulator). Visual Studio will run the makefile when you do the device build.

Small addition - makefiles used in Visual Studio only for MOD1 application, whereas they aren't used for compiling MOD apps.

As joseph said makefiles are used to build the source files in linux projects, advantage of makefile is you can write a general script irrespective of dependency files. and even if you change a single file in your file then you dont have to compile the whole source code again. only the file which is changed is compiled again and the files which are dependent on them are compiled. you can check out tutorial on the makefile at http://sagarsakre.blogspot.in/2012/09/understanding-makefile-for-beginners.html .....

Related

Compiling C++ files during runtime using Visual Studio compiler

I'm trying figure out how to compile C++ code from an executable during runtime using Visual Studio compiler under Windows.
I'll be using Visual Studio IDE to build main project into an executable and use CreateProcess to compile other C++ files and create a DLL to later load/use/unload this DLL.
I understand that one way of doing this requires setting environment variables(mainly PATH, INCLUDE and LIB) and there's a .bat file called "vcvarsall.bat" which does this.
The part I'm stuck with is the argument(s) passed to this batch file. I see that first argument is the platform with some of the options being x86, amd64, arm, etc. But how do I programmatically figure out which one of these arguments I should be using considering main executable could've been built with any one of these?
You can prepare a regular solutionfor this purpose, containing one project with a single file, and use it to compile your file easily.
Now, all you need is to reame your file to the file name in the project and compile a solution with command line. Alternatively, you can also edit the project and replace the existing filename with your file name.
To do so you need to resolve the environment variable %DevEnvDir% and run the folowing command with the platform name (x64, win32 etc.) and configuration name(Release or Debug)
like this:
%DevEnvDir%\devenv.com \path\to\yoursolution.sln /ReBuild "Release|x64"

Borland C++ 5.0 Makefile generation

I am using Borland C++ 3.1 and Borland C++ 5.0a to compile my projects. To speed up the process I decided to use a batch file to make all the projects with make utilities. There is a way to convert BC3 .prj files to .mak file with PRJ2MAK.exe, but, as far as I know, in BC5 projects it should be done through manual pressing of "Project -> Generate makefile" buttons in IDE. Is there any way to convert .ide files to .mak files in CMD?
In BC5 bin folder there should be an "idetomak" utility. At least BC5.02 has it.
Note that for some complex projects the generated .mak file may not be fully compatible. In that case you may instead run BC5 ide from the command line, telling it to build the .ide project

How to refer to Visual Studio output directory in CMakeLists.txt?

I have a cross-platform project which uses CMake. I am doing out-of-source builds so basically I have a source directory "src" which contains the CMakeLists.txt and then I have a "src/build" directory where I generate the out-of-source build.
However when using Visual Studio (2013) it does not place the executable in the build dir but to "src/build/Debug" for example (depends on the selected configuration). I think this was referred as "$(OutDir)" inside VS. How do I refer to the (runtime) output directory in my CMakeLists.txt so I can copy DLLs and shaders where my executable is?
Edit: The suggested duplicate answer does not seem correct to me. In that answer you just force the output directories to be static which sounds wrong if you are using a multi-configuration build system like Visual Studio.
I solved my problem by copying the files with the "file (GENERATE OUTPUT)" which supports the cmake-generator-expressions suggested by StAlphonzo:
foreach (file ${SHADER_SOURCES})
file (GENERATE OUTPUT $<CONFIG>/${file} INPUT ${PROJECT_SOURCE_DIR}/${file})
endforeach()
I would also like to mention a second way of solving this problem I discovered that I think is actually more correct, by adding a custom command:
add_custom_command(TARGET target ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCES_DIR}/foo $<TARGET_FILE_DIR:target>)

How to debug cmake target after install

I have a cross-platform project which uses cmake in order to generate Visual Studio solution files. The project has external dependencies (.dlls, resources etc) and the only place where the executable can be run is the installation directory. In that directory I have access all the resources, plugins, translations etc. I can install the project both in debug or release in that directory.
How can I debug a project in the installed location?
There are two problems with this case:
Sometimes I may debug the main application (Main.exe) (a target in cmake project)
Sometimes I may debug some plugins that Main.exe loads when started (I have a different cmake project for the plugins)
Is there a clean way of doing this in Visual C++ without actually create some custom project that is configured to start each time the Main.exe from the installed location? ("C:\Program Files\MainProject\Main.exe" )
Thank you,
Iulian
I managed to do it by 'configuring' with cmake a .user file for the specified project.
The only thing that the user needs to do is to use a template like in this bitbucket project.
In the project you can find a template file.
The cmake script command needed is:
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/scripts/windows/VS201x_Template.vcxproj.user.in"
"${PROJECT_BINARY_DIR}/INSTALL.vcxproj.user"
)
If you need a custom .user file you can always do it manually by saving the generated Visual Studio and creating a template from it similarly to the above example.

openRTMFP cumulus how to compile and install

i've just downloaded cumulus, POCO, OpenSSL and LuaJIT and visual studio. now i'm trying to compile it as it said in instruction here
however i've never used visual studio and i've never programed on visual c. so i'm stuck at the very begining.
in instruction i've put link above said "Visual Studio 2008/2010 solution and project files are included. It searchs external librairies in External/lib folder and external includes in External/include folder in the root Cumulus folder. So you must put POCO, OpenSSL and LuaJIT headers and libraries in these folders.". i tryed everything but compiler can't find 'Poco/foundation.h'.
and it seems to me if i deal with this error there will more over.
so if someone has expirience in compiling cumulus-server please help me to deal with it.
thanks a lot for you help!
step 1 - create 2 files
cumulus_root_folder/external/lib
cumulus_root_folder/external/include
step 2 - put the headers into the include folder from the other 3 dependent projects
dependent projects are: openssl, poco, luajit.
put openssl file into the external/include from openssl-version/include
put Poco file into the external/include from poco-version/Foundation/include
put SAX, DOM, XML files into the external/include/Poco from poco-version/XML/include/Poco
put Net file into the external/include/Poco from poco-version/Net/include/Poco
put Util file into the external/include/Poco from poco-version/Util/include/Poco
put LuaJIT's headers with the same way.
now you can build cumuluslib.
step 3 - Open your cumuluslib project with specific visual studio version then build it.
When it's done you can see the lib file at cumulus_root_folder/cumuluslib/lib
step 4 - now you have to build the 3 dependent projects and put their lib files to cumulus_root_folder/external/lib its tough mission, maybe you will need 32-bit windows. Do not forget: when you building poco, do it with debug if not, some of your files will be missing.
When you done with building and gathering lib files you can build cumulusserver. Same way as cumuluslib. Then your cumulus.exe will be in cumulus_root_folder/cumulusserver/debug

Resources