当前位置: 技术问答>linux和unix
询问一个关于unix下makefile的问题,请给我解释一下我这份makefile的内容的含义,谢谢
来源: 互联网 发布时间:2015-07-08
本文导语: # Make the Embedded SQL/C sample programs. # # Change the following definitions as appropriate for your site: # SYBASE = /usr/sybase SHELL = /bin/sh INCLUDE = -I. -I$(SYBASE)/include -I../include MYLIBDIR = ../lib/ LIBFLAGS = -L$(SYBA...
# Make the Embedded SQL/C sample programs.
#
# Change the following definitions as appropriate for your site:
#
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
all: $(BIN)abcsrv $(BIN)abcvoid $(BIN)abcprg $(BIN)poskey
$(BIN)abcsrv: abcsrv.c crdcns.c refund.c calcns.c voidfu.c qryacc.c qrybal.c qryhmd.c dwnpar.c settprg.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcvoid: abcvoid.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcprg: abcprg.c secsett.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)poskey: poskey.c sybmain.c abctool.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS) -lwapp -lcurses
mv *.o ../obj
abcvoid.c: abcvoid.cp
$(PRECOMP) abcvoid.cp
abcprg.c: abcprg.cp
$(PRECOMP) abcprg.cp
poskey.c: poskey.cp
$(PRECOMP) poskey.cp
sybmain.c: sybmain.cp
$(PRECOMP) sybmain.cp
#
# Change the following definitions as appropriate for your site:
#
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
all: $(BIN)abcsrv $(BIN)abcvoid $(BIN)abcprg $(BIN)poskey
$(BIN)abcsrv: abcsrv.c crdcns.c refund.c calcns.c voidfu.c qryacc.c qrybal.c qryhmd.c dwnpar.c settprg.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcvoid: abcvoid.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcprg: abcprg.c secsett.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)poskey: poskey.c sybmain.c abctool.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS) -lwapp -lcurses
mv *.o ../obj
abcvoid.c: abcvoid.cp
$(PRECOMP) abcvoid.cp
abcprg.c: abcprg.cp
$(PRECOMP) abcprg.cp
poskey.c: poskey.cp
$(PRECOMP) poskey.cp
sybmain.c: sybmain.cp
$(PRECOMP) sybmain.cp
|
#定义变量
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
#制定要连接的库
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
#生成的目标
all: $(BIN)abcsrv $(BIN)abcvoid $(BIN)abcprg $(BIN)poskey
#abcsrv 所需要的所有 .c 文件
$(BIN)abcsrv: abcsrv.c crdcns.c refund.c calcns.c voidfu.c qryacc.c qrybal.c qryhmd.c dwnpar.c settprg.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcvoid: abcvoid.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcprg: abcprg.c secsett.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)poskey: poskey.c sybmain.c abctool.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS) -lwapp -lcurses
mv *.o ../obj
abcvoid.c: abcvoid.cp
$(PRECOMP) abcvoid.cp
abcprg.c: abcprg.cp
$(PRECOMP) abcprg.cp
poskey.c: poskey.cp
$(PRECOMP) poskey.cp
sybmain.c: sybmain.cp
$(PRECOMP) sybmain.cp
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
#制定要连接的库
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
#生成的目标
all: $(BIN)abcsrv $(BIN)abcvoid $(BIN)abcprg $(BIN)poskey
#abcsrv 所需要的所有 .c 文件
$(BIN)abcsrv: abcsrv.c crdcns.c refund.c calcns.c voidfu.c qryacc.c qrybal.c qryhmd.c dwnpar.c settprg.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcvoid: abcvoid.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)abcprg: abcprg.c secsett.c sybmain.c abctool.c tcpsend.c 8583.c iso8583.c macprg.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS)
mv *.o ../obj
$(BIN)poskey: poskey.c sybmain.c abctool.c
$(LINK.c) -o $@ -dy $? $(SYBLIBS) -lwapp -lcurses
mv *.o ../obj
abcvoid.c: abcvoid.cp
$(PRECOMP) abcvoid.cp
abcprg.c: abcprg.cp
$(PRECOMP) abcprg.cp
poskey.c: poskey.cp
$(PRECOMP) poskey.cp
sybmain.c: sybmain.cp
$(PRECOMP) sybmain.cp
|
建议先看看关于Makefile的文章.
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
这些是定义标号变量.
后面都是定义目标的生成途径,包括源文件及编译指令等.
...
目标文件:源文件
运行指令.
注意命令前的'TAB'键.
.cp先预编译成.c
SYBASE = /usr/sybase
SHELL = /bin/sh
INCLUDE = -I. -I$(SYBASE)/include -I../include
MYLIBDIR = ../lib/
LIBFLAGS = -L$(SYBASE)/lib -L/usr/lib -L$(MYLIBDIR)
SYBLIBDIR = $(SYBASE)/lib/
PRECOMP = $(SYBASE)/bin/cpre
LINK.c = cc $(INCLUDE) $(LIBFLAGS)
BIN = ../../bin/
SYBLIBS = -lct -lcs -lcomn -ltcl -lintl -lm -lnsl_s -lsocket -ltli -lnsl -lsybdb -lpublic ../lib/safe.a ../lib/public.a
这些是定义标号变量.
后面都是定义目标的生成途径,包括源文件及编译指令等.
...
目标文件:源文件
运行指令.
注意命令前的'TAB'键.
.cp先预编译成.c
|
1. 准确的说应该是宏名而不是变量名
MACRONAME = value
可以通过$(MACRONAME)或者${MACRONAME}来访问;
2. 主体
target(目标名): dependences(若干依赖关系:依赖的目标,或依赖的文件等)
rules(执行规则)
:
:
3. 递推下去
MACRONAME = value
可以通过$(MACRONAME)或者${MACRONAME}来访问;
2. 主体
target(目标名): dependences(若干依赖关系:依赖的目标,或依赖的文件等)
rules(执行规则)
:
:
3. 递推下去
|
调用Cpre把.cp转换成.c
就和yacc一样的道理
就和yacc一样的道理
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。