MacOS – I installed a library for programming. How to remove it

macosterminal

I installed the g2 graphical library on my mac using the terminal for a school assignment and now that I'm done with it I'd like to know how to remove it. Are there like commands I can run on the terminal? Are all the files in one folder and all I have to do is delete that folder?

I'm very picky when it comes to these things and if I can't delete it I'll probably end up reinstalling the whole OS (I know I'm crazy) so any help is appreciated.

Also if this is not the right place to post this question I'd appreciate it if you could point me in the right direction.

Thank you!

EDIT 1:
I installed the library by following these instructions:

  1. Extract package with gzip -dc g2-xxxx.tar.gz | tar xvf –

  2. Run './configure'

  3. Run 'make depend'

  4. Optionally edit src/g2_config.h to fine-tune g2 behavior (only if
    you know what are you doing)

  5. Run 'make'

  6. Run 'make install' or copy libg2.a and g2.h, g2_X11.h, g2_gd.h, and
    g2_PS.h to the default locations for library and include files.

  7. cd to demo directory and run 'make demo' to compile demo
    applications

  8. To rebuild documentation run 'make doc' (html, PS and pdf manual
    should be already included into documentation).

EDIT 2: I ran the command suggested by @scottishwildcat in his answer below and got the following output:

Makefile:101: warning: overriding commands for target `libg2.so'

Makefile:98: warning: ignoring old commands for target `libg2.so'

make: *** No rule to make target `uninstall'. Stop.

Best Answer

First off, there's likely no harm in leaving the library installed on your system. It doesn't consume any processor or memory resources by itself (though it does take up some small amount of disk storage space).

My assumption is that you've installed the g2 library into default locations. According to the g2 website, the following files were installed:

  • libg2.a (may be called libg2.so or libg2.dylib on your particular flavor of OS)
  • g2.h
  • g2_X11.h
  • g2_GIF.h
  • g2_PS.h

The first file, the executable code, should've been installed into /usr/lib or /usr/local/lib. The rest — header files for development — should've been installed into /usr/include or /usr/local/include. To 'uninstall' the library, just delete the files in the above list from these paths.