03/05/19 21:08.net
解説ページとかを参考にして、
-- unyalibのMakefile.am ------
SUBDIRS = subDirA subDirB
noinst_LIBRARIES = libunyalib.a
libunyalib_a_SOURCES = unya.c honya.c
-- subDirAのMakefile.am ----
noinst_LIBRARIES _ libunyalib.a
libunyalib_a_SOURCES =
libunyalib_a_LIBADD = unya_a.c honya_a.c
-- subDirBもsubDirAと同じように"LIBADD"を使用 ----
とかいうように、書いてautomakeを動かしてみました。
でも、結果としてのMakefile.inは、どのディレクトリのものでも
unyalib.a: $(unyalib_a_OBJECTS) $(unyalib_a_DEPENDENCIES)
-rm -f unyalib.a
$(AR) cru unyalib.a $(unyalib_a_OBJECTS) $(unyalib_a_LIBADD)
$(RANLIB) unyalib.a
と、ar の前に必ずrm が実行されて、一つのライブラリに合体してくれない状態です。
サブディレクトリの方ではrmの実行が挟まれず、一つのライブラリにさせる技は無いでしょうか。