1 # 2 # Makefile for NetPIPE 3 # 4 5 # Default C compiler: must be an ANSI C compiler 6 #CC = cc 7 # File names for the main source files 8 DRIV_SRC = netpipe.c 9 DRIV_OBJ = netpipe.o 10 INCLUDES = netpipe.h 11 # Default target is just TCP 12 TARGETS = NPtcp 13 # If you have TCP, MPI and PVM 14 #TARGETS = NPtcp NPmpi NPpvm 15 CFLAGS += -O -Wall 16 # Adjust these for MPI (only used if you have MPI) 17 MPI_HOME = /home/mpich 18 MPI_ARCH = IRIX 19 MPI_DEVICE = ch_p4 20 # Adjust these for PVM (only used if you have PVM) 21 PVM_HOME = /home/pvm3 22 PVM_ARCH = SUN4SOL2 23 # Any extra libraries needed 24 EXTRA_LIBS = $(LDFLAGS) 25 #EXTRA_LIBS = -lgcc 26 27 all: $(TARGETS) 28 29 install: 30 @/bin/chmod 755 netpipe.sh 31 @ln -f $(TARGETS) netpipe.sh ../../testcases/bin/ 32 # 33 # This section of the Makefile is for compiling the binaries 34 # 35 36 TCP: NPtcp 37 @echo 'NPtcp has been built.' 38 39 NPtcp: NPtcp.o TCP.o 40 $(CC) $(CFLAGS) NPtcp.o TCP.o -o NPtcp $(EXTRA_LIBS) 41 42 NPtcp.o: $(DRIV_SRC) $(INCLUDES) 43 $(CC) $(CFLAGS) -DTCP -c -o NPtcp.o $(DRIV_SRC) 44 45 TCP.o: TCP.c TCP.h $(INCLUDES) 46 $(CC) $(CFLAGS) -DTCP -c TCP.c 47 48 MPI: NPmpi 49 @echo 'NPmpi has been built.' 50 51 NPmpi: NPmpi.o MPI.o 52 $(CC) $(CFLAGS) NPmpi.o MPI.o -o NPmpi -L $(MPI_HOME)/lib/$(MPI_ARCH)/$(MPI_DEVICE) -lmpi $(EXTRA_LIBS) 53 54 NPmpi.o: $(DRIV_SRC) $(INCLUDES) 55 $(CC) $(CFLAGS) -DMPI -I$(MPI_HOME)/include -c -o NPmpi.o $(DRIV_SRC) 56 57 MPI.o: MPI.c MPI.h $(INCLUDES) 58 $(CC) $(CFLAGS) -DMPI -I$(MPI_HOME)/include -c MPI.c 59 60 PVM: NPpvm 61 @echo 'NPpvm has been built.' 62 63 NPpvm: NPpvm.o PVM.o 64 $(CC) $(CFLAGS) NPpvm.o PVM.o -o NPpvm -L$(PVM_HOME)/lib/$(PVM_ARCH)/ -lpvm3 $(EXTRA_LIBS) 65 66 NPpvm.o: $(DRIV_SRC) $(INCLUDES) 67 $(CC) $(CFLAGS) -DPVM -I$(PVM_HOME)/include -c -o NPpvm.o $(DRIV_SRC) 68 69 PVM.o: PVM.c PVM.h $(INCLUDES) 70 $(CC) $(CFLAGS) -DPVM -I$(PVM_HOME)/include -c PVM.c 71 72 clean: 73 rm -f $(TARGETS) *.o core a.out 74