Closed ryanmjacobs closed 9 years ago
Could you please clarify the footprint file idea? Is it something like creating a list of installed files during the execution of make install
, then looping through that in make uninstall
?
Exactly. A list of fully qualified file paths stored somewhere. That's how many package managers work as well. Heck, might even be able to get away with just caching $(INSTALL_PATH). The trick is to automatically generate the footprint file every time.
Okay, make install
generates a footprint file on each install (and make uninstall
uses that footprint file to uninstall). I'm not sure if this is the best way to implement it, but I don't know any other way other than using a more complex shell script.
Still, I think there is yet a better way.
I took a crack at it. Tell me what you think [https://github.com/lpsantil/rt0/commit/5362f689f30aadea7c5907ac9ac6925cc6c3ccd6].
lpsantil@host:~/build/rt0$ DEST=. PREFIX=out make install
mkdir -p ./out/include/rt0 ./out/lib
rm -f .footprint
‘include/rt0/rt0.h’ -> ‘./out/include/rt0/rt0.h’
‘include/rt0/syscall.h’ -> ‘./out/include/rt0/syscall.h’
‘lib/librt0.a’ -> ‘./out/lib/librt0.a’
lpsantil@host:~/build/rt0$ cat .footprint && tree out/
./out/include/rt0/rt0.h
./out/include/rt0/syscall.h
./out/lib/librt0.a
out/
├── include
│ └── rt0
│ ├── rt0.h
│ └── syscall.h
└── lib
└── librt0.a
3 directories, 3 files
lpsantil@host:~/build/rt0$ make uninstall
removed ‘./out/include/rt0/rt0.h’
removed ‘./out/include/rt0/syscall.h’
removed ‘./out/lib/librt0.a’
Thanks, that looks much better than what I had.
I like the idea of adding
make uninstall
, but I feelmake install
ought to create a footprint file and thenmake uninstall
should use that to dorm
.