Re: Problem in compiling Pro*C program.

From: Thomas J Kyte <tkyte_at_us.oracle.com>
Date: 1995/08/18
Message-ID: <412909$dus_at_inet-nntp-gw-1.us.oracle.com>#1/1


sli_at_runner (Sijian Li) wrote:

>Hi Folks,
 

>I am in the Unix(SunOS) environment. I am having trouble compiling my Pro*C
>programs. The Sys Admin didn't send me back any info. Could somebody send me
>a makefile that can compile .pc source code? By the way, I am using Oracle
>7.0.15.4.0
 

>According to the proc.mk on my system, I am supposed to get the executable
>for abc.pc by 'make -f proc.mk abc'.

>Any help will be appreciated.
 

>

Here is what I use. It makes the following assumptions

- all the code needed to make an executable is in the CWD
- all of the code is in .pc files
- you want to name your executable after the CWD's name

So, If I had a subdirectory, ~tkyte/src/prog1 with files a.pc, b.pc, c.pc in it and typed "procmk" in that directory (my shell script below) I would end up with an executable names prog1 and built on the source a, b, and c. This shell script/makefile has been tested on many unixes and from version 7.0.9 thru 7.2 of the database. Hope this helps.

(look at the environment variables PROC_ENV_FLAGS and CC_ENV_FLAGS, they allow you to pass in more to the precompiler and compiler via the environment if you want)

  • SAVE THIS AS PROCMK, a shell script ----------------- SRC=`echo *.pc` TGT=`pwd | sed 's".*/""'`

echo SRC = $SRC
echo TGT = $TGT
echo Remember you can set PROC_ENV_FLAGS to pass things to ProC echo Remember you can set CC_ENV_FLAGS to pass things to CC

#
# YOU Need to set this path to where YOU stored the myproc.mk file
#
 

make -f /home/tkyte/bin/myproc.mk "SOURCE=$SRC" "TARGET=$TGT"

------------------------------   EOF   -----------------------------------



-------------- SAVE THIS AS MYPROC.MK, a makefile --------------------
$(TARGET): $(SOURCE) $(SOURCE:.pc=.c) $(SOURCE:.pc=.o)
	$(CC) $(LDFLAGS) -o $(TARGET) \
		$(SOURCE:.pc=.o) \
		$(PROLDLIBS)

include $(ORACLE_HOME)/proc/demo/proc.mk

PROFLAGS= ireclen=255 lines=yes $(PROC_ENV_FLAGS) \

                   include=$(ORACLE_HOME)/proc/lib
CFLAGS=-I. -g $(CC_ENV_FLAGS)

--------------------------------  EOF  ---------------------------



Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government Received on Fri Aug 18 1995 - 00:00:00 CEST

Original text of this message