This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

makefile

Hi

I am not very familiar with "makefiles". I read that is a way to tell the compiler the order and organization of the files; I guess it is like creating a project in uvision, but i am not sure. Anyway, i have a set of files that were created with a makefile, and i don't know hot to create the project from it, can anybody help me?

Thanks

Parents
  • The full workings of that makefile won't be easily reproducible in uVision (at least not in uVision2), because that won't make multiple targets in a single run.

    To build those .hex files in uVision would be quite trivial: it won't take more than creating a project, adding one .c file to it, maybe selecting a few options, and that's it. Then hit "build" and compare the .lst files to those you got from the makefile build. Lather, rinse, repeat until they're identical.

Reply
  • The full workings of that makefile won't be easily reproducible in uVision (at least not in uVision2), because that won't make multiple targets in a single run.

    To build those .hex files in uVision would be quite trivial: it won't take more than creating a project, adding one .c file to it, maybe selecting a few options, and that's it. Then hit "build" and compare the .lst files to those you got from the makefile build. Lather, rinse, repeat until they're identical.

Children
  • because that won't make multiple targets in a single run.

    I do that routinely with .bat files

    an example:

    if "%1"=="s" goto gams
    call makp ar %2
    call makp br %2
    call makp as %2
    call makp bs %2
    if "%1"=="p" goto end
    :gams
    call maks a	 %2
    call maks aa %2
    call maks b	 %2
    call maks ba %2
    call maks l	 %2
    rem call maks t	 %2
    :end
    if anyone is interested in seing makp and maks, just ask

    Erik

  • "that [uVision] won't make multiple targets in a single run"

    Yes, that can be a pain.
    uVision could really do with a "Build ALL Targets" option.

  • I created a project and included one of the files (which I think it is the main file) and the compilation did not show any errors, hopefully that will work.

    I will simulate it later and see if that works, but anyway i still don't know how the makefile works.

    William

  • Yes, that can be a pain.
    uVision could really do with a "Build ALL Targets" option.


    I have several "build multiple" cases and I really doubt there is any way to make an IDE such as uVision do it.

    1) I mostly build just one - after all you can only debug one build at a time and use a file like the above to build them all for buildability test or release.
    2) the "external variables" to create the individual build of the multiples can have many different formats. Some cases it is file select and some cases it is #ifdef control and sometimes it file select and rename and sometimes .... .

    So, I would say "forget IDE multibuild, but make the uVision components run smoothly from the commandline (basically they do)" and leave the multibuild to our build files. Just please, pretty please stop bugging us with "why do you not use the IDE".

    Should anyone have any illusions about multibuild being "simple" I'll gladly post the .bats

    Erik

  • I have several "build multiple" cases and I really doubt there is any way to make an IDE such as uVision do it.

    Sure there is. All it takes is to allow targets to be added as "things to be built" to other targets. Then all you have to do is to have a main target that includes all others, and building that will build them all, one after the other. uVision already gets the rest of the job right (easier than with makefiles, actually): it recognizes that if you change targets, all previous .obj files have to be recompiled, so "change target, build target" is automatically equivalent to "change target, rebuild target from scratch".

  • Hans-Bernhard,
    You just totally bypass the "target switching"

    an example from a .bat

    IF "%1"=="a"  goto lca
    IF "%1"=="aa" goto lcaa
    IF "%1"=="b"  goto lcb
    IF "%1"=="ba" goto lcba
    IF "%1"=="l"  goto lcl
    IF "%1"=="t"  goto lct
    :lca
    copy ..\sc\cond\sfa.h  condit.h		>..\trash\trashbin
    copy ..\ss\usmaina.c   usmain.x		>..\trash\trashbin
    copy ..\ss\usledst1.c  usledstb.x	>..\trash\trashbin
    copy ..\ss\ussgndv1.c  ussgndvr.x	>..\trash\trashbin
    goto lxx

    Erik