Whamcloud - gitweb
4dd8eacd6cb4af477760f45b8c02e2d257a46ef2
[fs/lustre-release.git] / lnet / utils / Makefile.am
1 #
2 # GPL HEADER START
3 #
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 2 only,
8 # as published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License version 2 for more details (a copy is included
14 # in the LICENSE file that accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License
17 # version 2 along with this program; If not, see [sun.com URL with a
18 # copy of GPLv2].
19 #
20 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 # CA 95054 USA or visit www.sun.com if you need additional information or
22 # have any questions.
23 #
24 # GPL HEADER END
25 #
26
27 #
28 # Copyright  2008 Sun Microsystems, Inc. All rights reserved
29 # Use is subject to license terms.
30 #
31
32 #
33 # This file is part of Lustre, http://www.lustre.org/
34 # Lustre is a trademark of Sun Microsystems, Inc.
35 #
36
37 ## $(srcdir)/../ for <portals/*.h>, ../../ for generated <config.h>
38 #COMPILE = $(CC) -Wall -g -I$(srcdir)/../include -I../../include
39 #LINK = $(CC) -o $@
40
41 if LIBLUSTRE
42 noinst_LIBRARIES = libuptlctl.a
43 endif
44
45 libuptlctl_a_SOURCES = portals.c nidstrings.c debug.c l_ioctl.c
46 libuptlctl_a_CPPFLAGS = $(LLCPPFLAGS)
47 libuptlctl_a_CFLAGS = $(LLCFLAGS) -DLUSTRE_UTILS=1
48
49 sbin_PROGRAMS = debugctl
50
51 lib_LIBRARIES = libptlctl.a
52
53 if LIBLUSTRE
54 noinst_LIBRARIES += liblst.a
55 liblst_a_SOURCES =
56 endif
57
58 libptlctl_a_SOURCES = portals.c nidstrings.c debug.c l_ioctl.c parser.c parser.h
59
60 if UTILS
61 sbin_PROGRAMS += ptlctl routerstat wirecheck lst
62 if LIBLUSTRE
63 sbin_PROGRAMS += lstclient
64 endif
65
66 if BUILD_GMLND
67 sbin_PROGRAMS += gmlndnid
68 endif
69 endif
70
71 wirecheck_SOURCES = wirecheck.c
72
73 gmlndnid_SOURCES = gmlndnid.c
74 gmlndnid_CFLAGS = $(GMCPPFLAGS)
75 gmlndnid_LDFLAGS = -static
76 gmlndnid_LDADD = $(GMLIBS) -lgm
77
78 ptlctl_SOURCES = ptlctl.c
79 ptlctl_LDADD =  -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
80 ptlctl_DEPENDENCIES = libptlctl.a
81
82 routerstat_SOURCES = routerstat.c
83
84 debugctl_SOURCES = debugctl.c
85 debugctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
86 debugctl_DEPENDENCIES = libptlctl.a
87
88 lst_SOURCES = lst.c
89 lst_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
90 lst_DEPENDENCIES = libptlctl.a
91
92 LND_LIBS =
93 if BUILD_USOCKLND
94 LND_LIBS +=    $(top_builddir)/lnet/ulnds/socklnd/libsocklnd.a
95 endif
96 if BUILD_UPTLLND
97 LND_LIBS +=   $(top_builddir)/lnet/ulnds/ptllnd/libptllnd.a
98 endif
99
100 if LIBLUSTRE
101 LIB_SELFTEST = $(top_builddir)/libcfs/libcfs/libcfs.a $(top_builddir)/lnet/lnet/liblnet.a $(top_builddir)/lnet/selftest/libselftest.a
102 liblst.a : $(LIB_SELFTEST) $(LND_LIBS)
103         sh $(srcdir)/genlib.sh "$(LIBS)" "$(LND_LIBS)" "$(PTHREAD_LIBS)"
104
105 lstclient_SOURCES = lstclient.c
106 lstclient_LDADD = -L. -lptlctl -llst $(LIBREADLINE) $(LIBEFENCE) $(PTHREAD_LIBS)
107 lstclient_DEPENDENCIES = libptlctl.a liblst.a
108 endif
109
110 nidstrings.c: @top_srcdir@/libcfs/libcfs/nidstrings.c
111         ln -sf $< $@
112
113 EXTRA_DIST = genlib.sh