2

I have downloaded the source code from git for some third-party libraries, which contains a makefile, and so I have run make to compile the libraries. During compilation, this seems to add various libraries to directories such as /usr/bin. My questions is: now that I have compiled the code and the libraries have been written to other locations on my machine, can I delete the original folder with the source code in? Or will I still need this to run these libraries?

Karnivaurus
  • 22,823
  • 57
  • 147
  • 247
  • Have you compiled the code being `root` user? If no (why would you need it?) then unlikely the compilation process puts anything in system directories like `/usr/bin`, it simply doesn't have enough permissions for that. – user3159253 Oct 23 '14 at 11:44
  • And no, usually compiled libraries don't need sources – user3159253 Oct 23 '14 at 11:44
  • I did not compile using `root`. In this case, where will it write the library files to? – Karnivaurus Oct 23 '14 at 12:25
  • Then all compile artifacts (executables, libraries, object files) are _usually_ placed just within the source directory. Try to run `git status` and see what files in the source directory are _not_ under `git` control. Usually those files are compile artifacts – user3159253 Oct 23 '14 at 20:15

1 Answers1

3

Generally, a source code installation need 3 steps: ./configure; make; make install

make install will copy the compiled out binaries and libraries to target system directories. After that, removing the source code folder will not impact the binaries and libraries execution since they have been deployed on your system.

Qiu Yangfan
  • 871
  • 11
  • 25
  • Sometimes you need to be root for `make install`. A common trick is to `make install DESTDIR=/tmp/instdir` then copy (as root) `/tmp/instdir/` to the appropriate destination. – Basile Starynkevitch Oct 23 '14 at 14:15