自作でもいいが、autotools(automake/autoconf)あたりがおすすめ