简体   繁体   中英

./configure set Makefile name

if I run ./configure , it automatically creates a Makefile called "Makefile". However, in the folder where i invoke ./configure , there is already a Makefile (it is my "main"-Makefile). Is it somehow possible, to tell ./configure that it should create the Makefile with a different name (eq Makefile.1)?

I know, that I could move my "main"-Makefile to a different folder, but I want to avoid that, if it's possible.

Thanks for your help!

Rename your Makefile.in to Makefile.1.in and list

AC_CONFIG_FILES([
  Makefile.1
  ... other stuff ...
])

in your configure.ac (and run autoreconf ). If you're using automake, rename your Makefile.am to Makefile.1.am instead of renaming the generated Makefile.in .

Even if you don't want to move your main Makefile, you still could rename it into "GNUmakefile", which takes precedence over "Makefile".

That is, invoking make in the project directory will execute the GNUmakefile, which in turn would probably hook into a generated one through make -f Makefile .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM