编译pro*c 的makefile例子
原来只需在makefile中追加include $(ORACLE_HOME)/precomp/lib/env_precomp.mk,其他一切按照makefile的书写规则即可,CODE也是需要指定的,尤其Oracle缺省并不是ansi_c
以下是sample:
include $(ORACLE_HOME)/precomp/lib/env_precomp.mk
LIBDIR=lib32
CC = /opt/SUNWspro/bin/cc
CFLAGS= -c -g
OCFLAGS= code=ansi_c line=yes sqlcheck=semantics
TARGET= test
OBJS= test.o
.SUFFIXES: .pc .c .o
$(TARGET): $(OBJS)
$(CC) -o [email protected] $(OBJS) -L$(LIBHOME) $(PROLDLIBS)
.pc.c:
$(PROC) $(ORADEF) $(PROCFLAGS) iname=$*
.pc.o:
$(PROC) $(ORADEF) $(PROCFLAGS) iname=$* $(ORADEF)
$(CC) $(CFLAGS) $*.c
.c.o:
$(CC) $(CFLAGS) $*.c
clean :
$(RM) -f $(TARGET) $(OBJS) $(TARGET:%=%.c)
———————————————————————————————————————————————————————————————————————————————
时间: 2024-10-06 10:02:52