# $Source: runtime/gasnet/other/amudp/Makefile.standalone $ # $Date: Sat, 28 May 2005 02:53:07 -0700 $ # $Revision: 1.7.1.8 $ # Description: Makefile for AMUDP # Copyright 2000, Dan Bonachea # leave these lines alone testprograms_ILP32only_all = testgetput testreadwrite testprograms_ILP32only = $(testprograms_ILP32only_all) # Uncomment one set of lines below to get debug or release configuration #ccflags = $(set_debug_ccflags) #cxxflags = $(set_debug_cxxflags) ccflags = $(set_opt_ccflags) cxxflags = $(set_opt_cxxflags) # 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 = -DAMUDP_DEBUG=1 $(ccdebugflags) $(MANUAL_CFLAGS) $(apputils_flags) set_debug_cxxflags = -DAMUDP_DEBUG=1 $(cxxdebugflags) $(MANUAL_CXXFLAGS) set_opt_ccflags = -DAMUDP_NDEBUG=1 $(ccoptflags) $(MANUAL_CFLAGS) $(apputils_flags) set_opt_cxxflags = -DAMUDP_NDEBUG=1 $(cxxoptflags) $(MANUAL_CXXFLAGS) VPATH = $(srcdir) includes = -I$(srcdir) -I$(altincdir) $(glunix_includes) $(rexec_includes) $(ueth_includes) libraries = $(glunix_libraries) $(ueth_libraries) $(platform_libraries) Ccompile = $(CC) -c $(ccflags) $(platform_defines) $(MANUAL_DEFINES) $(includes) CXXcompile = $(CXX) -c $(cxxflags) $(platform_defines) $(MANUAL_DEFINES) $(includes) link = $(CXX) $(cxxflags) $(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=amudp_cdefs.o amudp_ep.o amudp_reqrep.o amudp_spmd.o amudp_spawn.o exc.o sig.o socklist.o sockutil.o headers=Makefile* amudp.h amudp_internal.h amudp_spmd.h socket.h exc.h sig.h sockaddr.h socklist.h sockutil.h .PHONY: all tests clean veryclean dist all: libamudp.a # ---------- AMUDP library ------------- libamudp.a: $(objects) $(ar) cru $@ $(objects) $(ranlib) $@ # ---------- build targets ------------- # main target tests: apputils.o $(testprograms) @csh -c 'if ("`hostname`" == "whomp") \ eval "echo placing whomp-shared binaries... ; /bin/cp -f $(testprograms) /export/home/$(USER) ; cd /export/home/$(USER) ; chmod a+rx $(testprograms)"' # method to convert .cpp to .o (more reliable than ".cpp.o" method) test%.o : $(testdir)/test%.c $(testdir)/*.h $(headers) $(Ccompile) -DAMUDP -I$(testdir) $< -o $@ tests-clean: rm -f $(testprograms) apputils.o : $(testdir)/apputils.c $(headers) $(Ccompile) -DAMUDP -I$(testdir) $(testdir)/apputils.c -o apputils.o %.o : %.c $(headers) $(Ccompile) $< -o $@ %.o : %.cpp $(headers) $(CXXcompile) $< -o $@ # delete compiling byproducts clean: rm -f *.o core gmon.out veryclean: clean rm -f $(testprograms) libamudp.a @csh -c 'if ("`hostname`" == "whomp") \ eval "echo removing whomp-shared binaries... ; cd /export/home/$(USER) ; rm -f $(testprograms)"' @echo Done verycleaning. # make a distribution amxdist: @bash -x -c ' \ VERSION=`grep "#define AMUDP_LIBRARY_VERSION" $(srcdir)/amudp.h | head -1 | awk '"'"'{ print $$3 }'"'"'` \ export VERSION ; \ echo "+++ Building distribution for AMUDP version $${VERSION} +++" && \ rm -Rf amudp$${VERSION}.tar.gz amudp$${VERSION} && \ mkdir amudp$${VERSION} && \ cp $(srcdir)/Makefile* $(srcdir)/*.txt $(srcdir)/*.cpp $(srcdir)/*.c $(srcdir)/*.h $(testdir)/*.[ch]* $(altincdir)/portable_inttypes.h amudp$${VERSION} && \ rm -f amudp$${VERSION}/Makefile.in amudp$${VERSION}/Makefile.titanium && \ mv amudp$${VERSION}/Makefile.standalone amudp$${VERSION}/Makefile && \ tar -cvhf amudp$${VERSION}.tar amudp$${VERSION} && gzip -9 amudp$${VERSION}.tar && \ rm -Rf amudp$${VERSION} && \ echo "+++ amudp$${VERSION}.tar.gz is ready for distribution +++" \ ' # ---------- test programs ------------- test% : test%.o apputils.o libamudp.a $(ueth_libraries) $(link) -o $@ $< apputils.o -L. -lamudp $(linkend) include $(srcdir)/Makefile.tests