我想按F10键时对当前C源代码进行编译,例如,文件名为XXX.c的源文件怎么写配置文件,使得按F10键后执行这个命令?
gcc -o xxx -g xxx.c
如何让emacs自动编译?
-
- 帖子: 9
- 注册时间: 2009-07-28 20:00
-
- 帖子: 109
- 注册时间: 2009-12-06 21:23
Re: 如何让emacs自动编译?
A general method with *nix flavor:
1. write a Makefile in the source directory like
2. M-x compile (I alias it to M-x cpl, or you can alias it to F10)
M-x compile will (1)run make Makefile, (2)parse the information by gcc and re-fontify it.
1. write a Makefile in the source directory like
代码: 全选
xxx: xxx.c
gcc -o xxx -g xxx.c
M-x compile will (1)run make Makefile, (2)parse the information by gcc and re-fontify it.