From: David E. <de...@us...> - 2006-12-30 20:15:26
|
John R. Culleton wrote: > I fixed this in one htcobolrc but the system is > finding another. So I will change all of them. You can check which one TC is using the following commands. $env | grep 'TCOB_' TCOB_OPTIONS_PATH=/usr/local/share/htcobol TCOB_RTCONFIG_PATH=/usr/local/share/htcobol >> If you are working with libraries, same youself >> some work by using make files. > > A script also helps such as: > htcobol -c -P -F -I../copybooks -I. testmain.cbl > htcobol -c -P -F -I../copybooks -I. testcalled.cbl > gcc -o testprog testmain.o \ > testcalled.o -L/usr/local/lib -lhtcobol -ldb -ldl -lm > > I will generalize this to take different filenames > using $1, $2 etc. Yes, that will work. However make files will do a lot of the work for you, once setup. They really are indispensable for projects with more than one or two sources. For example if you have one sub-program which is used (statically linked) in 5 modules (programs). If you change that sub-program you have find and rebuild all of the modules. Make can detect the change and re-compile and link the dependencies where necessary. A trivial example can be found in 'test.code/t15'. $make test15 htcobol -c -P -I../copybooks -I. test15.cob htcobol -c -P -I../copybooks -I. test15a.cob gcc -I/usr/local/include -o test15b.o -c test15b.c gcc -o test15 test15.o test15a.o test15b.o \ -L/usr/local/lib -lhtcobol -ldb1 -ldl -lm $touch test15a.cob $make test15 htcobol -c -P -I../copybooks -I. test15a.cob gcc -o test15 test15.o test15a.o test15b.o \ -L/usr/local/lib -lhtcobol -ldb1 -ldl -lm Hint: If you plan to use make files for COBOL projects, copy the 'test.code/config/COB.rules.in' file to 'config' directory (/usr/local/config ?). Adding the following lines to the make file will enable make to build objects from files with COBOL suffixes. COB=htcobol COPYBOOKS= -I../copybooks COBFLAGS=-P ${COPYBOOKS} ... include ${prefix}/config/COB.rules.in # contents of 'COB.rules.in' # Rules for compiling COBOL sources .SUFFIX: .cob .cbl .o %.o: %.cob $(COB) -c $(COBFLAGS) $< # $(COB) $(COBFLAGS) $< %.o: %.cbl $(COB) -c $(COBFLAGS) $< # $(COB) $(COBFLAGS) $< Hope this helps. |