1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/make.tmpl.in

286 lines
7.6 KiB
Cheetah
Raw Normal View History

2001-09-21 16:37:43 +04:00
# @configure_input@
#
2004-03-30 23:35:44 +04:00
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
# Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
2001-09-21 16:37:43 +04:00
#
# This file is part of LVM2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
2001-09-21 16:37:43 +04:00
#
2004-03-30 23:35:44 +04:00
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2001-09-21 16:37:43 +04:00
SHELL = /bin/sh
@SET_MAKE@
CC = @CC@
RANLIB = @RANLIB@
SHELL = /bin/sh
INSTALL = @INSTALL@
2008-06-27 23:24:17 +04:00
MKDIR_P = @MKDIR_P@
2004-02-14 01:56:45 +03:00
MSGFMT = @MSGFMT@
2008-06-27 23:24:17 +04:00
LCOV = @LCOV@
GENHTML = @GENHTML@
2001-09-21 16:37:43 +04:00
LN_S = @LN_S@
SED = @SED@
CFLOW_CMD = @CFLOW_CMD@
LIBS = @LIBS@
# Extra libraries always linked with static binaries
STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS)
DEFS += @DEFS@
2003-10-22 01:59:42 +04:00
CFLAGS += @CFLAGS@
2004-03-26 16:21:12 +03:00
CLDFLAGS += @CLDFLAGS@
LDDEPS += @LDDEPS@
LDFLAGS += @LDFLAGS@
LIB_SUFFIX = @LIB_SUFFIX@
LVMINTERNAL_LIBS = -llvm-internal $(DL_LIBS)
DL_LIBS = @DL_LIBS@
PTHREAD_LIBS = @PTHREAD_LIBS@
READLINE_LIBS = @READLINE_LIBS@
SELINUX_LIBS = @SELINUX_LIBS@
UDEV_LIBS = @UDEV_LIBS@
2001-09-21 16:37:43 +04:00
# Setup directory variables
prefix = @prefix@
exec_prefix = @exec_prefix@
udev_prefix = @udev_prefix@
bindir = $(DESTDIR)@bindir@
confdir = $(DESTDIR)@CONFDIR@/lvm
2004-03-26 16:21:12 +03:00
includedir = $(DESTDIR)@includedir@
libdir = $(DESTDIR)@libdir@
usrlibdir = $(DESTDIR)@usrlibdir@
sbindir = $(DESTDIR)@sbindir@
usrsbindir = $(DESTDIR)@usrsbindir@
datarootdir = $(DESTDIR)@datarootdir@
infodir = $(DESTDIR)@infodir@
mandir = $(DESTDIR)@mandir@
localedir = $(DESTDIR)@LOCALEDIR@
staticdir = $(DESTDIR)@STATICDIR@
udevdir = $(DESTDIR)@udevdir@
2001-09-21 16:37:43 +04:00
interface = @interface@
2010-01-19 04:10:46 +03:00
interfacebuilddir = $(top_builddir)/libdm/$(interface)
2001-09-21 16:37:43 +04:00
# setup misc variables
# define the ownership variables for the binaries and man pages
2004-03-26 16:21:12 +03:00
OWNER = @OWNER@
GROUP = @GROUP@
2001-09-21 16:37:43 +04:00
# The number of jobs to run, if blank, defaults to the make standard
ifndef MAKEFLAGS
MAKEFLAGS = @JOBS@
endif
.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib
2001-09-21 16:37:43 +04:00
CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security
#CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual
#CFLAGS += -pedantic -std=gnu99
CFLAGS += @COPTIMISE_FLAG@
ifeq ("@DEBUG@", "yes")
CFLAGS += -g -fno-omit-frame-pointer
DEFS += -DDEBUG
# memory debugging is not thread-safe yet
ifneq ("@DMEVENTD@", "yes")
DEFS += -DDEBUG_MEM
endif
endif
2004-02-14 01:56:45 +03:00
ifeq ("@INTL@", "yes")
DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
2004-02-14 01:56:45 +03:00
endif
LDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
CLDFLAGS += -L$(top_builddir)/libdm -L$(top_builddir)/lib
2008-11-04 18:55:27 +03:00
ifeq ("@DMEVENTD@", "yes")
LDFLAGS += -L$(top_builddir)/daemons/dmeventd
CLDFLAGS += -L$(top_builddir)/daemons/dmeventd
2008-11-04 18:55:27 +03:00
endif
2008-11-04 17:57:06 +03:00
ifeq ("@DM_COMPAT@", "yes")
DEFS += -DDM_COMPAT
endif
ifeq ("@DM_IOCTLS@", "yes")
DEFS += -DDM_IOCTLS
endif
#DEFS += -DDEBUG_POOL
#DEFS += -DBOUNDS_CHECK
2004-03-26 16:21:12 +03:00
#CFLAGS += -pg
#LDFLAGS += -pg
2004-03-26 16:21:12 +03:00
STRIP=
#STRIP = -s
LVM_VERSION := $(shell cat $(top_srcdir)/VERSION)
LIB_VERSION_LVM := $(shell cat $(top_srcdir)/VERSION | \
awk -F '.' '{printf "%s.%s",$$1,$$2}')
LIB_VERSION_DM := $(shell cat $(top_srcdir)/VERSION_DM | \
awk -F '.' '{printf "%s.%s",$$1,$$2}')
2002-11-18 17:04:08 +03:00
LIB_VERSION_APP := $(shell cat $(top_srcdir)/VERSION | \
awk -F '[(). ]' '{printf "%s.%s",$$1,$$4}')
INCLUDES += -I. -I$(top_builddir)/include
2001-09-21 16:37:43 +04:00
INC_LNS = $(top_builddir)/include/.symlinks_created
DEPS = $(top_builddir)/make.tmpl $(top_srcdir)/VERSION \
$(top_builddir)/Makefile $(INC_LNS)
2001-11-28 18:00:49 +03:00
2004-03-26 16:21:12 +03:00
OBJECTS = $(SOURCES:%.c=%.o)
POTFILES = $(SOURCES:%.c=%.pot)
2001-09-21 16:37:43 +04:00
2008-11-04 20:25:32 +03:00
.PHONY: all install install_cluster pofile distclean clean cflow device-mapper
.PHONY: install_device-mapper install_lvm2
2004-08-18 22:57:40 +04:00
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
.PHONY: $(SUBDIRS.pofile) $(SUBDIRS.install_cluster) $(SUBDIRS.cflow)
2008-11-01 05:19:19 +03:00
.PHONY: $(SUBDIRS.device-mapper) $(SUBDIRS.install-device-mapper)
2004-08-18 22:57:40 +04:00
2008-11-01 05:19:19 +03:00
SUBDIRS.device-mapper := $(SUBDIRS:=.device-mapper)
2001-09-21 16:37:43 +04:00
SUBDIRS.install := $(SUBDIRS:=.install)
2004-08-18 22:57:40 +04:00
SUBDIRS.install_cluster := $(SUBDIRS:=.install_cluster)
2008-11-01 05:19:19 +03:00
SUBDIRS.install_device-mapper := $(SUBDIRS:=.install_device-mapper)
SUBDIRS.install_lvm2 := $(SUBDIRS:=.install_lvm2)
2004-02-14 01:56:45 +03:00
SUBDIRS.pofile := $(SUBDIRS:=.pofile)
SUBDIRS.cflow := $(SUBDIRS:=.cflow)
2001-09-21 16:37:43 +04:00
SUBDIRS.clean := $(SUBDIRS:=.clean)
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
TARGETS += $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB)
2004-04-05 20:29:37 +04:00
2001-09-21 16:37:43 +04:00
all: $(SUBDIRS) $(TARGETS)
install: all $(SUBDIRS.install)
2004-08-18 22:57:40 +04:00
install_cluster: all $(SUBDIRS.install_cluster)
2008-11-01 05:19:19 +03:00
install_device-mapper: $(SUBDIRS.install_device-mapper)
install_lvm2: $(SUBDIRS.install_lvm2)
2001-09-21 16:37:43 +04:00
$(SUBDIRS): $(SUBDIRS.device-mapper)
2001-09-21 16:37:43 +04:00
$(MAKE) -C $@
2008-11-01 05:19:19 +03:00
$(SUBDIRS.device-mapper):
$(MAKE) -C $(@:.device-mapper=) device-mapper
2003-05-06 15:58:55 +04:00
$(SUBDIRS.install): $(SUBDIRS)
2001-09-21 16:37:43 +04:00
$(MAKE) -C $(@:.install=) install
2004-08-18 22:57:40 +04:00
$(SUBDIRS.install_cluster): $(SUBDIRS)
$(MAKE) -C $(@:.install_cluster=) install_cluster
2008-11-04 20:25:32 +03:00
$(SUBDIRS.install_device-mapper): device-mapper
2008-11-01 05:19:19 +03:00
$(MAKE) -C $(@:.install_device-mapper=) install_device-mapper
$(SUBDIRS.install_lvm2): $(SUBDIRS)
$(MAKE) -C $(@:.install_lvm2=) install_lvm2
2001-09-21 16:37:43 +04:00
$(SUBDIRS.clean):
2002-11-18 17:04:08 +03:00
-$(MAKE) -C $(@:.clean=) clean
2001-09-21 16:37:43 +04:00
$(SUBDIRS.distclean):
2002-11-18 17:04:08 +03:00
-$(MAKE) -C $(@:.distclean=) distclean
2001-09-21 16:37:43 +04:00
2004-02-14 01:56:45 +03:00
ifeq ("@INTL@", "yes")
pofile: $(SUBDIRS.pofile) $(POTFILES)
$(SUBDIRS.pofile):
$(MAKE) -C $(@:.pofile=) pofile
endif
ifneq ("@CFLOW_CMD@", "")
cflow: $(SUBDIRS.cflow)
$(SUBDIRS.cflow):
$(MAKE) -C $(@:.cflow=) cflow
endif
2004-03-26 16:21:12 +03:00
$(TARGETS): $(OBJECTS)
2001-09-21 16:37:43 +04:00
%.o: %.c
2008-05-20 00:06:34 +04:00
$(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
2001-09-21 16:37:43 +04:00
2004-04-06 19:14:23 +04:00
%.pot: %.c Makefile
2008-05-20 00:06:34 +04:00
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
$(DEFS) $(CFLAGS) $< > $@
2004-02-14 01:56:45 +03:00
2002-11-18 17:04:08 +03:00
%.so: %.o
$(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(CLDFLAGS) $< $(LIBS) -o $@
2002-11-18 17:04:08 +03:00
ifeq ("@LIB_SUFFIX@","so")
$(LIB_SHARED): $(OBJECTS) $(LDDEPS)
$(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
$(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
endif
ifeq ("@LIB_SUFFIX@","dylib")
$(LIB_SHARED): $(OBJECTS) $(LDDEPS)
$(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \
$(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
endif
2004-03-26 16:21:12 +03:00
2006-02-02 22:16:47 +03:00
%.so: %.a
$(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
$(CFLAGS) $(CLDFLAGS) $(LIBS) -o $@ \
@CLDWHOLEARCHIVE@ $< @CLDNOWHOLEARCHIVE@
2006-02-02 22:16:47 +03:00
2004-03-26 16:21:12 +03:00
$(LIB_STATIC): $(OBJECTS)
$(RM) $@
$(AR) rs $@ $(OBJECTS)
2002-11-18 17:04:08 +03:00
2001-09-21 16:37:43 +04:00
%.d: %.c
$(MKDIR_P) $(dir $@); \
2004-03-26 16:21:12 +03:00
set -e; \
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
$(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) -o $@ $<; \
sed -i "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" $@; \
2004-03-26 16:21:12 +03:00
[ -s $@ ] || $(RM) $@
2001-09-21 16:37:43 +04:00
2004-02-14 01:56:45 +03:00
%.mo: %.po
$(MSGFMT) -o $@ $<
2001-09-21 16:37:43 +04:00
clean: $(SUBDIRS.clean)
2004-03-26 16:21:12 +03:00
$(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
$(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
2008-06-27 23:24:17 +04:00
$(SOURCES:%.c=%.gcda) $(LDDEPS)
2001-09-21 16:37:43 +04:00
2008-06-27 23:24:17 +04:00
distclean: $(SUBDIRS.distclean)
$(RM) -rf $(DISTCLEAN_DIRS)
$(RM) $(DISTCLEAN_TARGETS) \
2008-06-27 23:24:17 +04:00
$(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \
$(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \
2008-06-27 23:24:17 +04:00
$(SOURCES:%.c=%.gcda) $(LDDEPS) \
2004-03-26 16:21:12 +03:00
config.cache config.log config.status \
Makefile make.tmpl core \
lvm-version.h
2004-03-26 16:21:12 +03:00
.export.sym: .exported_symbols
set -e; (echo "Base {"; echo " global:"; \
sed "s/^/ /;s/$$/;/" < $<; \
echo " local:"; echo " *;"; echo "};") > $@
2001-09-21 16:37:43 +04:00
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifdef SOURCES
-include $(SOURCES:.c=.d)
endif
ifdef SOURCES2
-include $(SOURCES2:.c=.d)
endif
2001-09-21 16:37:43 +04:00
endif
endif