Closed auxym closed 2 years ago
I do not see the purpose of the setup
command, could you elaborate what it'd solve, the gitignore sounds fine though.
Right, so situation:
piconim build
runs make
in the csource/build
directory and will therefore fail.The proposed setup command would initialize csouce/build by running cmake, which is what init
does currently.
The alternative would be to have piconim build
run cmake each time. The problem I see with that is that you'd have to provide it with your pico SDK path each time you build, which can get annoying.
Ah I see, sounds fine to me then.
Now that I think about it though, could we not just emit a .gitignore
in the directory when we copy?
I'm not sure I understand, could you elaborate on that? What would be the contents of the .gitignore file in that proposition?
I suppose we can store the piconim init
arguments in a file, but without the csource
, the only place to put them is in the project directory, which I wouldn't much like. So I suppose for this use case, the setup
command sounds like the best option.
Well, we don't want to store the init
arguments, because init
is run exactly one when the project is created. Imagine the following use case:
/home/francis/...
).Thus, my proposed setup
command would allow the other person to set the SDK path for their build, and in the future other machine-specific options (sort of similar to "configure" scripts in good old C/make land).
Now, here, I proposed to also have setup
run cmake, but given #33 I think the idea is to have build
run cmake, since we would be dynamically modifying CMakeLists.txt (I propose generating an included file) on build.
I don't think we need or should ignore the full csource
dir btw, only csource/build
and some selective wildcards for generated files in csource (*.c
, *.json
). This would allow a developer to customize their CMakeLists.txt file and and keep it around. It just needs to include some files that are dynamically generated by piconim (calling the peripheral modules, etc).
I see what your getting at. Let me just chime in now and mention that I am a novice programmer, and most of my experience is in Nim and I know next nothing about writing and building programs in C. @beef331 seems to know a lot more than me haha. I created the piconim
program by looking at the manual steps that we previously had to perform manually and automated it as best I could. It is clear now that I may not have been using the best practices when it comes to cmake
. So I guess I would encourage you to take a look and see if you can improve upon it? and while your at it, make a setup
command, lol.
I am also happy to try to implement it myself, if you provided some brief pseudo code to go off (since I am not experienced in building for C)
OK, I'll put in a PR as a proposal. Just waiting for @beef331 to clarify his previous comment.
You've sold me on the need for this, so seems fine, we can always change or remove features later if they're actually pointless.
Closed via #36
Current situation:
piconim init
does not contain a .gitignore filecsource/build
directory cannot be added to .gitignore, because it contains the Makefile, which is generated by cmake duringpiconim init
. Thus,piconim build
would fail on a fresh/clean repository.Proposal:
setup
(orconfigure
, orinit
and rename the currentinit
tocreate
) command that runscmake
with the SDK path provided as an optional argument. This is automatically run duringinit
csource/build
directory as well ascsource/*.c
.piconim init
, runpiconim setup
(optionally providing as SDK path), and build it withpiconim build
.If the maintainers agree with the idea, I could put in a PR.