fixed for problematic mpicxx compiler
[charm.git] / src / libs / ck-libs / datatransfer / Makefile
1 CDIR=../../../..
2 CHARMC=$(CDIR)/bin/charmc -I. $(OPTS)
3 MPICC=$(CDIR)/bin/mpiCC -I. $(OPTS)
4
5 # Directory where Magic software headers live:
6 MGC=.
7 MGCOBJS=$(MGC)/MgcIntr3DTetrTetr.o  $(MGC)/MgcMath.o  $(MGC)/MgcPlane.o \
8         $(MGC)/MgcTetrahedron.o  $(MGC)/MgcVector3.o
9
10 HEADERS=paralleltransfer.h tetmesh.h prismMesh.h
11 # HEADERS=paralleltransfer.h parallelsurfacetransfer.h tetmesh.h prismMesh.h triSurfMesh.h mapbasic.h
12 HEADDEP=$(HEADERS) 
13 TOBJS=$(MGCOBJS) GenericElement.o transfer.o tetmesh.o tetmesh_noboite.o 
14 # TOBJS=$(MGCOBJS) GenericElement.o transfer.o tetmesh.o tetmesh_noboite.o geom_util.o
15 OBJS=$(TOBJS) tetmesh_fem.o paralleltransfer.o prismMesh.o
16 #OBJS=$(TOBJS) tetmesh_fem.o paralleltransfer.o prismMesh.o parallelsurfacetransfer.o
17 LIB=libdatatransfer
18
19 LIBDIR=$(CDIR)/lib
20 DEST=$(LIBDIR)/$(LIB).a
21
22 test1=test_GenericElement
23 test1o=$(test1).C GenericElement.o
24 test2=test_noboite
25 test2o=$(test2).C $(TOBJS) charm_standalone.o
26 test3=test_transfer
27 test3o=$(test3).C $(TOBJS) charm_standalone.o
28 test4=test_vol
29 test4o=$(test4).C cg3d.o \
30         test_vol_mgc.o $(MGCOBJS) \
31         test_vol_planes.o volume_planes.o
32 tests=$(test1) $(test2) $(test3) $(test4)
33
34 all: $(DEST)
35
36 $(DEST): $(OBJS) headers
37         $(CHARMC) $(OBJS) -o $@ $(LIBS)
38
39 headers: $(HEADERS)
40         cp $(HEADERS) $(CDIR)/include/
41         touch headers
42
43 $(test1): $(test1o) $(HEADDEP)
44         $(CHARMC) $(test1o) -o $(test1) -seq -language c++
45
46 $(test2): $(test2o) $(HEADDEP)
47         $(CHARMC) $(test2o) -o $(test2) -seq -language c++
48
49 $(test3): $(test3o) $(HEADDEP)
50         $(CHARMC) $(test3o) -o $(test3) -seq -language c++
51
52 $(test4): $(test4o) $(HEADDEP)
53         $(CHARMC) $(test4o) -o $(test4) -language ampi
54
55 test: $(tests)
56         ./$(test1) 1 10000
57         ./$(test2) test_transfer_dir/src.noboite
58         ./$(test3) test_transfer_dir/src.noboite test_transfer_dir/src.noboite
59         ./$(test3) test_transfer_dir/dest.noboite test_transfer_dir/dest.noboite
60         ./$(test3) test_transfer_dir/src.noboite test_transfer_dir/dest.noboite
61         ./$(test3) test_transfer_dir/dest.noboite test_transfer_dir/src.noboite
62
63 clean:
64         rm -rf *.a *.def.h *.decl.h *.o $(MGC)/*.o \
65                 SunWS_cache $(DEST) $(tests) headers
66
67 # Trick make into compiling .C's into .o's.
68 .SUFFIXES: .C .cpp
69
70 .C.o:
71         $(MPICC) -c $<
72
73 .cpp.o:
74         $(CHARMC) -c $<