Makefile revision 1.1 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 haad
17 1.1 haad
18 1.1 haad SOURCES = libdevmapper-event.c
19 1.1 haad
20 1.1 haad LIB_STATIC = libdevmapper-event.a
21 1.1 haad LIB_VERSION = $(LIB_VERSION_DM)
22 1.1 haad
23 1.1 haad ifeq ("","dylib")
24 1.1 haad LIB_SHARED = libdevmapper-event.dylib
25 1.1 haad else
26 1.1 haad LIB_SHARED = libdevmapper-event.so
27 1.1 haad VERSIONED_SHLIB = $(LIB_SHARED).$(LIB_VERSION)
28 1.1 haad endif
29 1.1 haad
30 1.1 haad TARGETS = dmeventd
31 1.1 haad CLEAN_TARGETS = dmeventd.o
32 1.1 haad
33 1.1 haad ifneq ($(MAKECMDGOALS),device-mapper)
34 1.1 haad SUBDIRS+=plugins
35 1.1 haad endif
36 1.1 haad
37 1.1 haad include $(top_srcdir)/make.tmpl
38 1.1 haad
39 1.1 haad all: dmeventd
40 1.1 haad device-mapper: dmeventd
41 1.1 haad
42 1.1 haad LDFLAGS += -ldl -ldevmapper -lpthread
43 1.1 haad CLDFLAGS += -ldl -ldevmapper -lpthread
44 1.1 haad
45 1.1 haad dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
46 1.1 haad $(CC) -o $@ dmeventd.o $(CFLAGS) $(LDFLAGS) \
47 1.1 haad -L. -ldevmapper-event $(LIBS) -rdynamic
48 1.1 haad
49 1.1 haad .PHONY: install_dynamic install_static install_include \
50 1.1 haad install_pkgconfig install_dmeventd
51 1.1 haad
52 1.1 haad INSTALL_TYPE = install_dynamic
53 1.1 haad
54 1.1 haad ifeq ("no", "yes")
55 1.1 haad INSTALL_TYPE += install_static
56 1.1 haad endif
57 1.1 haad
58 1.1 haad ifeq ("no", "yes")
59 1.1 haad INSTALL_TYPE += install_pkgconfig
60 1.1 haad endif
61 1.1 haad
62 1.1 haad install: $(INSTALL_TYPE) install_include install_dmeventd
63 1.1 haad
64 1.1 haad install_device-mapper: install
65 1.1 haad
66 1.1 haad install_include:
67 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.h \
68 1.1 haad $(includedir)/libdevmapper-event.h
69 1.1 haad
70 1.1 haad install_dynamic: libdevmapper-event.$(LIB_SUFFIX)
71 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
72 1.1 haad $(libdir)/libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION)
73 1.1 haad $(LN_S) -f libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) \
74 1.1 haad $(libdir)/libdevmapper-event.$(LIB_SUFFIX)
75 1.1 haad
76 1.1 haad install_dmeventd: dmeventd
77 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$<
78 1.1 haad
79 1.1 haad install_pkgconfig:
80 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.pc \
81 1.1 haad $(usrlibdir)/pkgconfig/devmapper-event.pc
82 1.1 haad
83 1.1 haad install_static: libdevmapper-event.a
84 1.1 haad $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
85 1.1 haad $(libdir)/libdevmapper-event.a.$(LIB_VERSION)
86 1.1 haad $(LN_S) -f libdevmapper-event.a.$(LIB_VERSION) $(libdir)/libdevmapper-event.a
87 1.1 haad
88 1.1 haad $(VERSIONED_SHLIB): $(LIB_SHARED)
89 1.1 haad $(RM) -f $@
90 1.1 haad $(LN_S) $(LIB_SHARED) $@
91 1.1 haad
92 1.1 haad .PHONY: distclean_lib distclean
93 1.1 haad
94 1.1 haad distclean_lib:
95 1.1 haad $(RM) libdevmapper-event.pc
96 1.1 haad
97 1.1 haad distclean: distclean_lib
98 1.1 haad
99