]> sourceware.org Git - lvm2.git/blob - make.tmpl.in
dmeventd
[lvm2.git] / make.tmpl.in
1 # @configure_input@
2 #
3 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
4 # Copyright (C) 2004, 2008 Red Hat, Inc. All rights reserved.
5 #
6 # This file is part of LVM2.
7 #
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.
11 #
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
15
16 SHELL = /bin/sh
17
18 @SET_MAKE@
19
20 CC = @CC@
21 RANLIB = @RANLIB@
22 SHELL = /bin/sh
23 INSTALL = @INSTALL@
24 MKDIR_P = @MKDIR_P@
25 MSGFMT = @MSGFMT@
26 LCOV = @LCOV@
27 GENHTML = @GENHTML@
28 LN_S = @LN_S@
29 SED = @SED@
30
31 LIBS = @LIBS@
32 DEFS += @DEFS@
33 CFLAGS += @CFLAGS@
34 CLDFLAGS += @CLDFLAGS@
35 LDDEPS += @LDDEPS@
36 LDFLAGS += @LDFLAGS@
37 LIB_SUFFIX = @LIB_SUFFIX@
38
39 # Setup directory variables
40 prefix = @prefix@
41 exec_prefix = @exec_prefix@
42 bindir = $(DESTDIR)@bindir@
43 confdir = $(DESTDIR)@CONFDIR@/lvm
44 includedir = $(DESTDIR)@includedir@
45 libdir = $(DESTDIR)@libdir@
46 usrlibdir = $(DESTDIR)@usrlibdir@
47 sbindir = $(DESTDIR)@sbindir@
48 usrsbindir = $(DESTDIR)@usrsbindir@
49 infodir = $(DESTDIR)@infodir@
50 mandir = $(DESTDIR)@mandir@
51 localedir = $(DESTDIR)@LOCALEDIR@
52 staticdir = $(DESTDIR)@STATICDIR@
53
54 interface = @interface@
55 interfacedir = $(top_srcdir)/libdm/$(interface)
56
57 # setup misc variables
58 # define the ownership variables for the binaries and man pages
59 OWNER = @OWNER@
60 GROUP = @GROUP@
61
62 # The number of jobs to run, if blank, defaults to the make standard
63 ifndef MAKEFLAGS
64 MAKEFLAGS = @JOBS@
65 endif
66
67 .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
68
69 CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security
70
71 #CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual
72 #CFLAGS += -pedantic -std=gnu99
73
74 CFLAGS += @COPTIMISE_FLAG@
75
76 ifeq ("@DEBUG@", "yes")
77 CFLAGS += -g -fno-omit-frame-pointer
78 DEFS += -DDEBUG
79 DEFS += -DDEBUG_MEM
80 endif
81
82 ifeq ("@INTL@", "yes")
83 DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
84 endif
85
86 LDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib
87 CLDFLAGS += -L$(top_srcdir)/libdm -L$(top_srcdir)/lib
88
89 ifeq ("@DMEVENTD@", "yes")
90 LDFLAGS += -L$(top_srcdir)/daemons/dmeventd
91 CLDFLAGS += -L$(top_srcdir)/daemons/dmeventd
92 endif
93
94 ifeq ("@DM_COMPAT@", "yes")
95 DEFS += -DDM_COMPAT
96 endif
97
98 ifeq ("@DM_IOCTLS@", "yes")
99 DEFS += -DDM_IOCTLS
100 endif
101
102 #DEFS += -DDEBUG_POOL
103 #DEFS += -DBOUNDS_CHECK
104
105 #CFLAGS += -pg
106 #LDFLAGS += -pg
107
108 STRIP=
109 #STRIP = -s
110
111 LVM_VERSION := $(shell cat $(top_srcdir)/VERSION)
112
113 LIB_VERSION_LVM := $(shell cat $(top_srcdir)/VERSION | \
114 awk -F '.' '{printf "%s.%s",$$1,$$2}')
115
116 LIB_VERSION_DM := $(shell cat $(top_srcdir)/VERSION_DM | \
117 awk -F '.' '{printf "%s.%s",$$1,$$2}')
118
119 INCLUDES += -I. -I$(top_srcdir)/include
120
121 ifdef DESTDIR
122 INCLUDES += -I$(DESTDIR)/usr/include
123 endif
124
125 INC_LNS = $(top_srcdir)/include/.symlinks_created
126
127 DEPS = $(top_srcdir)/make.tmpl $(top_srcdir)/VERSION Makefile $(INC_LNS)
128
129 OBJECTS = $(SOURCES:%.c=%.o)
130 POTFILES = $(SOURCES:%.c=%.pot)
131
132 .PHONY: all install install_cluster pofile distclean clean cflow device-mapper
133 .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
134 .PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
135 .PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper)
136
137 SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper)
138 SUBDIRS.install := $(SUBDIRS:=.install)
139 SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster)
140 SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper)
141 SUBDIRS.pofile := $(SUBDIRS:=.pofile)
142 SUBDIRS.cflow := $(SUBDIRS:=.cflow)
143 SUBDIRS.clean := $(SUBDIRS:=.clean)
144 SUBDIRS.distclean := $(SUBDIRS:=.distclean)
145
146 TARGETS += $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB)
147
148 all: $(SUBDIRS) $(TARGETS)
149
150 install: all $(SUBDIRS.install)
151 install_cluster: all $(SUBDIRS.install_cluster)
152 install_device-mapper: $(SUBDIRS.install_device-mapper)
153
154 $(SUBDIRS):
155 $(MAKE) -C $@
156
157 $(SUBDIRS.device-mapper):
158 $(MAKE) -C $(@:.device-mapper=) device-mapper
159
160 $(SUBDIRS.install): $(SUBDIRS)
161 $(MAKE) -C $(@:.install=) install
162
163 $(SUBDIRS.install_cluster): $(SUBDIRS)
164 $(MAKE) -C $(@:.install_cluster=) install_cluster
165
166 $(SUBDIRS.install_device-mapper): $(SUBDIRS)
167 $(MAKE) -C $(@:.install_device-mapper=) install_device-mapper
168
169 $(SUBDIRS.clean):
170 -$(MAKE) -C $(@:.clean=) clean
171
172 $(SUBDIRS.distclean):
173 -$(MAKE) -C $(@:.distclean=) distclean
174
175 ifeq ("@INTL@", "yes")
176 pofile: $(SUBDIRS.pofile) $(POTFILES)
177
178 $(SUBDIRS.pofile):
179 $(MAKE) -C $(@:.pofile=) pofile
180 endif
181
182 ifneq ("@CFLOW_CMD@", "")
183 cflow: $(SUBDIRS.cflow)
184
185 $(SUBDIRS.cflow):
186 $(MAKE) -C $(@:.cflow=) cflow
187 endif
188
189 $(TARGETS): $(OBJECTS)
190
191 %.o: %.c
192 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
193
194 %.pot: %.c Makefile
195 $(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
196 $(DEFS) $(CFLAGS) $< > $@
197
198 %.so: %.o
199 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
200
201 ifeq ("@LIB_SUFFIX@","so")
202 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
203 $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
204 $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
205 endif
206
207 ifeq ("@LIB_SUFFIX@","dylib")
208 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
209 $(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \
210 $(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
211 endif
212
213 %.so: %.a
214 $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
215 $(CFLAGS) $(CLDFLAGS) $(LIBS) -o $@ \
216 @CLDWHOLEARCHIVE@ $< @CLDNOWHOLEARCHIVE@
217
218 $(LIB_STATIC): $(OBJECTS)
219 $(RM) $@
220 $(AR) rs $@ $(OBJECTS)
221
222 %.d: %.c
223 set -e; \
224 FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
225 DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
226 $(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) $< | \
227 sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" > $@; \
228 [ -s $@ ] || $(RM) $@
229
230 %.mo: %.po
231 $(MSGFMT) -o $@ $<
232
233 clean: $(SUBDIRS.clean)
234 $(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
235 $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
236 $(SOURCES:%.c=%.gcda) $(LDDEPS)
237
238 distclean: $(SUBDIRS.distclean)
239 $(RM) -rf $(DISTCLEAN_DIRS)
240 $(RM) $(DISTCLEAN_TARGETS) \
241 $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
242 $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
243 $(SOURCES:%.c=%.gcda) $(LDDEPS) \
244 config.cache config.log config.status \
245 Makefile make.tmpl core \
246 version.h lvm2.po
247
248 .export.sym: .exported_symbols
249 set -e; (echo "Base {"; echo " global:"; \
250 sed "s/^/ /;s/$$/;/" < $<; \
251 echo " local:"; echo " *;"; echo "};") > $@
252
253 ifneq ($(MAKECMDGOALS),clean)
254 ifneq ($(MAKECMDGOALS),distclean)
255 ifdef SOURCES
256 -include $(SOURCES:.c=.d)
257 endif
258 endif
259 endif
260
This page took 0.050167 seconds and 6 git commands to generate.