-
Notifications
You must be signed in to change notification settings - Fork 864
Expand file tree
/
Copy pathmakefile_procob.mk
More file actions
96 lines (83 loc) · 3.08 KB
/
makefile_procob.mk
File metadata and controls
96 lines (83 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
###############################################################################
# Make file for PROCOB demos
###############################################################################
# Usage :
# For compiling procob demos
# make -f makefile_procob.mk
#
# For precompiling, compiling & linking the procobdemo.pco file
# make -f makefile_procob.mk build EXE=procobdemo COBS=procobdemo.cob
#
# In general, for any procob program
# make -f makefile_procob.mk build EXE=<exename> COBS="<list of dependent cobs>"
# To make use of any PROCOB options during precompilation,
# make -f makefile_procob.mk build PROCOBFLAGS="<list of procob options>"
# EXE=<exename> COBS="<list of dependent cobs>"
#
# NOTES:
# 1. Please change "COB" and the "InstantClient directories" to point to
# appropiate locations on your machine before using this makefile.
# 2. In case of RPM installation, please change the following variables
# as mentioned below:
# PROCOB=/usr/lib/oracle/VV.v/client/bin/procob
# ICLIBHOME=/usr/lib/oracle/VV.v/client/lib/
# Legend:
# VV - Major Oracle version number
# v - Minor Oracle version number
# (Ex: For the release 18.1, VV = 12 and v = 1)
#
###############################################################################
COB=cob
# InstantClient Directories.
ICSDKHOME=../
ICLIBHOME=../../
MKLINK=ln
REMOVE=rm -rf
CLNCACHE=cleancache
CACHEDIR=SunWS_cachea
MAKE=make
MAKEFILE=makefile_procob.mk
PROCOBDEMO=procobdemo
PROCOB=$(ICSDKHOME)/procob
ICLIBPATH=$(LDPATHFLAG)$(ICLIBHOME)
SO_EXT=.so
COBFLAGS=-C IBMCOMP -C NESTCALL -t -x
LDPATHFLAG=-L
COBSQLINTF=$(ICLIBHOME)cobsqlintf.o
LDLIBS=$(EXSYSLIBS) $(MATHLIB) $(USRLIBS)
EXSYSLIBS=-ldl
MATHLIB=-lm
COBOL_PROLDLIBS=$(SHARED_CLIENTLIBS) $(LDLIBS)
SHARED_CLIENTLIBS=$(LLIBCLNTSH) $(LDFLAGS)
LLIBCLNTSH=$(LDLIBFLAG)$(LIBCLNTSHNAME)
LDLIBFLAG=-l
LIBCLNTCORENAME=clntshcore
LIBCLNTSHNAME=clntsh
LDFLAGS=-g
DEMO_PROCOB_BUILD=$(COB) $(COBFLAGS) -o $(EXE) $(COBS) $(ICLIBPATH) $(COBSQLINTF) $(COBOL_PROLDLIBS)
#-----------------------------------------------------------------------------
# Targets for building the procob sample programs.
#
# The target 'build' puts together an executable $(EXE) from the cobol
# sources in $(COBS) and the libraries in $(COBOL_PROLDLIBS).
# The rules to make .cob files from .pco files are later in this file.
#
all: clean $(PROCOBDEMO)
$(PROCOBDEMO):
$(MAKE) -f $(MAKEFILE) build COBS=$@.cob EXE=$@
build: $(CLNCACHE) $(COBS)
$(DEMO_PROCOB_BUILD)
#-----------------------------------------------------------------------------
# Here are some rules for converting .pco -> .cob -> .o and for .cob -> .gnt.
#
.SUFFIXES: .cob .cbl .o .pco $(GNT)
.pco.cob:
$(PROCOB) $(PROCOBFLAGS) iname=$*.pco
.cob$(GNT):
$(COB2GNT)
#-----------------------------------------------------------------------------
# Clean up all executables, *.o and generated *.cob files
clean: $(CLNCACHE)
$(REMOVE) $(PROCOBDEMO) $(PROCOBDEMO).o $(PROCOBDEMO).cob $(PROCDEMO).lis $(PROCOBDEMO).int $(PROCOBDEMO).idy
cleancache:
$(REMOVE) $(CACHEDIR)