I have a small project that requires a few standard libraries, say libpng
and boost
. For now I hope that project can build easily on any of my collaborators machines (OSX/Unix/Linux), but am not concerned packaging or installing it right now. My question is, is there an easy way to write "home-brewed" Makefile
or configure
file that can automatically find and use those libraries on a particular *nix system?
I know Autoconf
and CMake
are tools designed for such tasks, but I and my collaborators do not want to go into the fuss for such a small project, at least not right now.
Another possibility I have in mind is pkg-config
. Is that a recommended approach? I currently have two problems with that: (1) it cannot find all libraries, (say boost
, discussed here, here and here), and (2) not all system seems to have installed pkg-config
.
The solution I hope to have ishave in mind is to write a Makefile
that looks like below.
INCpng = $(shell command retrieves "-I/path/to/png.h")
LIBpng = $(shell command retrieves "-L/path/to/libpng.so -lpng")
INCboost = $(shell command retrieves "-I/path/to/boost")
LIBpng = $(shell command retrieves "-L/path/to/libboost.so -lboost")
SomeFile: SomeFile.cc
$(CXX) $(CXXFLAGS) $(INCpng) $(INCboost) $(LIBpng) $(LIBboost) -o $@ $<
I'm also open to write a not-to-complicated configure
file.