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