twiddlingbits / twr-wasm

twr-wasm: easily run C/C++ code in a web browser using Web Assembly, with examples
https://twiddlingbits.dev/
MIT License
17 stars 1 forks source link

tests-audio makefile issue (minor) #47

Open twiddlingbits opened 1 week ago

twiddlingbits commented 1 week ago

should the .o files go into outvs. example root?

twiddlingbits commented 1 week ago

also is this line needed in pong makefile? rm -f *.o

JohnDog3112 commented 6 days ago
  1. Maybe? For single file projects (like tests-audio) I've been putting them in root since it doesn't cause that much clutter. It seems you might have done something similar for test-users, tests, terminal, multi-io, maze, and several others. I can switch it to go to an out folder though.

  2. rm -f *.o was originally in Pong because the original, single player, pong only had one file and simply dumped the .o files in the root rather than an out folder. I guess I forgot to delete it when I made the change.

twiddlingbits commented 5 days ago

I think it's fine for smaller projects to put the .o files in the project root.

in some examples that had more files, i started to use an outfolder for the build artifacts. I think we (or at least me) have been inconsistent in the use of an outfolders. For example, we have: .o files, .js files, .wasm files. Some are temporary, some are needed to execute the final build. For the ones that need to execute the final build, i try to check them in to main (so that examples can be run. ). But i doubt i/we have been consistant on that. Currently we are committing some out/.js and some .wasm (not in out) to main. We should probably clean up all the examples to be consistent. There are various options, but I think probably the best is to put all build artifacts needed to run the example (.wasm, .js) into the example root, and all the temp build artifacts into out(and then outcan not be committed to main).

What do you think?

JohnDog3112 commented 4 days ago

That sounds good. Though, I feel like out should be called build instead. Out makes me thing "output" which would be better suited for the .wasm and .js files. Meanwhile something like "build" makes more sense for build artifacts and other temporary files.

twiddlingbits commented 4 days ago

My friend ChatGPT say: https://chatgpt.com/c/66fefe05-d62c-800a-89bf-67886fbf187f