[英]How to Compile Single C file in Vim using Makefile Generated by Autotools
If in my Makefile.am, I have a set of hypothetically named sources: 如果在我的Makefile.am中,则有一组假设命名的源:
lib_LTLIBRARIES = libmy_tutorial.la
libmy_tutorial_la_SOURCES = \
jump_table.h jump_table.c \
core.h core.c \
my_dynapi.c
bin_PROGRAMS = main
main_SOURCES = main.c
main_LDADD = libmy_tutorial.la
CLEANFILES = *.o
and I am in Vim. 我在Vim。 Is there a way to call :make
on a single target if my Makefile is generated from the Makefile.am above. 如果我的Makefile是从上面的Makefile.am生成的,是否:make
在单个目标上调用:make
。
For example: 例如:
:make main.o
would compile only main.c from bin_PROGRAMS? 只能从bin_PROGRAMS编译main.c吗?
Just as if I had run: 就像我跑过一样:
gcc -c -o main.o $(CFLAGS) $(CPPFLAGS) main.c
Since you're using Libtool, your targets are .lo
files instead of .o
files. 由于您使用的是Libtool,因此目标是.lo
文件而不是.o
文件。 Call make main.lo
, or make libmy_tutorial_la-main.lo
if you're using per-target CFLAGS
. 如果使用按目标的CFLAGS
,请调用make main.lo
或make libmy_tutorial_la-main.lo
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.