autotools: force make not to rebuild configure/Makefile

后端 未结 3 1801
不思量自难忘°
不思量自难忘° 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:00

    Try to explicitly tell make those files should not be remade, via command-line

    $ make -o configure -o Makefile.in
    

    or by using MAKEFLAGS

    $ MAKEFLAGS="-o configure -o Makefile.in" make
    

    The excerpt from GNU make's manual

    ‘-o file’
    ‘--old-file=file’
    ‘--assume-old=file’
    Do not remake the file file even if it is older than its prerequisites, and do not remake
    anything on account of changes in file. Essentially the file is treated as very old and
    its rules are ignored. See Avoiding Recompilation of Some Files.
    

    If yours autotools template correctly uses $(MAKE) for subdirs, there should be no problems.

提交回复
热议问题