tracy icon indicating copy to clipboard operation
tracy copied to clipboard

Tracy unix library doesn't remove libtracy-*.so on `make clean`

Open mgoin opened this issue 4 years ago • 1 comments

Hi there,

When building the Tracy library on a unix machine the make clean command does not remove all of the files I expect, notably libtracy-[target].so.

Based on the command used from the make clean of rm -rf obj/ libtracy-.so*, I believe the fix is to either pass the target into the .so name or move the wildcard such that it reads like rm -rf obj/ libtracy-*.so

Here is my flow to reproduce. This is on the v0.8 tag.

> pwd                                                                              
/home/user/tracy/library/unix

> ls
build.mk  debug.mk  Makefile  release.mk

> make release
make[1]: Entering directory '/home/user/tracy/library/unix'
Resolving dependencies of ../../TracyClient.cpp
g++ -c  -O3 -s -msse4.1 -std=c++11 -fpic -DNDEBUG -DTRACY_ENABLE ../../TracyClient.cpp -o obj/release/o/o/o/../../TracyClient.o
g++ -O3 -s -msse4.1 -std=c++11 -fpic  -DNDEBUG -DTRACY_ENABLE obj/release/o/o/o/../../TracyClient.o   -lpthread -ldl -ltbb -shared -o libtracy-release.so
make[1]: Leaving directory '/home/user/tracy/library/unix'

> ls
build.mk  debug.mk  libtracy-release.so  Makefile  obj  release.mk

> make clean  
make[1]: Entering directory '/home/user/tracy/library/unix'
rm -rf obj/ libtracy-.so*
make[1]: Leaving directory '/home/user/tracy/library/unix'

> ls
build.mk  debug.mk  libtracy-release.so  Makefile  release.mk

Including the build target i.e. make release clean just cleans the files and builds the release target normally. I am able to unblock my flow by manually removing the libtracy-release.so in my build clean.

Thanks for any help!

mgoin avatar Apr 19 '22 20:04 mgoin

The root cause for this is 7bc8c628, where the clean target was incorrectly generalized. While in most cases the clean rule is rm -rf $(OBJDIRBASE) $(IMAGE)*, in case of the library it is instead rm -rf $(OBJDIRBASE) $(PROJECT)*.so, which must have been overlooked when the change was made.

wolfpld avatar Apr 26 '22 20:04 wolfpld

Fixed in cade1d9705.

wolfpld avatar May 01 '23 16:05 wolfpld