|
This thread is locked; no one can reply to it. |
1
2
|
Guys this is a really important question |
Polybios
Member #12,293
October 2010
|
pasta/ |
dada__
Member #16,089
September 2015
|
I use this: src/ - all .c and .h files, object files are placed here too I'm new to C, so I've never thought about project structure too much. It's just that I like simplicity. But I should probably at least put the .o files somewhere else. |
Mark Oates
Member #1,146
March 2001
|
I like your choice for resources/. Currently my resources go in bin/data/, but I might change that over to bin/resources/. -- |
bamccaig
Member #7,536
July 2006
|
As a convention, bin/ isn't for all non-textual files. It's for executable, often-though-not-necessarily binary, code. It would make better sense to have a separate directory for that. On a Linux file system you'd expect to install those kinds of things in /usr/lib/$program/. Locally it probably makes sense in a directory next to bin. Resources is a good description, but it's also very verbose. I like media/ for audio/visual data. Another good envelop is just data/. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Mark Oates
Member #1,146
March 2001
|
For me, it might end up being something like this: bin/ data/ bitmaps/ config/ documents/ fonts/ languages/ layouts/ models/ samples/ scripts/ Also noticed that this is the way liballeg does it with build. The build/ dir (apparently just now realized) copies contents from ./data/ dir into ./build/examples/data/. But in this case, the binaries sit in examples/ and not in bin/ 🤔 -- |
Audric
Member #907
January 2001
|
bamccaig said: As a convention, bin/ isn't for all non-textual files. It's for executable, often-though-not-necessarily binary, code In case some people can't think of an example, it means this is a right place to store scripts. A file with no extension could perfectly be a shell script (similar to a Windows .BAT file), perl script, Lua script or whatever. In the Unix/Linux world, the first line of the file would determine what should run it when you double-click it or type the name in command-line. |
m c
Member #5,337
December 2004
|
1
2 Volume in drive C has no label.
3 Volume Serial Number is F4FD-FC3A
4
5 Directory of C:\Users\capt\Dropbox\master
6
712/16/2016 08:18 PM <DIR> .
812/16/2016 08:18 PM <DIR> ..
912/07/2016 08:08 PM <DIR> assets_buildtime
1012/16/2016 08:14 PM <DIR> assets_runtime
1112/15/2016 12:18 AM 4,266 CMakeLists.txt
1212/15/2016 04:10 PM <DIR> include
1312/13/2016 01:35 AM 6,653 Makefile
1412/16/2016 05:18 PM <DIR> src
15 2 File(s) 10,919 bytes
16 6 Dir(s) 307,930,775,552 bytes free
And "Data" is in another directory entirely. The program searches several locations on startup for a folder called Data with a file called instlist.ini inside it to automatically chdir into there, so it doesn't matter where the program is run from, it will find the game load files in c:\temp\Data, <userfolder>\Dropbox\Data, ./Data, ./../Data. ./../../Data, etc... I always thought "how can I make it simpler" but then I couldn't. When it can be installed, it can also check the registry for a install location to look for data. That way there is no need for "copy data files to build directory" for it to run, and no difference between debug build&run and installer->program files run. (\ /) |
Thomas Fjellstrom
Member #476
June 2000
|
src and include. -- |
GullRaDriel
Member #3,861
September 2003
|
Like Thomas. "Code is like shit - it only smells if it is not yours" |
|
1
2
|