我希望Automake在我的业余项目中创建一个.img文件(在虚拟机中测试编译的程序)。
我可以用Automake编写程序,例如:
noinst_PROGRAMS = loader.elf
loader_elf_SOURCES = init.s console.c disk.c elf.c ext2.c fat.c lib.c loader.c multiboot.c
loader_elf_LDFLAGS = $(AM_LDFLAGS) -T $(srcdir)/loader.ld
loader_elf_LDADD = $(LDADD) -lgcc但它不适用于数据文件:
noinst_DATA = x.img
x_img_DEPENDENCIES = loader.elf
x_img_LINK = makeimg.sh当我执行autoreconf -i时,会收到以下错误消息:
automake: warnings are treated as errors
arch/i386/emulator/Makefile.am:14: warning: variable 'x_img_DEPENDENCIES' is defined but no program or
arch/i386/emulator/Makefile.am:14: library has 'x_img' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1我正在尝试将我的Makefile转换成Makefile.am。在Makefile,它就像:
x.img: loader.elf
makeimg.sh $@ $<我在gnu页面上研究了Automake手册,我认为不可能在Automake中的数据文件中添加源或依赖项。我该怎么办?我应该把.img文件放到程序主文件中而不是数据中吗?
我使用Automake 1.16.1和Autoconf 2.69 (如果这很重要)。
发布于 2020-02-20 05:39:29
只需将其添加到Makefile.am中即可
noinst_PROGRAMS = loader.elf
loader_elf_SOURCES = ...
noinst_DATA = x.img
x.img: loader.elf
makeimg.sh x.img loader.elf(我已经将$@和$<更改为使用显式名称,因为显然有一些版本的make在由显式文件名而不是模式或后缀定义的规则中与$@和$<有困难。)
https://stackoverflow.com/questions/58921695
复制相似问题