Posted on 2010-01-22 15:38
Prayer 阅读(386)
评论(0) 编辑 收藏 引用 所属分类:
makefile
DB2 = db2
CC = cc
CFLAGS = -O
IP1 = /ZDZ_UAT/usr/sqllib/include
LP1 = /ZDZ_UAT/usr/sqllib/lib
LIB1 = db2
DATABASE = mydb
USER = 1111
PASSWD = 1111
EXE = myfirst
SQC = myfirst.sqc
CFILE = myfirst.c
BND = myfirst.bnd
OBJ = myfirst.o
all : $(EXE)
$(EXE) : $(OBJ)
$(CC) $(CFLAGS) -L$(LP1) $(OBJ) -o $@ -l$(LIB1);
$(OBJ) : $(CFILE)
$(CC) -g -c $(CFLAGS) -I$(IP1) $(CFILE)
$(CFILE) $(BND) : $(SQC)
$(DB2) connect to $(DATABASE) user $(USER) using $(PASSWD) ;\
$(DB2) prep $(SQC) bindfile ;\
$(DB2) bind $(BND); \
$(DB2) connect reset
clean :
rm $(CFILE) $(BND) $(OBJ) $(EXE)