11 Replies Latest reply: Feb 20, 2014 4:09 PM by mahgou01 RSS

DS-5 How to create makefiles

topsy Bit

In the process of updating our build tool to work with DS-5.  I am able to use the DS-5 generated make files to compile and link using the ARM tools.  Assuming I start in a clean directory structure will all the source files, how can I get DS-5 to generate all the various make files using a command-line?

 

Thanks

  • Re: DS-5 How to create makefiles
    mahgou01 Bit

    Hi Topsy,

    Are you trying to create make files using DS-5/Eclipse in headless/command line mode? or are you trying to launch these make files (generated from DS-5/Eclipse in GUI mode) using command line?

    Would you kindly provide us with more information about your use case?

     

     

    Thanks,

    Mahanth

    • Re: DS-5 How to create makefiles
      topsy Bit

      I would like to know how to create the make files using DS-5/Eclipse in command line mode.  I know how to launch the files once they exist.

       

      The flow of my build tool (very generalized)

      1.  Get the source code and DS-5/Eclipse project files from the source control system

      2.  Generate the make files                       <-- don't know how to do this

      3.  Use the make files to compile and link  <-- I can already do this

       

      Thanks for the help

      • Re: DS-5 How to create makefiles
        mahgou01 Bit

        Hi Topsy,

        Thank you coming back to us with the helpful information.


        > I would like to know how to create the make files using DS-5/Eclipse in command line mode.

        I'm afraid, we don't have this feature in our ARM DS-5 today, so will have to rely on the Managed Builder within Eclipse to create these makefiles manually, and then use them in automation.

        Sorry about this.

         

         

        Thanks,

        Mahanth

        • Re: DS-5 How to create makefiles
          topsy Bit

          Once I open DS-5, is there a manual method to force DS-5/Eclipse to generate the make files (other than starting to compile the project)?

          • Re: DS-5 How to create makefiles
            mahgou01 Bit

            Hi again,

            Spare me a couple of days and I will get back to you on this.

             

             

            Thanks,

            Mahanth

            • Re: DS-5 How to create makefiles
              mahgou01 Bit

              Hi Topsy,


              > Once I open DS-5, is there a manual method to force DS-5/Eclipse to generate the make files (other than starting to compile the project)?

              Yes, there is a way to force DS-5/Eclipse to generate the makefiles without actually building the project.

               

              When you create a project in DS-5 and use the option "build project" it will build it by default, but by changing the "Builder Settings" you can choose options to just create makefile  and not compile it.

              But, with this method, it is difficult to validate the makefile, you will not know whether or not the makefile is correct until you actually build/compile it, either using the command line or GUI.

               

              Here are the steps, can you please try these and let me know if this helps?

              -----------------------------------------------------------------------------------------------------------

              1. Launch Eclipse for DS-5.

              2. From the menu bar click on File >> New >> Project >> C/C++ >> C Project.

              3. Enter project name and select project type as Bare Metal Executable.

              4. Select the hello world project or any other

              5. Click Finish.

              6. Add C sources files and other libraries (static) to the project if any.

              7. Add the static library archive file path to the linker settings in the Managed Builder ( this step required if you have any static libraries being added to the project).

              8. Now right mouse click on the project, go to "Properties >> C/C++ Build", untick the "use default build command" and delete the "make" command from the field "Build command".

              9. Under "Makefile generation", select the box "Generate Makefile automatically" if it's not already selected.

               

              Now, building this project will generate the Makefile under the Debug directory without actually building the project.

              You can then use this makefile to run on command line, you can try running this make using the "DS-5 command prompt".

              Hope this helps.

               

              Please revert back if you need more assistance on this.

               

               

              Thanks,

              Mahanth

      • Re: DS-5 How to create makefiles
        sellis Employee

        I have spent some time looking into this, and have an answer for you. Below is the text I will be asking to be added to the DS-5 documentation in the next release. Please give it a try and report whether it works.

         

         

        You can run Eclipse to clean and build your projects from a command line, for example, as part of an automated build. To do this:

         

        1. 1) Start DS-5 Command Prompt on Windows, or use suite_exec to open a shell on Linux. This ensures that Eclipse, make and other utilities are on your PATH environment variable.
        2. 2) Run eclipse (on Linux) or eclipsec.exe (on Windows) with the following arguments as appropriate for your needs:

         

        -nosplash

        Disables the Eclipse splash screen.

         

        --launcher.suppressErrors

        Causes errors to be printed to the console instead of being reported in a graphical dialog.

         

        -application org.eclipse.cdt.managedbuilder.core.headlessbuild

        Mandatory argument telling Eclipse to run the headless builder.

         

        -data {workspaceDir}

        Specify the location of your workspace.

         

        -import {projectDir}

        Import the project from the specified directory into the workspace. Use this option multiple times to import multiple projects.

         

        -build {projectName[/configName] | all}

        Build the project with the specified name, or all projects in the workspace. By default this builds all the configurations within each project. You can limit this action to a single configuration, such as Debug or Release, by specifying the configuration name immediately after the project name, separated with ‘/’. Use this option multiple times to build multiple projects.

         

        -cleanBuild {projectName[/configName] | all}

        Clean and build the project with the specified name, or all projects in the workspace. By default this cleans and builds all the configurations within each project. You can limit this action to a single configuration, such as Debug or Release, by specifying the configuration name immediately after the project name, separated with ‘/’. Use this option multiple times to clean and build multiple projects.

         

        The output from the build, such as warnings and errors, appears on the console.

         

        To list the full set of available options run:

         

             eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild

         

        As an example, to clean and build all the projects in workspace C:\workspace use the following command:

         

             eclipsec.exe –nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild –data C:\workspace –cleanBuild all

         

        As another example, to build the Release configuration of project MyProject in workspace C:\workspace use the following command:

         

             eclipsec.exe –nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild –data C:\workspace –build MyProject/Release

        • Re: DS-5 How to create makefiles
          topsy Bit

          Thanks for working on this, it will be a few days until I can try it, but I will report back.

        • Re: DS-5 How to create makefiles
          topsy Bit

          I was able to spend some time working on this, and so far it's going well.  If I'm inside of DS-5 and do a build, the console window has a button to copy the build log, and I would like to get that build log when using a command line build.

           

          If a build log is created by the command line compile/link where is it located?  If not, is there a way to get a log when using the command line compile/link?

           

          Thanks

          • Re: DS-5 How to create makefiles
            mahgou01 Bit

            HI Topsy,

             

            > If a build log is created by the command line compile/link where is it located?  If not, is there a way to get a log when using the command line compile/link?

            I'm not very sure about the build log file, however the output of the build command "eclipsec –nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild ..."  should come out on stdout/stderr.

            You should be able to then redirect (>) it to your own file. Have you tried this option? if not, could you try that and let us know if that resolves the problem?

             

            Thanks,

            Mahanth