Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / make.tmpl
blob83dcdec2bea980f7791a0738dd63ea9e87223883
1 # make.tmpl.  Generated from make.tmpl.in by configure.
3 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
4 # Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
6 # This file is part of LVM2.
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.
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
16 SHELL = /bin/sh
20 CC = gcc
21 RANLIB = ranlib
22 SHELL = /bin/sh
23 INSTALL = /usr/bin/install -c
24 MKDIR_P = autoconf/install-sh -c -d
25 MSGFMT = 
26 LCOV = 
27 GENHTML = 
28 LN_S = ln -s
29 SED = /usr/bin/sed
31 LIBS = 
32 DEFS += -DHAVE_CONFIG_H
33 CFLAGS += -g -O2
34 CLDFLAGS += 
35 LDDEPS += 
36 LDFLAGS += 
37 LIB_SUFFIX = 
39 # Setup directory variables
40 prefix = /usr
41 exec_prefix = 
42 udev_prefix = ${exec_prefix}
43 bindir = $(DESTDIR)${exec_prefix}/bin
44 confdir = $(DESTDIR)/etc/lvm
45 includedir = $(DESTDIR)${prefix}/include
46 libdir = $(DESTDIR)${exec_prefix}/lib
47 usrlibdir = $(DESTDIR)${prefix}/lib
48 sbindir = $(DESTDIR)${exec_prefix}/sbin
49 usrsbindir = $(DESTDIR)${prefix}/sbin
50 infodir = $(DESTDIR)${prefix}/share/info
51 mandir = $(DESTDIR)${prefix}/share/man
52 localedir = $(DESTDIR)
53 staticdir = $(DESTDIR)${exec_prefix}/sbin
54 udevdir = $(DESTDIR)${udev_prefix}/lib/udev/rules.d
56 interface = ioctl
57 interfacedir = $(top_srcdir)/libdm/$(interface)
59 # setup misc variables
60 # define the ownership variables for the binaries and man pages
61 OWNER = 
62 GROUP = 
64 # The number of jobs to run, if blank, defaults to the make standard
65 ifndef MAKEFLAGS
66 MAKEFLAGS = 
67 endif
69 .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
71 CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security
73 #CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual
74 #CFLAGS += -pedantic -std=gnu99
76 CFLAGS += 
78 ifeq ("no", "yes")
79   CFLAGS += -g -fno-omit-frame-pointer
80   DEFS += -DDEBUG
81   DEFS += -DDEBUG_MEM
82 endif
84 ifeq ("no", "yes")
85   DEFS += -DINTL_PACKAGE=\"\" -DLOCALEDIR=\"\"
86 endif
88 LDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
89 CLDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
91 ifeq ("", "yes")
92   LDFLAGS += -L$(top_builddir)/daemons/dmeventd
93   CLDFLAGS += -L$(top_builddir)/daemons/dmeventd
94 endif
96 ifeq ("no", "yes")
97   DEFS += -DDM_COMPAT
98 endif
100 ifeq ("", "yes")
101   DEFS += -DDM_IOCTLS
102 endif
104 #DEFS += -DDEBUG_POOL
105 #DEFS += -DBOUNDS_CHECK
107 #CFLAGS += -pg
108 #LDFLAGS += -pg
110 STRIP=
111 #STRIP = -s
113 LVM_VERSION := $(shell cat $(top_srcdir)/VERSION)
115 LIB_VERSION_LVM := $(shell cat $(top_srcdir)/VERSION | \
116                      awk -F '.' '{printf "%s.%s",$$1,$$2}')
118 LIB_VERSION_DM := $(shell cat $(top_srcdir)/VERSION_DM | \
119                     awk -F '.' '{printf "%s.%s",$$1,$$2}')
121 LIB_VERSION_APP := $(shell cat $(top_srcdir)/VERSION | \
122                      awk -F '[(). ]' '{printf "%s.%s",$$1,$$4}')
124 INCLUDES += -I. -I$(top_builddir)/include
126 INC_LNS = $(top_builddir)/include/.symlinks_created
128 DEPS = $(top_builddir)/make.tmpl $(top_srcdir)/VERSION \
129        $(top_builddir)/Makefile $(INC_LNS)
131 OBJECTS = $(SOURCES:%.c=%.o)
132 POTFILES = $(SOURCES:%.c=%.pot)
134 .PHONY: all install install_cluster pofile distclean clean cflow device-mapper 
135 .PHONY: install_device-mapper install_lvm2
136 .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
137 .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
138 .PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper)
140 SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper)
141 SUBDIRS.install := $(SUBDIRS:=.install)
142 SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster)
143 SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper)
144 SUBDIRS.install_lvm2 := $(SUBDIRS:=.install_lvm2)
145 SUBDIRS.pofile := $(SUBDIRS:=.pofile)
146 SUBDIRS.cflow := $(SUBDIRS:=.cflow)
147 SUBDIRS.clean := $(SUBDIRS:=.clean)
148 SUBDIRS.distclean := $(SUBDIRS:=.distclean)
150 TARGETS += $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB)
152 all: $(SUBDIRS) $(TARGETS)
154 install: all $(SUBDIRS.install)
155 install_cluster: all $(SUBDIRS.install_cluster)
156 install_device-mapper: $(SUBDIRS.install_device-mapper)
157 install_lvm2: $(SUBDIRS.install_lvm2)
159 $(SUBDIRS): $(SUBDIRS.device-mapper)
160         $(MAKE) -C $@
162 $(SUBDIRS.device-mapper):
163         $(MAKE) -C $(@:.device-mapper=) device-mapper
165 $(SUBDIRS.install): $(SUBDIRS)
166         $(MAKE) -C $(@:.install=) install
168 $(SUBDIRS.install_cluster): $(SUBDIRS)
169         $(MAKE) -C $(@:.install_cluster=) install_cluster
171 $(SUBDIRS.install_device-mapper): device-mapper
172         $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper
174 $(SUBDIRS.install_lvm2): $(SUBDIRS)
175         $(MAKE) -C $(@:.install_lvm2=) install_lvm2
177 $(SUBDIRS.clean):
178         -$(MAKE) -C $(@:.clean=) clean
180 $(SUBDIRS.distclean):
181         -$(MAKE) -C $(@:.distclean=) distclean
183 ifeq ("no", "yes")
184 pofile: $(SUBDIRS.pofile) $(POTFILES)
186 $(SUBDIRS.pofile):
187         $(MAKE) -C $(@:.pofile=) pofile
188 endif
190 ifneq ("", "")
191 cflow: $(SUBDIRS.cflow)
193 $(SUBDIRS.cflow):
194         $(MAKE) -C $(@:.cflow=) cflow
195 endif
197 $(TARGETS): $(OBJECTS)
199 %.o: %.c
200         $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
202 %.pot: %.c Makefile
203         $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
204                 $(DEFS) $(CFLAGS) $< > $@
206 %.so: %.o
207         $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(CLDFLAGS) $< $(LIBS) -o $@
209 ifeq ("","so")
210 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
211         $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
212         $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
213 endif
215 ifeq ("","dylib")
216 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
217         $(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \
218         $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
219 endif
221 %.so: %.a
222         $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
223         $(CFLAGS) $(CLDFLAGS) $(LIBS) -o $@ \
224          $< 
226 $(LIB_STATIC): $(OBJECTS)
227         $(RM) $@
228         $(AR) rs $@ $(OBJECTS)
230 %.d: %.c
231         $(MKDIR_P) $(dir $@); \
232         set -e; \
233         FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
234         DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
235         $(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) -o $@ $<; \
236         sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
237         [ -s $@ ] || $(RM) $@
239 %.mo: %.po
240         $(MSGFMT) -o $@ $<
242 clean: $(SUBDIRS.clean)
243         $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
244               $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
245               $(SOURCES:%.c=%.gcda) $(LDDEPS)
247 distclean: $(SUBDIRS.distclean)
248         $(RM) -rf $(DISTCLEAN_DIRS)
249         $(RM) $(DISTCLEAN_TARGETS) \
250               $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
251               $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
252               $(SOURCES:%.c=%.gcda) $(LDDEPS) \
253               config.cache config.log config.status \
254               Makefile make.tmpl core \
255               lvm-version.h
257 .export.sym: .exported_symbols
258         set -e; (echo "Base {"; echo "  global:"; \
259                  sed "s/^/              /;s/$$/;/" < $<; \
260                  echo " local:"; echo "         *;"; echo "};") > $@
262 ifneq ($(MAKECMDGOALS),clean)
263   ifneq ($(MAKECMDGOALS),distclean)
264     ifdef SOURCES
265        -include $(SOURCES:.c=.d)
266     endif
267     ifdef SOURCES2
268        -include $(SOURCES2:.c=.d)
269     endif
270   endif
271 endif