Maschell / dynamic_libs

21 stars 5 forks source link

Add pkg-config support #26

Open ashquarky opened 5 years ago

ashquarky commented 5 years ago

Heyo! Just a few Makefile tweaks to generate a pkg-config file to go with libdynamiclibs.a. pkg-config can make building things a lot simpler - instead of hardcoding paths to portlibs or devkitpro, you can run a command to generate the needed cflags and ldflags for you. For example, here's what my system now does (using devkitpro's pkg-config)

[ash@ash-pizza $] powerpc-eabi-pkg-config dynamic_libs --libs --static
-L/opt/devkitpro/portlibs/ppc/lib -ldynamiclibs
[ash@ash-pizza $] powerpc-eabi-pkg-config dynamic_libs --cflags --static
-I/opt/devkitpro/portlibs/ppc/include/dynamic_libs

You can see how this could be integrated into a Makefile to simplify things quite a bit. pkg-config also handles dependencies, so libraries that need dynamic_libs (like libutils) can pull it in without the user having to explicitly link it.

Thanks again! Ash