Posted on 2010-01-21 23:19
Prayer 阅读(1542)
评论(0) 编辑 收藏 引用 所属分类:
C/C++ 、
DB2 、
makefile
GCC=gcc
CC=gcc
DB2PATH=/××××/××××/sqllib
CCFLAGS=-g
CFLAGS= -I$(DB2PATH)/include
LIBS= -L $(DB2PATH)/lib -ldb2
UID=XXXX
PWD=XXX
DB=XXX
BILLHOME=.
BILLBIN=.
BILLSRC=$(BILLHOME)
BILLOBJ=$(BILLHOME)
BILLLIB=../lib
INCLUDE=-I. -I$(BILLHOME)/src -I$(BILLLIB) \
-I$(DB2PATH)/include \
-I/usr/lib -I/usr/local/include \
-I/usr/include
TARGET1 = $(BILLBIN)/test
all(TARGET1)
.sqc.o:
db2 connect to $(DB) user $(UID) using $(PWD);\
db2 prep $*.sqc bindfile;\
db2 bind $*.bnd;\
db2 connect reset;\
$(CC) $(INCLUDE) -o $*.o -c $(CCFLAGS) $(CFLAGS) $(DEFS) $*.c ;
.c.o:
$(CC) $ (INCLUDE) -o $*.o -c $(CCFLAGS) $(CFLAGS) $(LIBS) $(DEFS) $*.c --def \standard.def
PICK_OBJS1= $(BILLSRC)/test.o
$(BILLBIN)/test: $(PICK_OBJS1)
$(CC) $(CFLAGS) -o $(TARGET1) $(PICK_OBJS1) $(ORACLE_LIB)$(LINKFLAG) $(LIBS)
clean:
rm -f *.o $(TARGET1) test.c test.o test.bnd