user-0 提问: makefile  公共源文件指针链接

回复:
user: user-1
content: 搜“跟我一起写makefile”

user: user-1
content: 但9楼内容中无Tab字符。

user: user-0
content: 引用 10 楼 zhao4zhong1 的回复:提醒：makefile里面的Tab字符必须是真的TAb字符而不能用空格代替。 这个我是真知道

user: user-1
content: 提醒：makefile里面的Tab字符必须是真的TAb字符而不能用空格代替。

user: user-0
content: 引用 3 楼 zhao4zhong1 的回复:会建立目录链接吗？ OBJS:= foo.o bar.o main.o SRC := foo.c bar.c main.c TARGET:=ok.exe $(TARGET):$(OBJS) 	gcc -Wall -o $@ $^ main.o:main.c foo.h bar.h 	gcc -Wall -g-O2 -c $< -o $@  foo.o:foo.h foo.c 	gcc -Wall -g-O2 -c $< -o $@ bar.o:bar.c bar.h 	gcc -Wall -g-O2 -c $< -o $@  .PHONY :all all: $(TARGET)  您看我的makefile有问题吗？总是报错 gcc -Wall -o ok.exe foo.o bar.o main.o foo.o: file not recognized: File format not recognized collect2: ld returned 1 exit status make: *** [ok.exe] Error 1

user: user-1
content: includes和/include不是一回事！  关于自己是否适合编程的很简单的测试： 在报纸或杂志上随便找一段约1000字的文章，在Word中输入一遍。输完后再参考下面答案：  A里面有10处以上文字或标点错误 B里面没有文字或标点错误并敢为此跟人打赌 C里面没有文字或标点错误并且字体和排版完全与原稿一致 D打印在半透明的纸上和原稿重叠在一起检查一模一样，且自我感觉很有成就感  A不适合编程（理由：打字准确度偏低、粗心大意） B初级程序员（理由：打字准确度很高、认真细致、自信、理解全角半角概念） C高级程序员（理由：在B的基础上理解字体和排版也是电脑打印的重要因素、但相比D还不够偏执、精益求精、结果可验证） D软件项目经理（理由：能针对项目给出令人信服的细致到极点的需求说明和典型测试用例。用户几乎挑不出毛病。专业！）  如果想从A变成B的话，到我的资源http://download.csdn.net/detail/zhao4zhong1/4084259里面下载“适合程序员的键盘练习”

user: user-0
content: 引用 13 楼 zhao4zhong1 的回复:搜“跟我一起写makefile” INC :=-I./../../includes/ FLAGS := -W -Wall -ggdb #OBJS:= main.o  bar.o  SRC := foo.c bar.c main.c #SRC :=  bar.c main.c TARGET:=ok.exe $(TARGET):$(OBJS) 	gcc -W -Wall -ggdb $(INC)  $^ -o $@ main.o:main.c bar.h foo.h 	gcc -c -W -Wall -ggdb  $(INC)  $<  -o $@  我的这个INC有问题吗？为什么 总是找不到源文件呢

user: user-1
content: 会建立目录链接吗？

user: user-0
content: 引用 1 楼 nanali2088 的回复:|-->Include-->|-->*.h |                     |-->…… |-->Commom-->|-->C1.c |                          |-->C2.c |             |-->H-->|-->CR-->|-->main.c                              |-->Commom-->|-->C1.c  红色部分代码并不是实际存在的，而是通过链接到上一级的common文件夹得到的。怎么实现呢？

user: user-0
content: |-->Include-->|-->*.h |                     |-->…… |-->Commom-->|-->C1.c |                          |-->C2.c |             |-->H-->|-->CR-->|-->main.c                              |-->Commom-->|-->C1.c

user: user-1
content: 引用 7 楼 nanali2088 的回复:[quote=引用 6 楼 zhao4zhong1 的回复:] C:\>linkd /? Links an NTFS directory to a target valid object name in Windows 2000.  LINKD Source [/D] Destination    Source             - Displays the Windows 2000 name targeted by Source    Source Destination - Links source directory to Destination directory or a                        Windows 2000 device or any valid Windows 2000 name    Source /D          - Deletes Source, regardless of whether a link exists at                        source    /?                 - Prints this help message  LINKD grafts (links) the target name directly into the name space at Source, so that Source subsequently acts as a name space junction. The Source directory must reside on a disk formatted with NTFS in Windows 2000. The destination (the target of the link) can be any valid directory name or device name or valid object name in Windows 2000. When the target name does not resolve to a directory or a device, open calls fail.  All characters in both the Source and Destination names must be in the ASCII character set. Usage of arbitrary Unicode characters is not supported.  Type "LINKD /? | more" if you need to see all the help text  C:\>junction /?  Junction v1.06 - Windows junction creator and reparse point viewer Copyright (C) 2000-2010 Mark Russinovich Sysinternals - www.sysinternals.com  The first usage is for displaying reparse point information, the second usage is for creating a junction point, and the last for deleting a junction point: usage: junction [-s] [-q] <file or directory>        -q     Don't print error messages (quiet)        -s     Recurse subdirectories  usage: junction <junction directory> <junction target>        example: junction d:\link c:\windows  usage: junction -d <junction directory>  我用了一个软连接  不知道可不可以 [/quote] 一回事

user: user-0
content: 引用 6 楼 zhao4zhong1 的回复:C:\>linkd /? Links an NTFS directory to a target valid object name in Windows 2000.  LINKD Source [/D] Destination    Source             - Displays the Windows 2000 name targeted by Source    Source Destination - Links source directory to Destination directory or a                        Windows 2000 device or any valid Windows 2000 name    Source /D          - Deletes Source, regardless of whether a link exists at                        source    /?                 - Prints this help message  LINKD grafts (links) the target name directly into the name space at Source, so that Source subsequently acts as a name space junction. The Source directory must reside on a disk formatted with NTFS in Windows 2000. The destination (the target of the link) can be any valid directory name or device name or valid object name in Windows 2000. When the target name does not resolve to a directory or a device, open calls fail.  All characters in both the Source and Destination names must be in the ASCII character set. Usage of arbitrary Unicode characters is not supported.  Type "LINKD /? | more" if you need to see all the help text  C:\>junction /?  Junction v1.06 - Windows junction creator and reparse point viewer Copyright (C) 2000-2010 Mark Russinovich Sysinternals - www.sysinternals.com  The first usage is for displaying reparse point information, the second usage is for creating a junction point, and the last for deleting a junction point: usage: junction [-s] [-q] <file or directory>        -q     Don't print error messages (quiet)        -s     Recurse subdirectories  usage: junction <junction directory> <junction target>        example: junction d:\link c:\windows  usage: junction -d <junction directory>  我用了一个软连接  不知道可不可以

user: user-1
content: C:\>linkd /? Links an NTFS directory to a target valid object name in Windows 2000.  LINKD Source [/D] Destination    Source             - Displays the Windows 2000 name targeted by Source    Source Destination - Links source directory to Destination directory or a                        Windows 2000 device or any valid Windows 2000 name    Source /D          - Deletes Source, regardless of whether a link exists at                        source    /?                 - Prints this help message  LINKD grafts (links) the target name directly into the name space at Source, so that Source subsequently acts as a name space junction. The Source directory must reside on a disk formatted with NTFS in Windows 2000. The destination (the target of the link) can be any valid directory name or device name or valid object name in Windows 2000. When the target name does not resolve to a directory or a device, open calls fail.  All characters in both the Source and Destination names must be in the ASCII character set. Usage of arbitrary Unicode characters is not supported.  Type "LINKD /? | more" if you need to see all the help text  C:\>junction /?  Junction v1.06 - Windows junction creator and reparse point viewer Copyright (C) 2000-2010 Mark Russinovich Sysinternals - www.sysinternals.com  The first usage is for displaying reparse point information, the second usage is for creating a junction point, and the last for deleting a junction point: usage: junction [-s] [-q] <file or directory>        -q     Don't print error messages (quiet)        -s     Recurse subdirectories  usage: junction <junction directory> <junction target>        example: junction d:\link c:\windows  usage: junction -d <junction directory>

user: user-2
content: 没看懂你的意思。common是公共代码，编译成一个库不就完了

user: user-0
content: 引用 3 楼 zhao4zhong1 的回复:会建立目录链接吗？ 我没能明白意义啊？可否详细一点？