]>
Commit | Line | Data |
---|---|---|
795ca3e5 AK |
1 | # @configure_input@ |
2 | # | |
6606c3ae | 3 | # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. |
a532faa7 | 4 | # Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. |
795ca3e5 | 5 | # |
7f8f8bfa | 6 | # This file is part of LVM2. |
795ca3e5 | 7 | # |
6606c3ae AK |
8 | # This copyrighted material is made available to anyone wishing to use, |
9 | # modify, copy, or redistribute it subject to the terms and conditions | |
10 | # of the GNU General Public License v.2. | |
795ca3e5 | 11 | # |
6606c3ae AK |
12 | # You should have received a copy of the GNU General Public License |
13 | # along with this program; if not, write to the Free Software Foundation, | |
14 | # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
795ca3e5 AK |
15 | |
16 | SHELL = /bin/sh | |
17 | ||
18 | @SET_MAKE@ | |
19 | ||
f42b2d4b | 20 | CC ?= @CC@ |
795ca3e5 | 21 | RANLIB = @RANLIB@ |
795ca3e5 | 22 | INSTALL = @INSTALL@ |
5556819a | 23 | MKDIR_P = @MKDIR_P@ |
69792976 | 24 | MSGFMT = @MSGFMT@ |
5556819a AK |
25 | LCOV = @LCOV@ |
26 | GENHTML = @GENHTML@ | |
795ca3e5 | 27 | LN_S = @LN_S@ |
5951ef33 | 28 | SED = @SED@ |
87d73a9b | 29 | CFLOW_CMD = @CFLOW_CMD@ |
aaa2e046 | 30 | AWK = @AWK@ |
5951ef33 | 31 | |
5f68d858 | 32 | LIBS = @LIBS@ |
f8f6ec92 | 33 | # Extra libraries always linked with static binaries |
db724a44 | 34 | STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) |
72b2cb61 | 35 | DEFS += @DEFS@ |
e8fad838 | 36 | CFLAGS += @CFLAGS@ |
84510264 | 37 | CLDFLAGS += @CLDFLAGS@ |
bf09a320 | 38 | ELDFLAGS += @ELDFLAGS@ |
80992638 AK |
39 | LDDEPS += @LDDEPS@ |
40 | LDFLAGS += @LDFLAGS@ | |
e4c11ad1 | 41 | LIB_SUFFIX = @LIB_SUFFIX@ |
7126d8c2 | 42 | LVMINTERNAL_LIBS = -llvm-internal $(DAEMON_LIBS) $(UDEV_LIBS) $(DL_LIBS) |
19a2c6e0 | 43 | DL_LIBS = @DL_LIBS@ |
f30875db | 44 | PTHREAD_LIBS = @PTHREAD_LIBS@ |
539f4a77 | 45 | READLINE_LIBS = @READLINE_LIBS@ |
f8f6ec92 | 46 | SELINUX_LIBS = @SELINUX_LIBS@ |
db724a44 | 47 | UDEV_LIBS = @UDEV_LIBS@ |
1033d120 | 48 | TESTING = @TESTING@ |
795ca3e5 AK |
49 | |
50 | # Setup directory variables | |
639c84c1 AK |
51 | prefix = @prefix@ |
52 | exec_prefix = @exec_prefix@ | |
5d518f1f | 53 | udev_prefix = @udev_prefix@ |
4417a8bd | 54 | sysconfdir = @sysconfdir@ |
639c84c1 | 55 | bindir = $(DESTDIR)@bindir@ |
4a7f3eb2 | 56 | confdir = $(DESTDIR)@CONFDIR@/lvm |
84510264 | 57 | includedir = $(DESTDIR)@includedir@ |
639c84c1 | 58 | libdir = $(DESTDIR)@libdir@ |
68f2de6d | 59 | usrlibdir = $(DESTDIR)@usrlibdir@ |
639c84c1 | 60 | sbindir = $(DESTDIR)@sbindir@ |
68f2de6d | 61 | usrsbindir = $(DESTDIR)@usrsbindir@ |
bf75c304 AK |
62 | datarootdir = @datarootdir@ |
63 | infodir = $(DESTDIR)@infodir@ | |
64 | mandir = $(DESTDIR)@mandir@ | |
639c84c1 | 65 | localedir = $(DESTDIR)@LOCALEDIR@ |
0a62c911 | 66 | staticdir = $(DESTDIR)@STATICDIR@ |
5d518f1f | 67 | udevdir = $(DESTDIR)@udevdir@ |
fff111fe | 68 | pkgconfigdir = $(usrlibdir)/pkgconfig |
4417a8bd | 69 | initdir = $(DESTDIR)$(sysconfdir)/rc.d/init.d |
fa68466e PR |
70 | systemd_unit_dir = $(DESTDIR)@systemdsystemunitdir@ |
71 | systemd_generator_dir = $(DESTDIR)@systemdutildir@/system-generators | |
4417a8bd | 72 | tmpfiles_dir = $(DESTDIR)@tmpfilesdir@ |
349da06c | 73 | ocf_scriptdir = $(DESTDIR)@OCFDIR@ |
afcae066 | 74 | |
5227ae53 | 75 | USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \ |
aaa2e046 | 76 | $(AWK) -f $(top_srcdir)/scripts/relpath.awk) |
795ca3e5 | 77 | |
3399ae32 AK |
78 | DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@ |
79 | DEFAULT_ARCHIVE_DIR = $(DEFAULT_SYS_DIR)/@DEFAULT_ARCHIVE_SUBDIR@ | |
80 | DEFAULT_BACKUP_DIR = $(DEFAULT_SYS_DIR)/@DEFAULT_BACKUP_SUBDIR@ | |
81 | DEFAULT_CACHE_DIR = $(DEFAULT_SYS_DIR)/@DEFAULT_CACHE_SUBDIR@ | |
82 | DEFAULT_LOCK_DIR = @DEFAULT_LOCK_DIR@ | |
1fad9a68 | 83 | DEFAULT_RUN_DIR = @DEFAULT_RUN_DIR@ |
3399ae32 | 84 | |
c737d348 ZK |
85 | # Setup vpath search paths for some suffixes |
86 | vpath %.c $(srcdir) | |
87 | vpath %.in $(srcdir) | |
88 | vpath %.po $(srcdir) | |
89 | vpath %.exported_symbols $(srcdir) | |
90 | ||
2c44337b | 91 | interface = @interface@ |
f7729ec6 | 92 | interfacebuilddir = $(top_builddir)/libdm/$(interface) |
2c44337b | 93 | |
795ca3e5 AK |
94 | # The number of jobs to run, if blank, defaults to the make standard |
95 | ifndef MAKEFLAGS | |
96 | MAKEFLAGS = @JOBS@ | |
97 | endif | |
98 | ||
23b059e7 ZK |
99 | # Handle installation of files |
100 | ifeq ("@WRITE_INSTALL@", "yes") | |
101 | # leaving defaults | |
3e730d47 | 102 | M_INSTALL_SCRIPT = |
23b059e7 ZK |
103 | M_INSTALL_DATA = -m 644 |
104 | else | |
105 | M_INSTALL_PROGRAM = -m 555 | |
106 | M_INSTALL_DATA = -m 444 | |
107 | endif | |
108 | INSTALL_PROGRAM = $(INSTALL) $(M_INSTALL_PROGRAM) $(STRIP) | |
109 | INSTALL_DATA = $(INSTALL) -p $(M_INSTALL_DATA) | |
110 | INSTALL_WDATA = $(INSTALL) -p -m 644 | |
111 | ||
a532faa7 ZK |
112 | INSTALL_DIR = $(INSTALL) -m 755 -d |
113 | INSTALL_ROOT_DIR = $(INSTALL) -m 700 -d | |
114 | INSTALL_ROOT_DATA = $(INSTALL) -m 600 | |
85409909 | 115 | INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM) |
3399ae32 | 116 | |
8a2fc586 | 117 | .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib |
795ca3e5 | 118 | |
4b795cc3 ZK |
119 | WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \ |
120 | -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ | |
121 | -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls \ | |
122 | -Wpointer-arith | |
03a8a07d | 123 | |
4b795cc3 ZK |
124 | #WFLAGS += -W -Wconversion -Wbad-function-cast -Wcast-qual |
125 | #WFLAGS += -pedantic -std=gnu99 | |
126 | #DEFS += -DDEBUG_CRC32 | |
8ef2b021 | 127 | |
4b795cc3 | 128 | CFLAGS += -fPIC @COPTIMISE_FLAG@ |
d6a05ea5 | 129 | LDFLAGS += @COPTIMISE_FLAG@ |
8ce0cbda | 130 | |
8ef2b021 | 131 | ifeq ("@DEBUG@", "yes") |
8a2fc586 AK |
132 | CFLAGS += -g -fno-omit-frame-pointer |
133 | DEFS += -DDEBUG | |
81d19574 MB |
134 | # memory debugging is not thread-safe yet |
135 | ifneq ("@DMEVENTD@", "yes") | |
136 | DEFS += -DDEBUG_MEM | |
137 | endif | |
8ef2b021 | 138 | endif |
03a8a07d | 139 | |
69792976 | 140 | ifeq ("@INTL@", "yes") |
8a2fc586 | 141 | DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\" |
69792976 AK |
142 | endif |
143 | ||
db8b5af9 AK |
144 | LDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib |
145 | CLDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib | |
03a8a07d | 146 | |
7126d8c2 AK |
147 | ifeq ("@BUILD_LVMETAD@", "yes") |
148 | DAEMON_LIBS = -ldaemonclient | |
149 | LDFLAGS += -L$(top_builddir)/libdaemon/client | |
150 | CLDFLAGS += -L$(top_builddir)/libdaemon/client | |
151 | endif | |
152 | ||
a479de2e | 153 | ifeq ("@DMEVENTD@", "yes") |
db8b5af9 AK |
154 | LDFLAGS += -L$(top_builddir)/daemons/dmeventd |
155 | CLDFLAGS += -L$(top_builddir)/daemons/dmeventd | |
a479de2e AK |
156 | endif |
157 | ||
e50d0e97 AK |
158 | ifeq ("@DM_COMPAT@", "yes") |
159 | DEFS += -DDM_COMPAT | |
160 | endif | |
161 | ||
162 | ifeq ("@DM_IOCTLS@", "yes") | |
163 | DEFS += -DDM_IOCTLS | |
164 | endif | |
165 | ||
ed463ccf | 166 | # Combination of DEBUG_POOL and DEBUG_ENFORCE_POOL_LOCKING is not suppored. |
8a2fc586 | 167 | #DEFS += -DDEBUG_POOL |
ed463ccf ZK |
168 | # Default pool locking is using the crc checksum. With mprotect memory |
169 | # enforcing compilation faulty memory write could be easily found. | |
170 | #DEFS += -DDEBUG_ENFORCE_POOL_LOCKING | |
8a2fc586 | 171 | #DEFS += -DBOUNDS_CHECK |
84510264 AK |
172 | |
173 | #CFLAGS += -pg | |
80992638 | 174 | #LDFLAGS += -pg |
84510264 AK |
175 | |
176 | STRIP= | |
177 | #STRIP = -s | |
8ef2b021 | 178 | |
5951ef33 AK |
179 | LVM_VERSION := $(shell cat $(top_srcdir)/VERSION) |
180 | ||
047f82ee | 181 | LIB_VERSION_LVM := $(shell $(AWK) -F '.' '{printf "%s.%s",$$1,$$2}' $(top_srcdir)/VERSION) |
2c44337b | 182 | |
047f82ee | 183 | LIB_VERSION_DM := $(shell $(AWK) -F '.' '{printf "%s.%s",$$1,$$2}' $(top_srcdir)/VERSION_DM) |
5a52dca9 | 184 | |
047f82ee | 185 | LIB_VERSION_APP := $(shell $(AWK) -F '[(). ]' '{printf "%s.%s",$$1,$$4}' $(top_srcdir)/VERSION) |
bf456146 | 186 | |
db8b5af9 | 187 | INCLUDES += -I. -I$(top_builddir)/include |
795ca3e5 | 188 | |
db8b5af9 | 189 | INC_LNS = $(top_builddir)/include/.symlinks_created |
a03f2320 | 190 | |
db8b5af9 AK |
191 | DEPS = $(top_builddir)/make.tmpl $(top_srcdir)/VERSION \ |
192 | $(top_builddir)/Makefile $(INC_LNS) | |
14c61d2d | 193 | |
84510264 AK |
194 | OBJECTS = $(SOURCES:%.c=%.o) |
195 | POTFILES = $(SOURCES:%.c=%.pot) | |
795ca3e5 | 196 | |
7cbd4a74 ZK |
197 | .PHONY: all pofile distclean clean cleandir cflow device-mapper |
198 | .PHONY: install install_cluster install_device-mapper install_lvm2 | |
180b3dea | 199 | .PHONY: install_lib_shared install_dm_plugin install_lvm2_plugin |
a59c3731 | 200 | .PHONY: install_ocf help |
cab8ea7c | 201 | .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean) |
8a2fc586 | 202 | .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow) |
0782ad50 | 203 | .PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper) |
cab8ea7c | 204 | |
0782ad50 | 205 | SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper) |
795ca3e5 | 206 | SUBDIRS.install := $(SUBDIRS:=.install) |
cab8ea7c | 207 | SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster) |
0782ad50 | 208 | SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper) |
0b502933 | 209 | SUBDIRS.install_lvm2 := $(SUBDIRS:=.install_lvm2) |
e40d44be | 210 | SUBDIRS.install_ocf := $(SUBDIRS:=.install_ocf) |
69792976 | 211 | SUBDIRS.pofile := $(SUBDIRS:=.pofile) |
8a2fc586 | 212 | SUBDIRS.cflow := $(SUBDIRS:=.cflow) |
795ca3e5 AK |
213 | SUBDIRS.clean := $(SUBDIRS:=.clean) |
214 | SUBDIRS.distclean := $(SUBDIRS:=.distclean) | |
215 | ||
23b059e7 | 216 | TARGETS += $(LIB_SHARED) $(LIB_STATIC) |
d68a82ec | 217 | |
795ca3e5 AK |
218 | all: $(SUBDIRS) $(TARGETS) |
219 | ||
220 | install: all $(SUBDIRS.install) | |
cab8ea7c | 221 | install_cluster: all $(SUBDIRS.install_cluster) |
0782ad50 | 222 | install_device-mapper: $(SUBDIRS.install_device-mapper) |
0b502933 | 223 | install_lvm2: $(SUBDIRS.install_lvm2) |
e40d44be | 224 | install_ocf: $(SUBDIRS.install_ocf) |
b41f5924 | 225 | cflow: $(SUBDIRS.cflow) |
795ca3e5 | 226 | |
bef749c9 | 227 | $(SUBDIRS): $(SUBDIRS.device-mapper) |
795ca3e5 AK |
228 | $(MAKE) -C $@ |
229 | ||
0782ad50 AK |
230 | $(SUBDIRS.device-mapper): |
231 | $(MAKE) -C $(@:.device-mapper=) device-mapper | |
232 | ||
3ba1348c | 233 | $(SUBDIRS.install): $(SUBDIRS) |
795ca3e5 AK |
234 | $(MAKE) -C $(@:.install=) install |
235 | ||
cab8ea7c AK |
236 | $(SUBDIRS.install_cluster): $(SUBDIRS) |
237 | $(MAKE) -C $(@:.install_cluster=) install_cluster | |
238 | ||
77b69aa7 | 239 | $(SUBDIRS.install_device-mapper): device-mapper |
0782ad50 AK |
240 | $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper |
241 | ||
0b502933 MB |
242 | $(SUBDIRS.install_lvm2): $(SUBDIRS) |
243 | $(MAKE) -C $(@:.install_lvm2=) install_lvm2 | |
244 | ||
e40d44be ZK |
245 | $(SUBDIRS.install_ocf): |
246 | $(MAKE) -C $(@:.install_ocf=) install_ocf | |
247 | ||
795ca3e5 | 248 | $(SUBDIRS.clean): |
5a52dca9 | 249 | -$(MAKE) -C $(@:.clean=) clean |
795ca3e5 AK |
250 | |
251 | $(SUBDIRS.distclean): | |
5a52dca9 | 252 | -$(MAKE) -C $(@:.distclean=) distclean |
795ca3e5 | 253 | |
b41f5924 ZK |
254 | $(SUBDIRS.cflow): |
255 | $(MAKE) -C $(@:.cflow=) cflow | |
256 | ||
69792976 AK |
257 | ifeq ("@INTL@", "yes") |
258 | pofile: $(SUBDIRS.pofile) $(POTFILES) | |
259 | ||
260 | $(SUBDIRS.pofile): | |
261 | $(MAKE) -C $(@:.pofile=) pofile | |
262 | endif | |
263 | ||
b41f5924 ZK |
264 | ifneq ("$(CFLOW_LIST_TARGET)", "") |
265 | CLEAN_CFLOW += $(CFLOW_LIST_TARGET) | |
266 | $(CFLOW_LIST_TARGET): $(CFLOW_LIST) | |
267 | echo "CFLOW_SOURCES += $(addprefix \ | |
268 | \$$(top_srcdir)$(subst $(top_srcdir),,$(srcdir))/, $(CFLOW_LIST))" > $@ | |
269 | cflow: $(CFLOW_LIST_TARGET) | |
270 | endif | |
8a2fc586 | 271 | |
b41f5924 ZK |
272 | ifneq ("$(CFLOW_TARGET)", "") |
273 | CLEAN_CFLOW += \ | |
274 | $(CFLOW_TARGET).cflow \ | |
275 | $(CFLOW_TARGET).xref \ | |
276 | $(CFLOW_TARGET).tree \ | |
277 | $(CFLOW_TARGET).rtree \ | |
278 | $(CFLOW_TARGET).rxref | |
279 | ||
280 | ifneq ("$(CFLOW_CMD)", "") | |
281 | CFLOW_FLAGS +=\ | |
282 | --cpp="$(CC) -E" \ | |
283 | --symbol _ISbit:wrapper \ | |
284 | --symbol __attribute__:wrapper \ | |
285 | --symbol __const__:wrapper \ | |
286 | --symbol __const:type \ | |
287 | --symbol __restrict:type \ | |
288 | --symbol __extension__:wrapper \ | |
289 | --symbol __nonnull:wrapper \ | |
290 | --symbol __nothrow__:wrapper \ | |
291 | --symbol __pure__:wrapper \ | |
292 | --symbol __REDIRECT:wrapper \ | |
293 | --symbol __REDIRECT_NTH:wrapper \ | |
294 | --symbol __wur:wrapper \ | |
295 | -I$(top_srcdir)/libdm \ | |
296 | -I$(top_srcdir)/libdm/ioctl \ | |
297 | -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2/ \ | |
298 | $(INCLUDES) $(DEFS) | |
299 | ||
300 | $(CFLOW_TARGET).cflow: $(CFLOW_SOURCES) | |
301 | $(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) $(CFLOW_SOURCES) | |
302 | $(CFLOW_TARGET).rxref: $(CFLOW_SOURCES) | |
303 | $(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) -r --omit-arguments $(CFLOW_SOURCES) | |
304 | $(CFLOW_TARGET).tree: $(CFLOW_SOURCES) | |
305 | $(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) --omit-arguments -T -b $(CFLOW_SOURCES) | |
306 | $(CFLOW_TARGET).xref: $(CFLOW_SOURCES) | |
307 | $(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) --omit-arguments -x $(CFLOW_SOURCES) | |
308 | #$(CFLOW_TARGET).rtree: $(CFLOW_SOURCES) | |
309 | # $(CFLOW_CMD) -o$@ $(CFLOW_FLAGS) -r --omit-arguments -T -b $(CFLOW_SOURCES) | |
310 | cflow: $(CFLOW_TARGET).cflow $(CFLOW_TARGET).tree $(CFLOW_TARGET).rxref $(CFLOW_TARGET).xref | |
311 | #$(CFLOW_TARGET).rtree | |
312 | endif | |
8a2fc586 AK |
313 | endif |
314 | ||
84510264 AK |
315 | $(TARGETS): $(OBJECTS) |
316 | ||
795ca3e5 | 317 | %.o: %.c |
4b795cc3 | 318 | $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $< -o $@ |
795ca3e5 | 319 | |
c5ff6dfa | 320 | %.pot: %.c Makefile |
25fbec5b | 321 | $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \ |
4b795cc3 | 322 | $(DEFS) $(WFLAGS) $(CFLAGS) $< > $@ |
69792976 | 323 | |
5a52dca9 | 324 | %.so: %.o |
4b795cc3 | 325 | $(CC) -c $(CFLAGS) $(CLDFLAGS) $< $(LIBS) -o $@ |
5a52dca9 | 326 | |
23b059e7 ZK |
327 | ifneq (,$(LIB_SHARED)) |
328 | ||
329 | TARGETS += $(LIB_SHARED).$(LIB_VERSION) | |
330 | $(LIB_SHARED).$(LIB_VERSION): $(OBJECTS) $(LDDEPS) | |
e4c11ad1 | 331 | ifeq ("@LIB_SUFFIX@","so") |
23b059e7 ZK |
332 | $(CC) -shared -Wl,-soname,$(notdir $@) \ |
333 | $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@ | |
e4c11ad1 | 334 | endif |
e4c11ad1 | 335 | ifeq ("@LIB_SUFFIX@","dylib") |
e4c11ad1 | 336 | $(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \ |
23b059e7 ZK |
337 | $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@ |
338 | endif | |
339 | ||
340 | $(LIB_SHARED): $(LIB_SHARED).$(LIB_VERSION) | |
341 | $(LN_S) -f $(<F) $@ | |
342 | ||
343 | install_lib_shared: $(LIB_SHARED) | |
344 | $(INSTALL_PROGRAM) -D $< $(libdir)/$(<F).$(LIB_VERSION) | |
0337d991 | 345 | $(INSTALL_DIR) $(usrlibdir) |
5227ae53 | 346 | $(LN_S) -f $(USRLIB_RELPATH)$(<F).$(LIB_VERSION) $(usrlibdir)/$(<F) |
23b059e7 | 347 | |
180b3dea ZK |
348 | # FIXME: plugins are installed to subdirs |
349 | # and for compatibility links in libdir are created | |
350 | # when the code is fixed links could be removed. | |
351 | install_dm_plugin: $(LIB_SHARED) | |
352 | $(INSTALL_PROGRAM) -D $< $(libdir)/device-mapper/$(<F) | |
353 | $(LN_S) -f device-mapper/$(<F) $(libdir)/$(<F) | |
180b3dea ZK |
354 | |
355 | install_lvm2_plugin: $(LIB_SHARED) | |
356 | $(INSTALL_PROGRAM) -D $< $(libdir)/lvm2/$(<F) | |
357 | $(LN_S) -f lvm2/$(<F) $(libdir)/$(<F) | |
358 | $(LN_S) -f $(<F) $(libdir)/$(<F).$(LIB_VERSION) | |
e4c11ad1 | 359 | endif |
84510264 AK |
360 | |
361 | $(LIB_STATIC): $(OBJECTS) | |
362 | $(RM) $@ | |
363 | $(AR) rs $@ $(OBJECTS) | |
5a52dca9 | 364 | |
795ca3e5 | 365 | %.d: %.c |
db8b5af9 | 366 | $(MKDIR_P) $(dir $@); \ |
84510264 AK |
367 | set -e; \ |
368 | FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \ | |
369 | DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \ | |
4b795cc3 | 370 | $(CC) -MM $(INCLUDES) $(DEFS) -o $@ $<; \ |
db8b5af9 | 371 | sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \ |
84510264 | 372 | [ -s $@ ] || $(RM) $@ |
795ca3e5 | 373 | |
69792976 AK |
374 | %.mo: %.po |
375 | $(MSGFMT) -o $@ $< | |
376 | ||
7cbd4a74 | 377 | cleandir: |
b7be589e | 378 | $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(CLEAN_CFLOW) $(LDDEPS) \ |
7cbd4a74 | 379 | $(POTFILES) $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.gcno) $(SOURCES:%.c=%.gcda) \ |
40dbaac8 | 380 | $(SOURCES2:%.c=%.o) $(SOURCES2:%.c=%.d) $(SOURCES2:%.c=%.gcno) $(SOURCES2:%.c=%.gcda) \ |
62675fdc | 381 | .exported_symbols_generated core |
795ca3e5 | 382 | |
7cbd4a74 ZK |
383 | clean: $(SUBDIRS.clean) cleandir |
384 | ||
385 | distclean: cleandir $(SUBDIRS.distclean) | |
e83968fa | 386 | test -z "$(DISTCLEAN_DIRS)" || $(RM) -r $(DISTCLEAN_DIRS) |
358fddb4 | 387 | $(RM) $(DISTCLEAN_TARGETS) Makefile |
84510264 | 388 | |
8b205571 AK |
389 | .exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols |
390 | set -e; \ | |
391 | ( cat $(srcdir)/.exported_symbols; \ | |
392 | if test x$(EXPORTED_HEADER) != x; then \ | |
4b795cc3 ZK |
393 | $(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \ |
394 | $(SED) -ne "/^typedef|}/!s/.*[ \*]\(\$(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \ | |
8b205571 AK |
395 | fi \ |
396 | ) > $@ | |
397 | ||
398 | .export.sym: .exported_symbols_generated | |
aba2aca3 | 399 | set -e; (echo "Base {"; echo " global:"; \ |
84510264 AK |
400 | sed "s/^/ /;s/$$/;/" < $<; \ |
401 | echo " local:"; echo " *;"; echo "};") > $@ | |
795ca3e5 | 402 | |
a59c3731 ZK |
403 | ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \ |
404 | help check check_local check_cluster check_lvmetad)) | |
795ca3e5 AK |
405 | ifdef SOURCES |
406 | -include $(SOURCES:.c=.d) | |
407 | endif | |
3649fa9e PR |
408 | ifdef SOURCES2 |
409 | -include $(SOURCES2:.c=.d) | |
410 | endif | |
b41f5924 | 411 | endif |