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
8DRIV_SRC   = netpipe.c
9DRIV_OBJ   = netpipe.o
10INCLUDES   = netpipe.h
11# Default target is just TCP
12TARGETS    = NPtcp
13# If you have TCP, MPI and PVM
14#TARGETS    = NPtcp NPmpi NPpvm
15CFLAGS		    += -O -Wall
16# Adjust these for MPI (only used if you have MPI)
17MPI_HOME   = /home/mpich
18MPI_ARCH   = IRIX
19MPI_DEVICE = ch_p4
20# Adjust these for PVM (only used if you have PVM)
21PVM_HOME   = /home/pvm3
22PVM_ARCH   = SUN4SOL2
23# Any extra libraries needed
24EXTRA_LIBS = $(LDFLAGS)
25#EXTRA_LIBS = -lgcc
26
27all:	$(TARGETS)
28
29install:
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
36TCP:	NPtcp
37	@echo 'NPtcp has been built.'
38
39NPtcp:	NPtcp.o TCP.o
40	$(CC) $(CFLAGS) NPtcp.o TCP.o  -o NPtcp $(EXTRA_LIBS)
41
42NPtcp.o:	$(DRIV_SRC) $(INCLUDES)
43	$(CC) $(CFLAGS) -DTCP -c -o NPtcp.o $(DRIV_SRC)
44
45TCP.o:	TCP.c TCP.h $(INCLUDES)
46	$(CC) $(CFLAGS) -DTCP -c TCP.c
47
48MPI:	NPmpi
49	@echo 'NPmpi has been built.'
50
51NPmpi:	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
54NPmpi.o:	$(DRIV_SRC) $(INCLUDES)
55	$(CC) $(CFLAGS) -DMPI -I$(MPI_HOME)/include -c -o NPmpi.o $(DRIV_SRC)
56
57MPI.o:	MPI.c MPI.h $(INCLUDES)
58	$(CC) $(CFLAGS) -DMPI -I$(MPI_HOME)/include -c MPI.c
59
60PVM:	NPpvm
61	@echo 'NPpvm has been built.'
62
63NPpvm:	NPpvm.o PVM.o
64	$(CC) $(CFLAGS) NPpvm.o PVM.o -o NPpvm  -L$(PVM_HOME)/lib/$(PVM_ARCH)/ -lpvm3 $(EXTRA_LIBS)
65
66NPpvm.o:	$(DRIV_SRC) $(INCLUDES)
67	$(CC) $(CFLAGS) -DPVM -I$(PVM_HOME)/include -c -o NPpvm.o $(DRIV_SRC)
68
69PVM.o:	PVM.c PVM.h $(INCLUDES)
70	$(CC) $(CFLAGS) -DPVM -I$(PVM_HOME)/include -c PVM.c
71
72clean:
73	rm -f $(TARGETS) *.o core a.out
74