1# Makefile.in for mpd2 2# 3# If we want to slightly alter the way in which our python scripts are installed 4# then we could probably replace this long-ish, error-prone, largely-manual 5# makefile with an automake-flavored one. As it is, the current version is 6# basically the original Makefile.in modified slightly to account for the 7# elimination of the separate install/install-alt mechanism. 8 9# COMPILE and LINK are the automake names for these variables 10C_COMPILE = $(COMPILE) 11C_LINK = $(LINK) 12 13bin_PROGRAMS = mpdroot 14EXTRA_PROGRAMS = sigcatcher infloop 15noinst_HEADERS = mpdconf.h mpdroot.h 16AM_CPPFLAGS = '-DSYSCONFDIR="$(sysconfdir)"' 17 18MPD = mpd 19MPDBOOT = mpdboot 20CMDS = mpiexec mpdtrace mpdringtest mpdlistjobs mpdkilljob mpdsigjob \ 21 mpdexit mpdallexit mpdcleanup mpdhelp mpdcheck 22HELPERS = mpdgdbdrv mpdman mpdlib mpdchkpyver Zeroconf 23 24PYTHON_SOURCE = ${MPD} ${MPDBOOT} ${CMDS} ${HELPERS} 25 26mpdroot_sources = mpdroot.c 27example_sources = sigcatcher.c infloop.c 28 29# make sure that all of these files end up in a "make dist" tarball 30EXTRA_DIST = ${PYTHON_SOURCE:=.py} autogen.sh 31 32all-local: ${programs} 33 @if [ ! -x ${srcdir}/install.sh ] ; then \ 34 echo "chmod a+x ${srcdir}/install.sh" ;\ 35 if [ ! `chmod a+x ${srcdir}/install.sh` ] ; then \ 36 echo " chmod ok" ;\ 37 else \ 38 echo "Unable to set ${srcdir}/install.sh file to be executable." ;\ 39 echo "Please fix and rerun make" ;\ 40 exit 1 ;\ 41 fi ;\ 42 fi 43 @if [ "${DO_MTV}" = "yes" ] ; then \ 44 currdir=`pwd` ; cd ${srcdir} && ${PYTHON} ./mtv_setup.py build_ext --build-lib=$$currdir --build-temp=$$currdir ;\ 45 fi 46 47clean-local: 48 @-rm -f *.o *.dep *~ ${EXAMPLES} core* *.1 *.pyc 49 @-rm -f *.gcno *.gcda *.bb *.bbg 50 @-rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda 51 52CLEANFILES = mtv.so 53 54# if configured with wrong prefix, use: 55# make prefix=new_install_dir install 56# Note the conditional test for files in PYTHON_SOURCE; this is to allow 57# us to install Zeroconf if present (it is not part of the MPICH2 release 58# in order to avoid Copyright problems). 59install-exec-local: 60if PRIMARY_PM_MPD 61 @if [ ! -d $(DESTDIR)${bindir} ] ; then \ 62 echo "mkdir -p $(DESTDIR)${bindir} " ;\ 63 mkdir -p $(DESTDIR)${bindir} ;\ 64 fi 65 -@if [ -n "`id | grep uid=0`" ] ; then \ 66 ${INSTALL} -m 4755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\ 67 else \ 68 ${INSTALL} -m 755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\ 69 fi 70 @echo "copying python files/links into " $(DESTDIR)${bindir} 71 -@for cmd in ${PYTHON_SOURCE} ; do \ 72 if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \ 73 sed \ 74 -e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' \ 75 -e 's,/etc/mpd.conf,$(sysconfdir)/mpd.conf,g' \ 76 ${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \ 77 ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \ 78 ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \ 79 done 80 -@cd $(DESTDIR)${bindir} && rm -f mpd 81 -@cd $(DESTDIR)${bindir} && $(LN_S) mpd.py mpd 82 -@cd $(DESTDIR)${bindir} && rm -f mpdboot 83 -@cd $(DESTDIR)${bindir} && $(LN_S) mpdboot.py mpdboot 84 -@for cmd in ${CMDS} ; do \ 85 ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \ 86 ( cd $(DESTDIR)${bindir} && $(LN_S) $$cmd.py $$cmd ; ) \ 87 done 88 -@( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 ) 89 -@( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 ) 90 -@( rm -f $(DESTDIR)${bindir}/mpirun >/dev/null 2>&1 || exit 0 ) 91 -@( rm -f $(DESTDIR)${bindir}/mpirun.py >/dev/null 2>&1 || exit 0 ) 92 -@cd $(DESTDIR)${bindir} && $(LN_S) mpiexec mpdrun 93 -@cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.py mpdrun.py 94 -@cd $(DESTDIR)${bindir} && $(LN_S) mpiexec mpirun 95 -@cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.py mpirun.py 96 -@if [ "${DO_MTV}" = "yes" ] ; then \ 97 ${INSTALL} -m 755 mtv.so $(DESTDIR)${bindir}/mtv.so ;\ 98 fi 99else !PRIMARY_PM_MPD 100## This is the former body of the "install-alt" target 101## The purpose of this "target" is to allow users to use mpiexec.mpd to run 102## MPICH2 programs using the MPD process manager when they configure MPICH2 103## to build multiple process managers. 104 @echo "MPD alternate PM installation" 105 @echo "copying python files/links into " $(DESTDIR)${bindir} 106 @if [ ! -d $(DESTDIR)${bindir} ] ; then \ 107 echo "mkdir -p $(DESTDIR)${bindir} " ;\ 108 mkdir -p $(DESTDIR)${bindir} ;\ 109 fi 110 for cmd in ${PYTHON_SOURCE} ; do \ 111 if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \ 112 sed -e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' ${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \ 113 ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \ 114 ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \ 115 done 116 cd $(DESTDIR)${bindir} && rm -f mpd 117 cd $(DESTDIR)${bindir} && $(LN_S) mpd.py mpd 118 cd $(DESTDIR)${bindir} && rm -f mpdboot 119 cd $(DESTDIR)${bindir} && $(LN_S) mpdboot.py mpdboot 120 for cmd in ${CMDS} ; do \ 121 if [ $$cmd = "mpiexec" ] ; then continue ; fi ; \ 122 ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \ 123 ( cd $(DESTDIR)${bindir} && $(LN_S) $$cmd.py $$cmd ; ) \ 124 done 125 ( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 ) 126 ( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 ) 127 mv -f $(DESTDIR)${bindir}/mpiexec.py $(DESTDIR)${bindir}/mpiexec.mpd 128 cd $(DESTDIR)${bindir} && $(LN_S) mpiexec.mpd mpdrun 129endif !PRIMARY_PM_MPD 130 131uninstall-local: 132 -rm -f $(DESTDIR)${bindir}/mpdroot 133 -rm -f $(DESTDIR)${bindir}/Zeroconf.py 134 -rm -f $(DESTDIR)${bindir}/mpd 135 -rm -f $(DESTDIR)${bindir}/mpd.py 136 -rm -f $(DESTDIR)${bindir}/mpdallexit 137 -rm -f $(DESTDIR)${bindir}/mpdallexit.py 138 -rm -f $(DESTDIR)${bindir}/mpdboot 139 -rm -f $(DESTDIR)${bindir}/mpdboot.py 140 -rm -f $(DESTDIR)${bindir}/mpdcheck 141 -rm -f $(DESTDIR)${bindir}/mpdcheck.py 142 -rm -f $(DESTDIR)${bindir}/mpdchkpyver.py 143 -rm -f $(DESTDIR)${bindir}/mpdcleanup 144 -rm -f $(DESTDIR)${bindir}/mpdcleanup.py 145 -rm -f $(DESTDIR)${bindir}/mpdexit 146 -rm -f $(DESTDIR)${bindir}/mpdexit.py 147 -rm -f $(DESTDIR)${bindir}/mpdgdbdrv.py 148 -rm -f $(DESTDIR)${bindir}/mpdhelp 149 -rm -f $(DESTDIR)${bindir}/mpdhelp.py 150 -rm -f $(DESTDIR)${bindir}/mpdkilljob 151 -rm -f $(DESTDIR)${bindir}/mpdkilljob.py 152 -rm -f $(DESTDIR)${bindir}/mpdlib.py 153 -rm -f $(DESTDIR)${bindir}/mpdlib.pyc 154 -rm -f $(DESTDIR)${bindir}/mpdlistjobs 155 -rm -f $(DESTDIR)${bindir}/mpdlistjobs.py 156 -rm -f $(DESTDIR)${bindir}/mpdman.py 157 -rm -f $(DESTDIR)${bindir}/mpdman.pyc 158 -rm -f $(DESTDIR)${bindir}/mpdringtest 159 -rm -f $(DESTDIR)${bindir}/mpdringtest.py 160 -rm -f $(DESTDIR)${bindir}/mpdrun 161 -rm -f $(DESTDIR)${bindir}/mpdrun.py 162 -rm -f $(DESTDIR)${bindir}/mpdsigjob 163 -rm -f $(DESTDIR)${bindir}/mpdsigjob.py 164 -rm -f $(DESTDIR)${bindir}/mpdtrace 165 -rm -f $(DESTDIR)${bindir}/mpdtrace.py 166 -rm -f $(DESTDIR)${bindir}/mpecc.in 167 -rm -f $(DESTDIR)${bindir}/mpefc.in 168 -rm -f $(DESTDIR)${bindir}/mpiexec 169 -rm -f $(DESTDIR)${bindir}/mpiexec.py 170 -rm -f $(DESTDIR)${bindir}/mpirun 171 -rm -f $(DESTDIR)${bindir}/mpirun.py 172 173## DJG: these two rules seem to be unused... 174mpich2-mpdroot: mpich2-mpdroot.o 175 $(C_LINK) -o mpich2-mpdroot mpich2-mpdroot.o $(LIBS) 176 rm -f mpich2-mpdroot.o 177 178mpich2-mpdroot.o: ${srcdir}/mpdroot.c ${srcdir}/mpdroot.h mpdconf.h 179 ${INSTALL} -m 644 ${srcdir}/mpdroot.c mpich2-mpdroot.c 180 ${C_COMPILE} -DSYSCONFDIR=\"$(sysconfdir)\" -c mpich2-mpdroot.c 181 rm -f mpich2-mpdroot.c 182 183# Empty documentations targets (MPICH2 wants this target) 184htmldoc: 185latexdoc: 186 187# make MPICH2 happy 188coverage: 189 190# EXPERIMENTAL TOTALVIEW STUFF 191 192# EXPERIMENTAL MAN STUFF 193mandoc: 194 -@for cmd in ${PYTHON_SOURCE} ; do \ 195 cd ${srcdir} && pydoc $$cmd | txt2man -t $$cmd -s 1 -v "mpd cmds" | awk ' !/Help on module/ { print } ' > ../../../man/man1/$$cmd.1 ; \ 196 done 197# (Note to makefile maintainers: not all make programs accept comments in 198# the commands for a target; all Makefile comments must begin in the first 199# column) 200# example: nroff -man mpd.1 | less 201 202install-man-local: 203 -@for cmd in ${PYTHON_SOURCE} ; do \ 204 ${INSTALL} -m 644 $$cmd.1 $(DESTDIR)${mandir}/man1/$$cmd.1 ; \ 205 done 206