From 9abe6ad4d8d84504f7bf823f68415fe58c78cfeb Mon Sep 17 00:00:00 2001 From: tqchen Date: Wed, 3 Dec 2014 21:30:11 -0800 Subject: [PATCH] checkin makefile --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..bbed21c81 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +export CC = gcc +export CXX = g++ +export MPICXX = mpicxx +export LDFLAGS= +export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -I../src + +BPATH=lib +# objectives that makes up rabit library +MPIOBJ= $(BPATH)/engine_mpi.o +OBJ= $(BPATH)/allreduce_base.o $(BPATH)/allreduce_robust.o $(BPATH)/engine.o +ALIB= lib/librabit.a lib/librabit_mpi.a + +.PHONY: clean all + +all: $(ALIB) + +$(BPATH)/allreduce_base.o: src/allreduce_base.cc src/*.h +$(BPATH)/engine.o: src/engine.cc src/*.h +$(BPATH)/allreduce_robust.o: src/allreduce_robust.cc src/*.h +$(BPATH)/engine_mpi.o: src/engine_mpi.cc src/*.h + +lib/librabit.a: $(OBJ) +lib/librabit_mpi.a: $(MPIOBJ) + +$(OBJ) : + $(CXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) ) + +$(MPIOBJ) : + $(MPICXX) -c $(CFLAGS) -o $@ $(firstword $(filter %.cpp %.c %.cc, $^) ) + +$(ALIB): + ar cr $@ $+ + +clean: + $(RM) $(OBJ) $(MPIOBJ) $(ALIB) $(MPIALIB) *~ src/*~