由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - gcc compile option
相关主题
makefile 里面那个-D flags的问题请推荐makefile generator
关于Makefile的一个问题One question in C programming
[合集] MSVS.Net里面怎么才能显示出每一次compile的完全命令?Linux Makefile: How to include cpp files in subfolder for (转载)
Python problem on 64 bit LinuxSolaris CC compiler 如何从pipe读取文件,而不是从硬盘?
ask a question about compile shared library using libtoolopencv为什么不用java写???????
Makefile疑问C array
c++ compiler under unixA C++ compiler related interview question
[合集] 请问-fno-implicit-templates的用处请教 C/C++ 指向多维数组的指针的问题
相关话题的讨论汇总
话题: gcc话题: option话题: compile话题: ouput话题: specify
进入Programming版参与讨论
1 (共1页)
c*******9
发帖数: 6411
1
I try to compile multiple c files, and would like the object files ouptut in
the same directory
gcc -c -o /user/ouput -c *.c
but does not seem to work, is there an option in gcc to specify that?
in visual c++, i can use /fo option to specify a folder for ouput, anything
similar in gcc?
thanks
d****n
发帖数: 1637
2
in Makefile
you can do
obj/%.o: src/%.c
[ Tab here ]gcc $(CFLAGS) -c $? -o $@
also you can do it in linux shell
mkdir -p obj
for i in *c; do gcc -c $i -o obj/`basename $i|sed 's/.c$/.o/g'`;done
1 (共1页)
进入Programming版参与讨论
相关主题
请教 C/C++ 指向多维数组的指针的问题ask a question about compile shared library using libtool
打算装linux搞c++,哪个好 centos? 由本土?Makefile疑问
*** help needed! on MATLAB GUI ***c++ compiler under unix
How to tell gcc stop compiling.[合集] 请问-fno-implicit-templates的用处
makefile 里面那个-D flags的问题请推荐makefile generator
关于Makefile的一个问题One question in C programming
[合集] MSVS.Net里面怎么才能显示出每一次compile的完全命令?Linux Makefile: How to include cpp files in subfolder for (转载)
Python problem on 64 bit LinuxSolaris CC compiler 如何从pipe读取文件,而不是从硬盘?
相关话题的讨论汇总
话题: gcc话题: option话题: compile话题: ouput话题: specify