# # Makefile.aimk for PVM example programs. # # Set PVM_ROOT to the path where PVM includes and libraries are installed. # Set PVM_ARCH to your architecture type (SUN4, HP9K, RS6K, SGI, etc.) # Set ARCHLIB to any special libs needed on PVM_ARCH (-lrpc, -lsocket, etc.) # otherwise leave ARCHLIB blank # # PVM_ARCH and ARCHLIB are set for you if you use "$PVM_ROOT/lib/aimk" # instead of "make". # # aimk also creates a $PVM_ARCH directory below this one and will cd to it # before invoking make - this allows building in parallel on different arches. # # SDIR - directory containing the source files (ie. master.c, example.c) # Makefile.aimk should also be stored in this directory. SDIR = .. # BDIR - directory storing names of architectures for which there are # executable files (ie. FREEBSD, SUN4SOL2, SGI). # This directory is created for you by makefile if it does not alredy exist. BDIR = $(HOME)/pvm3/bin # XDIR - directory that stores the executables for that architecture. # This directory is built for you by makefile if it does not already exist. XDIR = $(BDIR)/$(PVM_ARCH) # Macros used in the target lines below. Notice that CC = cc OPTIONS = -g CFLAGS = $(OPTIONS) -I$(PVM_ROOT)/include $(ARCHCFLAGS) $(ARCHXINCL) LFLAGS = -L$(PVM_ROOT)/lib/$(PVM_ARCH) LIBS = -lpvm3 $(ARCHLIB) GLIBS = -lgpvm3 # Clean removes all object files of the executables listed clean: rm -f *.o gexample hello hello_other hitc hitc_slave master1 slave1 \ spmd testall timing timing_slave $(XDIR): - mkdir $(BDIR) - mkdir $(XDIR) # The following are the possible target lines that can be used by the # makefile. Remember that if you do not specify a filename when calling # aimk, it will try to make the first target line listed. # Notice that we have modified the target lines slightly. The first line # says to make master according to the rules used to make the executable # file named master. This action does not actually create a file called # master. It does allow you to type 'aimk master', or another name such # slave, instead of always making the first target. The second line has # been modified to include the macros XDIR and SDIR. This says that if the # file in XDIR does not exist, or its timestamp differs from that of the # source file in SDIR, then make the executable according to the rules given. # By adding these macros, we only compile the code when it is necessary to # do so. Without them, the code is re-compiled each time. master:$(XDIR)/master $(XDIR) $(XDIR)/master: $(SDIR)/master.c $(CC) $(CFLAGS) -o master $(SDIR)/master.c $(LFLAGS) $(LIBS) mv master $(XDIR) slave:$(XDIR)/slave $(XDIR) $(XDIR)/slave: $(SDIR)/slave.c $(CC) $(CFLAGS) -o slave $(SDIR)/slave.c $(LFLAGS) $(LIBS) mv slave $(XDIR) # These targets are provided as an example of a PVM application that requires # the use of graphics display. Notice how the X libraries are added to the # target lines. Also notice that the include directories were already # specified in the macros above. master_graph:$(XDIR)/master_graph $(XDIR)/master_graph: $(SDIR)/master_graph.c $(CC) $(CFLAGS) -o master_graph $(SDIR)/master_graph.c $(LFLAGS) $(ARCHXLFLAGS) $(LIBS) -lX11 mv master_graph $(XDIR) slave_graph:$(XDIR)/slave_graph $(XDIR)/slave_graph: $(SDIR)/slave_graph.c $(CC) $(CFLAGS) -o slave_graph $(SDIR)/slave_graph.c $(LFLAGS) $(LIBS) mv slave_graph $(XDIR)