Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Have Qt Creator automatically generate makefiles for my avr-gcc project
QtWS25 Last Chance

Have Qt Creator automatically generate makefiles for my avr-gcc project

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 4 Posters 4.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    halfgaar
    wrote on last edited by
    #1

    I'd like to develop my Atmel microcontroller project using QtCreator. I don't need a lot, just that it automatically builds all *.c files with avr-gcc, does a make clean, links, etc. To that end, I'd like it to generate a make file, like it does with qmake for a Qt project, that compiles and links my (currently) 4 .c files like this:

    avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=main.lst -c main.c                                                                                                                    
    avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=devices.lst -c devices.c                                                                                                              
    avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=adc.lst -c adc.c                                                                                                                      
    avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=settingsmemory.lst -c settingsmemory.c                                                                                                
    avr-gcc -Wl,-Map,MainsBuffer.out.map -mmcu=attiny85 -lm  -o MainsBuffer.out main.o devices.o adc.o settingsmemory.o
    

    I'd also like QtCreator be aware of the include path containing all the libc-avr .h files, for autocomplete.

    How do I do this? Creating a .pro file and then using qmake generates a hugely complicated makefile containg all kinds of Qt stuff, and I have no idea how to make it run the avr-gcc commands above. Creating a general project (with a .files, .creator, .includes and .config file) can't seem to generate makefiles, or otherwise have the ability to automatically build all files listen in project.files.

    Isn't there just a way to define a template and then say 'foreach source_files, do stuff'?

    R 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      This thread might be a starting point to adapt to your needs.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H Offline
        H Offline
        halfgaar
        wrote on last edited by halfgaar
        #3

        That thread is missing one vital bit of information, and that is how to have Qt Creator compile each .c file automatically (with a specified kit). It should be a very simple thing to just compile each source file with a specified command or compiler/kit, giving it project specific command line options. But I can't seem to figure it out.

        I'm trying QBS now, but I'm having a hard time understanding it. For one, my Qt Creator is missing the QBS settings in tools->options (edit: I just had to upgrade it). I was hoping I could use Qbs with an AVR-GCC kit to do what I need.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You could also try getting started with a non Qt qmake project. What version of Qt creator are you running ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • H Offline
            H Offline
            halfgaar
            wrote on last edited by
            #5

            I'm using Qt Creator 3.5.0. I tried a non-qt qmake project, but I can't select my avr-gcc kit, because it says it has no Qt version defined (which is on purpose, of course).

            1 Reply Last reply
            0
            • H halfgaar

              I'd like to develop my Atmel microcontroller project using QtCreator. I don't need a lot, just that it automatically builds all *.c files with avr-gcc, does a make clean, links, etc. To that end, I'd like it to generate a make file, like it does with qmake for a Qt project, that compiles and links my (currently) 4 .c files like this:

              avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=main.lst -c main.c                                                                                                                    
              avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=devices.lst -c devices.c                                                                                                              
              avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=adc.lst -c adc.c                                                                                                                      
              avr-gcc -I.  -g -mmcu=attiny85 -Os -fpack-struct -fshort-enums -funsigned-bitfields -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=settingsmemory.lst -c settingsmemory.c                                                                                                
              avr-gcc -Wl,-Map,MainsBuffer.out.map -mmcu=attiny85 -lm  -o MainsBuffer.out main.o devices.o adc.o settingsmemory.o
              

              I'd also like QtCreator be aware of the include path containing all the libc-avr .h files, for autocomplete.

              How do I do this? Creating a .pro file and then using qmake generates a hugely complicated makefile containg all kinds of Qt stuff, and I have no idea how to make it run the avr-gcc commands above. Creating a general project (with a .files, .creator, .includes and .config file) can't seem to generate makefiles, or otherwise have the ability to automatically build all files listen in project.files.

              Isn't there just a way to define a template and then say 'foreach source_files, do stuff'?

              R Offline
              R Offline
              RodCarty
              wrote on last edited by RodCarty
              #6

              @halfgaar Can you please post your hardware details here? What controller and kit you are using and what are their specifications?
              Also what are the other hardware components?
              Also what about your QTcreator? which one you are using?

              turnkey pcb assembly

              1 Reply Last reply
              0
              • D Offline
                D Offline
                devel
                wrote on last edited by devel
                #7
                This post is deleted!
                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved