DvvCz / cpkg

A dead simple package manager for C.
MIT License
1 stars 0 forks source link

Generating makefile #7

Closed DvvCz closed 6 months ago

DvvCz commented 6 months ago

It would be useful to be able to generate makefiles that accomplish what a cpkg build would do.

This would essentially make cpkg into something like premake.

Why

For my specific usecase, assignments are going to need to be accompanied by a makefile.

But I see how this could be useful for distributing projects to people who do not have cpkg for them to build it with other tools.

Why not

This may pose future issues as cpkg gets more functionality. Notably with dependencies.

I think it's fine to leave that discussion for later.

The command

No obvious command name strikes me, cpkg generate seems too general.. maybe cpkg export make / cpkg gen make / cpkg into make, which could later be used for other build systems..

Implementation

I don't think it would be all too difficult considering that cpkg itself is essentially a modern version of make. Some code may need to be

DvvCz commented 6 months ago

Ended up going with cpkg generate make.

Not too fond of the small names hence going with generate instead of gen, and format instead of fmt.