# $Source: runtime/gasnet/other/ammpi/Makefile.standalone $ # $Date: Mon, 22 Aug 2005 02:42:40 -0700 $ # $Revision: 1.8.1.7 $ # Description: Makefile for AMMPI # Copyright 2000, Dan Bonachea # leave these lines alone testprograms_ILP32only_all = testgetput testreadwrite testprograms_ILP32only = $(testprograms_ILP32only_all) # Uncomment one of the two lines below to get debug or release configuration #ccflags = $(set_debug_ccflags) ccflags = $(set_opt_ccflags) # Set host system to the appropriate value to get the right prebaked Makefile HOSTSYSTEM=$(OSTYPE).$(MACHTYPE) include Makefile.$(HOSTSYSTEM) #------------------------------------------------------------------------------------- # You should never need to change things below this line set_debug_ccflags = -DAMMPI_DEBUG=1 $(ccdebugflags) $(MANUAL_CFLAGS) $(apputils_flags) set_opt_ccflags = -DAMMPI_NDEBUG=1 $(ccoptflags) $(MANUAL_CFLAGS) $(apputils_flags) VPATH = $(srcdir) includes = -I$(srcdir) -I$(altincdir) libraries = $(platform_libraries) Ccompile = $(CC) -c $(ccflags) $(platform_defines) $(includes) $(MANUAL_DEFINES) link = $(CC) $(ccflags) $(platform_ldflags) $(MANUAL_LDFLAGS) $(platform_defines) $(includes) linkend = $(libraries) $(MANUAL_LIBS) # all the test executables testprograms = \ testam \ testbounce \ testbulk \ testlatency \ testlatencyM \ testping \ testreduce \ $(testprograms_ILP32only) # all the library objects and headers objects=ammpi_ep.o ammpi_reqrep.o ammpi_spmd.o headers=Makefile* ammpi.h ammpi_internal.h ammpi_spmd.h .PHONY: all tests clean veryclean all: libammpi.a # ---------- AMMPI library ------------- libammpi.a: $(objects) $(ar) cru $@ $(objects) $(ranlib) $@ # ---------- build targets ------------- # main target tests: apputils.o $(testprograms) # method to convert .cpp to .o (more reliable than ".cpp.o" method) test%.o : $(testdir)/test%.c $(testdir)/*.h $(headers) $(Ccompile) -DAMMPI -I$(testdir) $< -o $@ tests-clean: rm -f $(testprograms) apputils.o : $(testdir)/apputils.c $(testdir)/apputils.h $(headers) $(Ccompile) -DAMMPI -I$(testdir) $(testdir)/apputils.c -o apputils.o %.o : %.c $(headers) $(Ccompile) $< -o $@ # delete compiling byproducts clean: rm -f *.o core gmon.out veryclean: clean rm -f $(testprograms) $(testprograms_ILP32only_all) libammpi.a @echo Done verycleaning. # make a distribution amxdist: @sh -x -c ' \ VERSION=`grep "#define AMMPI_LIBRARY_VERSION" $(srcdir)/ammpi.h | head -1 | awk '"'"'{ print $$3 }'"'"'` \ export VERSION ; \ echo "+++ Building distribution for AMMPI version $${VERSION} +++" && \ rm -Rf ammpi$${VERSION}.tar.gz ammpi$${VERSION} && \ mkdir ammpi$${VERSION} && \ cp $(srcdir)/Makefile* $(srcdir)/*.txt $(srcdir)/*.[ch]* $(testdir)/*.[ch]* $(altincdir)/portable_inttypes.h ammpi$${VERSION} && \ rm -f ammpi$${VERSION}/Makefile.in ammpi$${VERSION}/Makefile.titanium && \ mv ammpi$${VERSION}/Makefile.standalone ammpi$${VERSION}/Makefile && \ tar -cvhf ammpi$${VERSION}.tar ammpi$${VERSION} && gzip -9 ammpi$${VERSION}.tar && \ rm -Rf ammpi$${VERSION} && \ echo "+++ ammpi$${VERSION}.tar.gz is ready for distribution +++" \ ' # ---------- test programs ------------- test% : test%.o apputils.o libammpi.a $(libufxp) $(link) -o $@ $< apputils.o -L. -lammpi $(linkend) AMMPI_RUNCMD=$${MPIRUN_CMD:-$(MPIRUN_CMD)} include $(srcdir)/Makefile.tests