On Thu, 20 Mar 2003 08:10:36 -0600, "McKown, John"
<[EMAIL PROTECTED]> wrote:

>The problem with using "make" is that I must know *in advance* which
>programs I want to compile and then code a make file for that set of
>programs. What I want to do is more like:
>
>Edit program1
>Submit program1 to compile
>Edit program2
>Submit program2 to compile
>... How ever many times
>
>Each compile is independent of the others and I don't want to "preplan" and
>build a make file to compile the set of programs since I don't often know
>the members of the set in advance. I do see where a make file would be used
>as I would use a "compile proc" in MVS. I.e. to compile a C program, I must
>do steps 1 through 5. I could then create a generalized make file where I
>pass in the name of the program to compile along with any parameters.
>
>I may just be trying to force an MVS concept where it doesn't really belong.

I've done something similar, all in makefiles. In a simplified
description, you have a playpen directory with all the sources needed
for the project. You also have a production set of libraries. There is
a makefile which recognizes changed sources and 1) moves them to the
proper production libraries and 2) initiates a process to process them
[compile/link/move to another machine] etc.

So I do some editting, save files, enter make [ process "makefile"].

When I add some sources, the "makefile" has to be updated....

Following is a simple example. The purpose here is to move changed
files to a unix build platform. A copy of the files (on unix) are kept
in the buckeye subdirectory. After this, I would do an rexec command
to trigger the build process on unix.
===========================================
_ECHO = @

_IB_FILES = ibface.hpp   \
            ibpublic.hpp \
            ko4async.cpp \
            ko4cache.cpp \
            ko4crtsq.cpp \
            ko4ib.cpp    \
            ko4ibcur.cpp \
            ko4ibput.cpp \
            ko4ibuti.cpp \
            ko4sdep.cpp  \
            ko4sdep.hpp  \
            ko4sitma.cpp \
            ko4sod.cpp   \
            ko4state.cpp \
            ko4xref.cpp  \
            ksmibxit.hpp \
            ksmibdbg.hpp


_IB_REP = $(addprefix buckeye/,$(_IB_FILES))

all: .start .startib .ibfiles .quit .ftp

.start:
        $(_ECHO)rm -f ftp.in
        $(_ECHO)rm -f ftp.go
        $(_ECHO)echo user jalvo PASSWORD >ftp.in
        $(_ECHO)echo verbose >>ftp.in

.startib:
        $(_ECHO)echo cd ~/b3502170/src/kib >>ftp.in

.ibfiles: $(_IB_REP)

buckeye/%: %
        $(_ECHO)echo put $@
        $(_ECHO)echo $@ >ftp.go
        $(_ECHO)echo put $? $? >>ftp.in
        $(_ECHO)cp -f $? $@


.quit:
        $(_ECHO)echo quit >>ftp.in

.ftp:
        $(_ECHO)test -f ftp.go || echo no files to transfer
        $(_ECHO)test -f ftp.go || exit 1
        $(_ECHO)ftp -n buckeye <ftp.in

clean:
        $(_ECHO)rm -f buckeye/*.*
===========================================
The example could use a lot of spiffing up, logging of results,
postponing copying of files into buckeye until the ftp was successful,
etc. It is just a quick one that demonstrates the process.

In a real environment you would also have to interface with some
Source Control System to get and store the files.

I love gnu makefiles, wish someone would pay me to work on them! <hint
hint> I even made one once that would ask the invoker YES or NO and
take different logic paths... that was tough.

John Alvord

Reply via email to