autotools: force make not to rebuild configure/Makefile

后端 未结 3 1790
不思量自难忘°
不思量自难忘° 2020-12-31 18:24

I have a project with autotools: automake, autoconf.

I want to prohibit make from remaking files configure, Makefile.in, etc;

3条回答
  •  自闭症患者
    2020-12-31 19:14

    First of all, if you edit a generated file directly, it wouldn't be rebuilt anyway, because it is then newer then its prerequisites.

    Then, there are two separate things going on here: config.status and Makefile are created during the build. It's hard to prevent these from being remade during the build unless you make their timestamps newer.

    The other files are generated by the various autotools. Recent versions of Automake do not create rules by default that remake them automatically. Depending on your package, you might want to use the configure option --disable-maintainer-mode. The Automake documentation contains some more interesting information about that option.

    One trick I sometimes use with a package that I don't know much about or that has a pretty messed up build system is to run something like

    make all AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:
    

    so that if these programs happen to be called, a noop would be substituted.

提交回复
热议问题