DEV Community

Wafelack
Wafelack

Posted on • Edited on

Why i created a package and project manager for C lang

A few months ago, I was wondering why we hoard Makefiles and why it is so painful to use an external library in a C project.

So I had this idea : Creating a project manager & build tool for the C programming language.

I started to write a piece of code in C and it was not functionning properly (Cause I'm one of the worst C developers in this world) but i continued 'till we cannot run that thing.

At the same time, I was learning Rust ; so, I decided to try to rewrite the whole project in that language.

After a few weeks of rewriting, I had a correct product. The 08/10/2020, Wanager 1.0 was released. It had only a few features : project creation and reinitializing, project build and run and header creation.

At that point, someone called Lockeer told me that it will be cool if we can manage libraries.

So I wrote a simple system to install libraries hosted on my vps, with a submission system based on mailing. It was working, but limited because of vps bandwidth and the complexity of submiting by email.

So SuperFola poped up :

fola

At first time, I decided, as he advised me, to use the github api that produces a tar archive of the repo.
I stucked on that for weeks because the command I was running was producing a corrupted file.

After raging on that problem, I realised that I'll gain some portability and time with cloning directly with a git command.

It worked good, so, everything is fine !

But Il_totore opened an issue :

iltotore

So I made python support for build scripts with minimal version of 3.5.x and allowed path specification.

After that, on his advice, I made kind of Python API to have nice build scripts and it produced that :

from wngbuild import * # Import all from wngbuild module

build = BuildProfile(files="src/*.c",output="build/custom/prog.exe" ) # setup a build profile that will compile all files in src/ and place the binary in build/custom/prog.exe
build.cc = "C:\\MinGW\\bin\\gcc.exe" # Setup the compiler (optional, by default "gcc")
build.flags = "-W -Wall -Werror -Wextra" # Setup the flags that the command will be run with (optional)

build.run() # Run the compilation command
build.runOutput() # Run the binary produced by the compilation command (Will raise an error if the compilation command fails)
Enter fullscreen mode Exit fullscreen mode

GitHub logo Wafelack / wng

The W package manager official repository | WNG is a C package and projects manager written in Rust.

                     WW      WW NN   NN   GGGG
                     WW      WW NNN  NN  GG  GG
                     WW   W  WW NN N NN GG
                      WW WWW WW NN  NNN GG   GG
                       WW   WW  NN   NN  GGGGGG
                        The W package manager
                   Copyleft (ɔ) 2020-2021 Wafelack
ABOUT
=====
WNG is a C package and projects manager written in Rust. It permits 
projects build, run, creation and dependencies management.

It is highly customizable by a plugin system and it based on a 
highly modulable library.

It is available on Windows and Unix like systems.

It only requires a few prerequisties: a C compiler and git.

DISCLAIMER
==========

##############################################################
#                                                            # 
#   WNG is provided under the MPL-2.0 license on an "as is"  #
#    basis, without warranty of any kind, either expressed,  #
#     implied, orstatutory, including, without limitation,   #
#    warranties that WNG is free of defects, merchantable,   #
#       fit for aparticular purpose or non-infringing,       #
#

It is still WIP, there are loads of features that I can add to it but I will be more very happy to answer your questions or help you use it.

Thanks for reading and have a nice day.

Top comments (2)

Collapse
 
ariusb profile image
ariusb

Great!

Collapse
 
rokstar profile image
Roman Kirsanov

I made the same but for Deno and TypeScript
deno.land/x/buildsystem