34

I've always wanted to know if there is a default directory layout for C projects. You know, which folders should i put which files and such.

So I've downloaded lots of project's source codes on SourceForge and they were all different than each other. Generally, I found more or less this structure:

    /project         (root project folder, has project name)
    |
    |____/bin        (the final executable file)
    |
    |
    |____/doc        (project documentation)
    |    |
    |    |____/html  (documentation on html)
    |    |
    |    |____/latex (documentation on latex)
    |
    |
    |____/src        (every source file, .c and .c)
    |    |
    |    |____/test  (unit testing files)
    |
    |
    |____/obj        (where the generated .o files will be)
    |
    |
    |____/lib        (any library dependences)
    |
    |
    |____BUGS        (known bugs)
    |
    |____ChangeLog   (list of changes and such)
    |
    |____COPYING     (project license and warranty info)
    |
    |____Doxyfile    (Doxygen instructions file)
    |
    |____INSTALL     (install instructions)
    |        |
    |____Makefile    (make instructions file)
    |
    |____README      (general readme of the project)
    |
    |____TODO        (todo list)

Is there a default standard somewhere?

Edit: Sorry, really. I realised there are numerous similar questions for recommended C project directory files. But I've seen people say what they think is best. I'm looking for a standard, something that people usually follow.

Related Questions:

C - Starting a big project. File/Directory structure and names. Good example required

Folder structure for a C project

File and Folder structure of a App/Project based in C

Project Organization in C Best Practices

Community
  • 1
  • 1
alexdantas
  • 626
  • 1
  • 7
  • 13

2 Answers2

17

I would say "no", and your empirical evidence seems to support that.

I usually get confused right around when I need to decide between doc/ and docs/ ...

unwind
  • 391,730
  • 64
  • 469
  • 606
  • Most of the projects i find prefer 3-letter folders, like doc, cfg (configuration), res (resources) and even tst (for testing). – alexdantas Dec 15 '11 at 16:25
  • 3
    @alexdantas I have seen the same thing. It's curious that it's good programming practice to have meaningful names i code but apparently not in the project hierarchy. That said, I do use the short names myself but I also consider it kind of a bad habit. – Kenneth Dec 15 '11 at 17:16
5

Well, there is “libabc” which is showcasing common practice.

jørgensen
  • 10,149
  • 2
  • 20
  • 27