root/mpich2/branches/dev/kumudb/src/pm/mpd/Makefile.in @ 4898

Revision 4898, 9.2 KB (checked in by kumudb, 5 months ago)

executable works except mpiexec

Line 
1# Makefile.in for mpd2
2
3@SET_MAKE@
4prefix    = @prefix@
5exec_prefix = @exec_prefix@
6bindir    = @bindir@
7datarootdir = @datarootdir@
8mandir    = @mandir@
9srcdir    = @srcdir@
10SHELL     = @SHELL@
11CC        = @CC@
12INCLUDES  = -I. -I${srcdir}
13CPPFLAGS  = @CPPFLAGS@
14CLINKER   = @CLINKER@
15COPTIONS  = @COPTIONS@
16LDFLAGS   = @LDFLAGS@
17LIBS      = @LIBS@
18PYTHON    = @PYTHON@
19DO_MTV    = @DO_MTV@
20INSTALL   = @INSTALL@
21CFLAGS    = @CFLAGS@
22
23C_COMPILE = ${CC} ${INCLUDES} ${CFLAGS} ${COPTIONS}
24C_LINK    = ${CLINKER} ${CFLAGS} ${COPTIONS} ${LDFLAGS}
25
26VPATH     = .:@srcdir@
27
28PROGRAMS  = mpdroot
29EXAMPLES  = sigcatcher infloop
30
31SOURCES   = ${mpdroot_SOURCES} ${example_SOURCES}
32OBJECTS   = ${mpdroot_OBJECTS} ${example_OBJECTS}
33HEADERS   = mpdconf.h mpdroot.h
34
35MPD      = mpd
36MPDBOOT  = mpdboot
37CMDS     = mpiexec mpdtrace mpdringtest mpdlistjobs mpdkilljob mpdsigjob \
38           mpdexit mpdallexit mpdcleanup mpdhelp mpdcheck
39HELPERS  = mpdgdbdrv mpdman mpdlib mpdchkpyver Zeroconf
40
41PYTHON_SOURCE =  ${MPD} ${MPDBOOT} ${CMDS} ${HELPERS}
42
43mpdroot_SOURCES  = mpdroot.c
44example_SOURCES  = sigcatcher.c infloop.c
45
46mpdroot_OBJECTS = ${mpdroot_SOURCES:.c=.o}
47example_OBJECTS = ${example_SOURCES:.c=.o}
48
49
50all: Makefile ${PROGRAMS}
51        @if [ ! -x ${srcdir}/install.sh ] ; then \
52            echo "chmod a+x ${srcdir}/install.sh" ;\
53            if [ ! `chmod a+x ${srcdir}/install.sh` ] ; then \
54                echo "  chmod ok" ;\
55            else \
56                echo "Unable to set ${srcdir}/install.sh file to be executable." ;\
57                echo "Please fix and rerun make" ;\
58                exit 1 ;\
59            fi ;\
60        fi
61        @if [ "${DO_MTV}" = "yes" ] ; then \
62            currdir=`pwd` ; cd ${srcdir}  &&  ${PYTHON} ./mtv_setup.py build_ext --build-lib=$$currdir --build-temp=$$currdir ;\
63        fi
64
65
66
67.SUFFIXES:
68.SUFFIXES: .o .dep .c
69
70etags:  ${HEADERS} ${SOURCES}
71        etags ${HEADERS} ${SOURCES}
72
73mpdroot: ${mpdroot_OBJECTS}
74        $(C_LINK) -o mpdroot ${mpdroot_OBJECTS} $(LIBS)
75
76mpdroot.o: ${srcdir}/mpdroot.c ${srcdir}/mpdroot.h mpdconf.h
77        ${C_COMPILE} -c  $<
78
79# The following lines provide the right libraries for all example programs
80.c:
81        ${C_LINK} -o $* $*.c $(LIBS)
82.o:     
83        $(C_LINK) -o $* $*.o $(LIBS)
84
85clean:
86        @-rm -f *.o *.dep *~ ${EXAMPLES} core* *.1 *.pyc
87        @-rm -f *.gcno *.gcda *.bb *.bbg
88        @-rm -f ${srcdir}/*.gcno ${srcdir}/*.gcda
89
90# echo "some of the following might be executables you want to remove"
91# ls -l | grep rwx
92distclean: clean
93        rm -f Makefile mpdconf.h ${PROGRAMS} ${PYTHON_SOURCE} \
94                   config.status config.cache config.log mtv.so
95
96
97maintainer-clean: distclean
98        rm -f configure mpdconf.h.in
99        rm -rf autom4te.cache
100
101${srcdir}/configure: ${srcdir}/configure.in
102        @rm -rf autom4te*.cache
103        (cd ${srcdir} && autoheader -I ../../../confdb && \
104        autoconf -I \
105        ../../../confdb )
106
107Makefile: ${srcdir}/Makefile.in config.status
108        ./config.status
109
110.c.o:   
111        ${C_COMPILE} -c $<
112
113# if configured with wrong prefix, use:
114#     make prefix=new_install_dir install
115# Note the conditional test for files in PYTHON_SOURCE; this is to allow
116# us to install Zeroconf if present (it is not part of the MPICH2 release
117# in order to avoid Copyright problems).
118install: all
119        @if [ ! -d $(DESTDIR)${bindir} ] ; then \
120            echo "mkdir -p $(DESTDIR)${bindir} " ;\
121            mkdir -p $(DESTDIR)${bindir} ;\
122        fi   
123        -@if [ -n "`id | grep uid=0`" ] ; then \
124            ${INSTALL} -m 4755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\
125        else \
126            ${INSTALL} -m  755 mpdroot $(DESTDIR)${bindir}/mpdroot ;\
127        fi
128        @echo "copying python files/links into " $(DESTDIR)${bindir}
129        -@for cmd in ${PYTHON_SOURCE} ; do \
130            if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \
131            sed -e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' ${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \
132            ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \
133            ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \
134        done
135        -@cd $(DESTDIR)${bindir} && rm -f mpd
136        -@cd $(DESTDIR)${bindir} && @LN_S@ mpd.py mpd
137        -@cd $(DESTDIR)${bindir} && rm -f mpdboot
138        -@cd $(DESTDIR)${bindir} && @LN_S@ mpdboot.py mpdboot
139        -@for cmd in ${CMDS} ; do \
140            ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \
141            ( cd $(DESTDIR)${bindir} && @LN_S@ $$cmd.py $$cmd ; ) \
142        done
143        -@( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 )
144        -@( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 )
145        -@( rm -f $(DESTDIR)${bindir}/mpirun >/dev/null 2>&1 || exit 0 )
146        -@( rm -f $(DESTDIR)${bindir}/mpirun.py >/dev/null 2>&1 || exit 0 )
147        -@cd $(DESTDIR)${bindir} && @LN_S@ mpiexec mpdrun
148        -@cd $(DESTDIR)${bindir} && @LN_S@ mpiexec.py mpdrun.py
149        -@cd $(DESTDIR)${bindir} && @LN_S@ mpiexec mpirun
150        -@cd $(DESTDIR)${bindir} && @LN_S@ mpiexec.py mpirun.py
151        -@if [ "${DO_MTV}" = "yes" ] ; then \
152            ${INSTALL} -m 755 mtv.so $(DESTDIR)${bindir}/mtv.so ;\
153        fi
154
155
156mpich2-build-install: mpich2-mpdroot install
157        -@if [ -n "`id | grep uid=0`" ] ; then \
158            ${INSTALL} -m 4755 mpich2-mpdroot $(DESTDIR)${bindir}/mpdroot ;\
159        else \
160            ${INSTALL} -m  755 mpich2-mpdroot $(DESTDIR)${bindir}/mpdroot ;\
161        fi
162        rm -f mpich2-mpdroot
163
164uninstall: mpich2-build-uninstall
165mpich2-build-uninstall:
166        -rm -f $(DESTDIR)${bindir}/mpdroot
167        -rm -f $(DESTDIR)${bindir}/Zeroconf.py
168        -rm -f $(DESTDIR)${bindir}/mpd
169        -rm -f $(DESTDIR)${bindir}/mpd.py
170        -rm -f $(DESTDIR)${bindir}/mpdallexit
171        -rm -f $(DESTDIR)${bindir}/mpdallexit.py
172        -rm -f $(DESTDIR)${bindir}/mpdboot
173        -rm -f $(DESTDIR)${bindir}/mpdboot.py
174        -rm -f $(DESTDIR)${bindir}/mpdcheck
175        -rm -f $(DESTDIR)${bindir}/mpdcheck.py
176        -rm -f $(DESTDIR)${bindir}/mpdchkpyver.py
177        -rm -f $(DESTDIR)${bindir}/mpdcleanup
178        -rm -f $(DESTDIR)${bindir}/mpdcleanup.py
179        -rm -f $(DESTDIR)${bindir}/mpdexit
180        -rm -f $(DESTDIR)${bindir}/mpdexit.py
181        -rm -f $(DESTDIR)${bindir}/mpdgdbdrv.py
182        -rm -f $(DESTDIR)${bindir}/mpdhelp
183        -rm -f $(DESTDIR)${bindir}/mpdhelp.py
184        -rm -f $(DESTDIR)${bindir}/mpdkilljob
185        -rm -f $(DESTDIR)${bindir}/mpdkilljob.py
186        -rm -f $(DESTDIR)${bindir}/mpdlib.py
187        -rm -f $(DESTDIR)${bindir}/mpdlib.pyc
188        -rm -f $(DESTDIR)${bindir}/mpdlistjobs
189        -rm -f $(DESTDIR)${bindir}/mpdlistjobs.py
190        -rm -f $(DESTDIR)${bindir}/mpdman.py
191        -rm -f $(DESTDIR)${bindir}/mpdman.pyc
192        -rm -f $(DESTDIR)${bindir}/mpdringtest
193        -rm -f $(DESTDIR)${bindir}/mpdringtest.py
194        -rm -f $(DESTDIR)${bindir}/mpdrun
195        -rm -f $(DESTDIR)${bindir}/mpdrun.py
196        -rm -f $(DESTDIR)${bindir}/mpdsigjob
197        -rm -f $(DESTDIR)${bindir}/mpdsigjob.py
198        -rm -f $(DESTDIR)${bindir}/mpdtrace
199        -rm -f $(DESTDIR)${bindir}/mpdtrace.py
200        -rm -f $(DESTDIR)${bindir}/mpecc.in
201        -rm -f $(DESTDIR)${bindir}/mpefc.in
202        -rm -f $(DESTDIR)${bindir}/mpiexec
203        -rm -f $(DESTDIR)${bindir}/mpiexec.py
204        -rm -f $(DESTDIR)${bindir}/mpirun
205        -rm -f $(DESTDIR)${bindir}/mpirun.py
206all-executable: all-executable-local
207all-executable-local:
208
209mpich2-mpdroot: mpich2-mpdroot.o
210        $(C_LINK) -o mpich2-mpdroot mpich2-mpdroot.o $(LIBS)
211        rm -f mpich2-mpdroot.o
212
213mpich2-mpdroot.o: ${srcdir}/mpdroot.c ${srcdir}/mpdroot.h mpdconf.h
214        ${INSTALL} -m 644 ${srcdir}/mpdroot.c mpich2-mpdroot.c
215        ${C_COMPILE} -c mpich2-mpdroot.c
216        rm -f mpich2-mpdroot.c
217
218# A special alternate installation target when using multiple process managers
219# MPICH2 expects this, but it only needs to install enough to run mpiexec
220# The purpose of this target is to allow users to use mpiexec.mpd to run
221# MPICH2 programs using the MPD process manager when they configure MPICH2
222# to build multiple process managers.
223install-alt: mpiexec.py
224        @echo "copying python files/links into " $(DESTDIR)${bindir}
225        @if [ ! -d $(DESTDIR)${bindir} ] ; then \
226            echo "mkdir -p $(DESTDIR)${bindir} " ;\
227            mkdir -p $(DESTDIR)${bindir} ;\
228        fi   
229        for cmd in ${PYTHON_SOURCE} ; do \
230            if [ ! -s $(srcdir)/$$cmd.py ] ; then continue ; fi ; \
231            sed -e 's#/usr/bin/env python.*#/usr/bin/env ${PYTHON}#' ${srcdir}/$$cmd.py > $(DESTDIR)${bindir}/temp$$cmd.py ; \
232            ${INSTALL} -m 755 $(DESTDIR)${bindir}/temp$$cmd.py $(DESTDIR)${bindir}/$$cmd.py; \
233            ( rm -f $(DESTDIR)${bindir}/temp$$cmd.py >/dev/null 2>&1 || exit 0 ) ; \
234        done
235        cd $(DESTDIR)${bindir} && rm -f mpd
236        cd $(DESTDIR)${bindir} && @LN_S@ mpd.py mpd
237        cd $(DESTDIR)${bindir} && rm -f mpdboot
238        cd $(DESTDIR)${bindir} && @LN_S@ mpdboot.py mpdboot
239        for cmd in ${CMDS} ; do \
240            if [ $$cmd = "mpiexec" ] ; then continue ; fi ; \
241            ( cd $(DESTDIR)${bindir} && rm -f $$cmd ; ) ; \
242            ( cd $(DESTDIR)${bindir} && @LN_S@ $$cmd.py $$cmd ; ) \
243        done
244        ( rm -f $(DESTDIR)${bindir}/mpdrun >/dev/null 2>&1 || exit 0 )
245        ( rm -f $(DESTDIR)${bindir}/mpdrun.py >/dev/null 2>&1 || exit 0 )
246        mv -f $(DESTDIR)${bindir}/mpiexec.py $(DESTDIR)${bindir}/mpiexec.mpd
247        cd $(DESTDIR)${bindir} && @LN_S@ mpiexec.mpd mpdrun
248
249# Empty dependencies target (MPICH2 wants this target)
250dependencies:
251# Empty documentations targets (MPICH2 wants this target)
252htmldoc:
253latexdoc:
254mandoc:
255# Empty tags targets (MPICH2 wants this target)
256tags: TAGS
257TAGS:
258
259
260# EXPERIMENTAL TOTALVIEW STUFF
261
262# EXPERIMENTAL MAN STUFF
263man:
264        -@for cmd in ${PYTHON_SOURCE} ; do \
265            currdir=`pwd` ; cd ${srcdir} &&  pydoc $$cmd | txt2man -t $$cmd -s 1 -v "mpd cmds" | awk ' !/Help on module/ { print } ' > $$currdir/$$cmd.1 ; \
266        done
267# (Note to makefile maintainers: not all make programs accept comments in
268# the commands for a target; all Makefile comments must begin in the first
269# column)
270# example:  nroff -man mpd.1 | less
271
272install-man:
273        -@for cmd in ${PYTHON_SOURCE} ; do \
274                ${INSTALL} -m 644 $$cmd.1 $(DESTDIR)${mandir}/$$cmd.1 ; \
275        done
Note: See TracBrowser for help on using the browser.