Hi. Snapcraft is not a build system, but it executes build systems like Autotools/Automake via its different plugins: https://snapcraft.io/docs/supported-plugins
For any software, developers must (should) pick a build system first. This is independent of any packaging (like snaps, debs, or even Windows installers). Common build systems for C would be CMake, Meson or your bespoke Autotools.
What this means: You have to set up your project so that it can be compiled with the usual command invocations. For autotools projects that would be something like `./configure && make && make install. Only then can you use the autotools plugin.
What you need to do:
Pick a build system. Nowadays I’d recommend something more modern compared to Autotools. Try Meson if you don’t have a clue yet.
Create the necessary files. You have to look at examples or tutorials.
A very simple meson project could be created as such:
Select the correct snapcraft plugin, which will then execute the right commands to first build your tool and then package it.
If you want to stick to your plain Makefile (I would not recommend that), consider using the nil plugin and write the whole compilation & installation sequence as a script: https://snapcraft.io/docs/nil-plugin
Thank you for your suggestion. I’ll try it out all option.
Basically my requirement is not only for a basic .c file related, I want to implement it in my C,C++,Qt project.
To learn about snapcraft I have started with the basics.
I’ll go through all suggested pages.