A single, simple makefile for pro*c and any version of Oracle

I've found it easiest to just include the sample makefile included in the precompiler directory and use the symbolic in there to link with. For example, by including the proc sample .mk file, I can simply use " -L$(ORACLE_HOME)/lib $(PROLDLIBS)" in my link line to get the right oracle libs, regardless of version.

This is a makefile template I use alot. I set up the symbolics:

TARGET = name of program I want to create
SOURCE = list of .pc files I need to precompile/compile
PROC_ENV_FLAGS = any settings I want to override at make time for ProC
CC_ENV_FLAGS = any setting I want to override at make time for CC
$(TARGET): $(SOURCE) $(SOURCE:.pc=.c) $(SOURCE:.pc=.o)
    $(CC) $(LDFLAGS) -t -o $(TARGET) \
        $(SOURCE:.pc=.o) -L$(ORACLE_HOME)/lib $(PROLDLIBS)
 
include $(ORACLE_PROC_MAKEFILE)
 
PROCFLAGS= ireclen=255 lines=yes $(PROC_ENV_FLAGS) \
           include=$(ORACLE_HOME)/proc/lib
PROFLAGS=$(PROCFLAGS)
 
CFLAGS=-I. -g $(CC_ENV_FLAGS)

 

With the exception that the makefile has been renamed/moved from version to version (hence the symbolic ORACLE_PROC_MAKEFILE), this makefile works with 7.x and 8.x. The various settings for the oracle_proc_makefile would be:

o70: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o71: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o72: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o73: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/proc.mk
o8 : setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/demo_proc.mk

All information and materials provided here are provided "as-is"; Oracle disclaims all express and implied warranties, including, the implied warranties of merchantability or fitness for a particular use. Oracle shall not be liable for any damages, including, direct, indirect, incidental, special or consequential damages for loss of profits, revenue, data or data use, incurred by you or any third party in connection with the use of this information or these materials.