Search code examples
cgitcode-organization

What are best practices for modular C development


I am in the middle of programming something in C.

I have this: https://github.com/nmmmnu/MemHashMapC

and this: https://github.com/nmmmnu/asyncore

I want first repository to uses the second.

Alternatively I may have third repository that uses both these.

I know I can do it with "ar", but since both repositories are mine, probably there are better way?

Is there any best practices for modular development like this in C?

I am using Linux and gcc.


Solution

  • One possible solution for structure: You could identify and separate the components of the software in folders. After this you could create folders for each project (containing the Makefile) which will use the components created.

    To use one repo in another repo you could try using git submodule: http://git-scm.com/docs/git-submodule .