Makefile revision 1.1.1.2 1 1.1 haad #
2 1.1 haad # Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved.
3 1.1 haad #
4 1.1 haad # This file is part of the device-mapper userspace tools.
5 1.1 haad #
6 1.1 haad # This copyrighted material is made available to anyone wishing to use,
7 1.1 haad # modify, copy, or redistribute it subject to the terms and conditions
8 1.1 haad # of the GNU Lesser General Public License v.2.1.
9 1.1 haad #
10 1.1 haad # You should have received a copy of the GNU Lesser General Public License
11 1.1 haad # along with this program; if not, write to the Free Software Foundation,
12 1.1 haad # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 1.1 haad
14 1.1 haad srcdir = .
15 1.1 haad top_srcdir = ../..
16 1.1.1.2 haad top_builddir = ../..
17 1.1 haad
18 1.1 haad
19 1.1 haad SOURCES = libdevmapper-event.c
20 1.1.1.2 haad TARGETS = dmeventd
21 1.1.1.2 haad
22 1.1.1.2 haad .PHONY: install_lib_dynamic install_lib_static install_include \
23 1.1.1.2 haad install_pkgconfig install_dmeventd_dynamic install_dmeventd_static \
24 1.1.1.2 haad install_lib install_dmeventd
25 1.1.1.2 haad
26 1.1.1.2 haad INSTALL_DMEVENTD_TARGETS = install_dmeventd_dynamic
27 1.1.1.2 haad INSTALL_LIB_TARGETS = install_lib_dynamic
28 1.1.1.2 haad
29 1.1.1.2 haad ifeq ("no", "yes")
30 1.1.1.2 haad LIB_STATIC = libdevmapper-event.a
31 1.1.1.2 haad TARGETS += dmeventd.static
32 1.1.1.2 haad INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
33 1.1.1.2 haad INSTALL_LIB_TARGETS += install_lib_static
34 1.1.1.2 haad endif
35 1.1 haad
36 1.1 haad LIB_VERSION = $(LIB_VERSION_DM)
37 1.1 haad
38 1.1 haad ifeq ("","dylib")
39 1.1 haad LIB_SHARED = libdevmapper-event.dylib
40 1.1 haad else
41 1.1 haad LIB_SHARED = libdevmapper-event.so
42 1.1 haad VERSIONED_SHLIB = $(LIB_SHARED).$(LIB_VERSION)
43 1.1 haad endif
44 1.1 haad
45 1.1.1.2 haad CLEAN_TARGETS = dmeventd.o dmeventd.static
46 1.1 haad
47 1.1 haad ifneq ($(MAKECMDGOALS),device-mapper)
48 1.1 haad SUBDIRS+=plugins
49 1.1 haad endif
50 1.1 haad
51 1.1.1.2 haad include ../../make.tmpl
52 1.1 haad
53 1.1.1.2 haad all: device-mapper
54 1.1.1.2 haad device-mapper: $(TARGETS)
55 1.1 haad
56 1.1.1.2 haad LIBS += -ldl
57 1.1.1.2 haad LVMLIBS += -ldevmapper-event -lpthread -ldevmapper
58 1.1 haad
59 1.1.1.2 haad $(VERSIONED_SHLIB): $(LIB_SHARED)
60 1.1.1.2 haad $(RM) -f $@
61 1.1.1.2 haad $(LN_S) $(LIB_SHARED) $@
62 1.1 haad
63 1.1.1.2 haad dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
64 1.1.1.2 haad $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
65 1.1.1.2 haad $(LVMLIBS) $(LIBS) -rdynamic
66 1.1 haad
67 1.1.1.2 haad dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacedir)/libdevmapper.a
68 1.1.1.2 haad $(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacedir) -o $@ \
69 1.1.1.2 haad dmeventd.o $(LVMLIBS) $(LIBS) -rdynamic
70 1.1 haad
71 1.1 haad ifeq ("no", "yes")
72 1.1.1.2 haad INSTALL_LIB_TARGETS += install_pkgconfig
73 1.1 haad endif
74 1.1 haad
75 1.1 haad install_include:
76 1.1.1.2 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 444 $(srcdir)/libdevmapper-event.h \
77 1.1 haad $(includedir)/libdevmapper-event.h
78 1.1 haad
79 1.1.1.2 haad install_pkgconfig:
80 1.1.1.2 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.pc \
81 1.1.1.2 haad $(usrlibdir)/pkgconfig/devmapper-event.pc
82 1.1.1.2 haad
83 1.1.1.2 haad install_lib_dynamic: libdevmapper-event.$(LIB_SUFFIX)
84 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
85 1.1 haad $(libdir)/libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION)
86 1.1 haad $(LN_S) -f libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) \
87 1.1 haad $(libdir)/libdevmapper-event.$(LIB_SUFFIX)
88 1.1 haad
89 1.1.1.2 haad install_lib_static: libdevmapper-event.a
90 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
91 1.1 haad $(libdir)/libdevmapper-event.a.$(LIB_VERSION)
92 1.1 haad $(LN_S) -f libdevmapper-event.a.$(LIB_VERSION) $(libdir)/libdevmapper-event.a
93 1.1 haad
94 1.1.1.2 haad install_lib: $(INSTALL_LIB_TARGETS)
95 1.1.1.2 haad
96 1.1.1.2 haad install_dmeventd_dynamic: dmeventd
97 1.1.1.2 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
98 1.1.1.2 haad
99 1.1.1.2 haad install_dmeventd_static: dmeventd.static
100 1.1.1.2 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
101 1.1.1.2 haad
102 1.1.1.2 haad install_dmeventd: $(INSTALL_DMEVENTD_TARGETS)
103 1.1.1.2 haad
104 1.1.1.2 haad install: install_include install_lib install_dmeventd
105 1.1.1.2 haad
106 1.1.1.2 haad install_device-mapper: install_include install_lib install_dmeventd
107 1.1 haad
108 1.1 haad .PHONY: distclean_lib distclean
109 1.1 haad
110 1.1 haad distclean_lib:
111 1.1 haad $(RM) libdevmapper-event.pc
112 1.1 haad
113 1.1 haad distclean: distclean_lib
114 1.1 haad
115