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