# $Source: bitbucket.org:berkeleylab/gasnet.git/other/ammpi/Makefile.standalone $ # Description: Makefile for AMMPI # Copyright 2000, Dan Bonachea srcdir = . include $(srcdir)/Makefile.common # leave this line alone # Uncomment one of the two lines below to get debug or release configuration ccflags = $(set_opt_ccflags) #ccflags = $(set_debug_ccflags) # Set host system to the appropriate value to get the right prebaked Makefile HOSTSYSTEM=generic include Makefile.$(HOSTSYSTEM) #------------------------------------------------------------------------------------- # You should never need to change things below this line set_debug_ccflags = -DAMMPI_DEBUG=1 $(ccdebugflags) $(MANUAL_CFLAGS) $(MANUAL_MPICFLAGS) $(apputils_flags) set_opt_ccflags = -DAMMPI_NDEBUG=1 $(ccoptflags) $(MANUAL_CFLAGS) $(MANUAL_MPICFLAGS) $(apputils_flags) VPATH = $(srcdir) includes = -I$(srcdir) -I$(altincdir) libraries = $(platform_libraries) defines = -D_GNU_SOURCE=1 Ccompile = $(CC) -c $(ccflags) $(defines) $(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 \ testgetput \ testreadwrite # all the library objects and headers objects=ammpi_ep.o ammpi_reqrep.o ammpi_spmd.o headers=$(srcdir)/Makefile* $(srcdir)/ammpi.h $(srcdir)/ammpi_internal.h $(srcdir)/ammpi_spmd.h .PHONY: all banner tests clean veryclean all: banner libammpi.a banner: @if test "$(HOSTSYSTEM)" = "generic" ; then \ OSTYPE="$${OSTYPE:-OSTYPE}" ; export OSTYPE ; \ MACHTYPE="$${MACHTYPE:-MACHTYPE}" ; export MACHTYPE ; \ echo "WARNING: Using Makefile.generic. " ; \ echo " If this build fails, try selecting one of the platform-specific makefiles, eg: " ; \ echo " $(MAKE) HOSTSYSTEM=$$OSTYPE" ; \ fi # ---------- AMMPI library ------------- libammpi.a: $(objects) $(ar) cru $@ $(objects) $(ranlib) $@ # ---------- build targets ------------- # main target tests: banner apputils.o $(testprograms) # method to convert .cpp to .o (more reliable than ".cpp.o" method) test%.o : $(amxdir)/test%.c $(amxdir)/*.h $(headers) $(Ccompile) -DAMMPI -I$(amxdir) $< -o $@ tests-clean: rm -f $(testprograms) apputils.o : $(amxdir)/apputils.c $(amxdir)/apputils.h $(headers) $(Ccompile) -DAMMPI -I$(amxdir) $(amxdir)/apputils.c -o apputils.o %.o : $(srcdir)/%.c $(headers) $(amxdir)/*.h $(Ccompile) $< -o $@ ammpi_ep.o: $(amxdir)/amx_internal.c # delete compiling byproducts clean: rm -f *.o core gmon.out veryclean: clean rm -f $(testprograms) libammpi.a @echo Done verycleaning. # ---------- 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