alxhoff / STM32-uGFX-Cmake

CMake project for a STM32F4 (easily modified for other chip series) using uGFX (optional)
GNU General Public License v3.0
1 stars 2 forks source link

Update/Create Make Targets for clean/clean_lib #7

Closed PhilippvK closed 4 years ago

PhilippvK commented 4 years ago

Beside a small documentation fix this should implement 2 features:

  1. remove *.bin file on make clean
  2. add clean_lib target to remove downloaded libraries.

I do not see any reason in cleaning Cmake-related files, too.

I am unfortunately very dissatisfied with both of my implementation and as I was not able to find ways to implement the features properly.

here is a list of things, that should actually be improved:

alxhoff commented 4 years ago

I would say that a clean that removes the cmake related files is relevant. I commonly stumble across weird build problems because my cmake cache is being weird and throwing errors. Not a standard make clean which should just remove object files and binaries to force a complete recompile etc but something like clean all. I would do a clean hierarchy like all->lib->standard clean.

PhilippvK commented 4 years ago

@alxhoff The problem is that I do not get the Hierarchy set up because I can not create a dependency on the clean target. Try it out yourself and you will see...

alxhoff commented 4 years ago

@PhilippvK i'll give it a shot now

alxhoff commented 4 years ago

@PhilippvK also why is the second executable required?

PhilippvK commented 4 years ago

I explained it above. It makes make clean also remove the BIN file. But this way of doing this is meh. set(ADDITIONAL_CLEAN_FILES ...) would be better but it did not work for me

alxhoff commented 4 years ago

@PhilippvK I solved the issues with a few things.

The flash target now manually removes the .bin after flashing such that we don't build a second binary. Also clean dependencies are tricky as you can run into problems where you remove the cmake file the clean target actually calls, see this post. I also made use of git to implement clean_cmake and clean_all, clean all removes libs.

alxhoff commented 4 years ago

ops

PhilippvK commented 4 years ago

I just wanted to let you know that you have used the -f Parameter two times in line 142 of your CmakeList.txt @alxhoff

alxhoff commented 4 years ago

@PhilippvK 142 isn't valid

alxhoff commented 4 years ago

@PhilippvK the cmake clean shouldn't need a second -f, see this

PhilippvK commented 4 years ago

Sorry, i am at my mobile phone and was not able to annotate the code.

This is what I ment: COMMAND git clean -d ${PROJECT_SOURCE_DIR} -f -f -x

alxhoff commented 4 years ago

ahh yes I already had a second -f on the root dir to remove the lib repos

PhilippvK commented 4 years ago

Ahh I thought it was a typo that you used a second one. Sorry my fault, I do understand now.

alxhoff commented 4 years ago

No worries. Double options are a very rare thing.