1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
lvm2/make.tmpl.in

171 lines
4.0 KiB
Cheetah
Raw Normal View History

2001-09-21 16:37:43 +04:00
# @configure_input@
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
SHELL = /bin/sh
@SET_MAKE@
CC = @CC@
RANLIB = @RANLIB@
SHELL = /bin/sh
INSTALL = @INSTALL@
2004-02-14 01:56:45 +03:00
MSGFMT = @MSGFMT@
2001-09-21 16:37:43 +04:00
LN_S = @LN_S@
LIBS = @LIBS@
2003-10-22 01:59:42 +04:00
CFLAGS += @CFLAGS@
2001-09-21 16:37:43 +04:00
# Setup directory variables
2002-01-02 17:23:10 +03:00
prefix = $(DESTDIR)@prefix@
exec_prefix = $(DESTDIR)@exec_prefix@
2001-09-21 16:37:43 +04:00
bindir = @bindir@
libdir = @libdir@
sbindir = @sbindir@
infodir = @infodir@
mandir = @mandir@
2004-02-14 01:56:45 +03:00
localedir = @LOCALEDIR@
2001-09-21 16:37:43 +04:00
# setup misc variables
# define the ownership variables for the binaries and man pages
OWNER=@OWNER@
GROUP=@GROUP@
# The number of jobs to run, if blank, defaults to the make standard
ifndef MAKEFLAGS
MAKEFLAGS = @JOBS@
endif
SUFFIXES=
2004-02-14 01:56:45 +03:00
SUFFIXES=.c .d .o .so .po .pot .mo
2001-09-21 16:37:43 +04:00
CFLAGS+=-fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline
#CFLAGS+=-W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wmissing-noreturn
ifeq ("@DEBUG@", "yes")
CFLAGS+=-g -fno-omit-frame-pointer -DDEBUG_MEM -DDEBUG
else
CFLAGS+=-O2
endif
2004-02-14 01:56:45 +03:00
ifeq ("@INTL@", "yes")
CFLAGS+=-DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
endif
2001-11-28 18:00:49 +03:00
#CFLAGS+=-DDEBUG_POOL
#CFLAGS+=-DBOUNDS_CHECK
#CFLAGS+=-pg
#LD_FLAGS=-pg
2002-11-18 17:04:08 +03:00
LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \
awk -F '.' '{printf "%s.%s",$$1,$$2}')
INCLUDES+=-I. -I$(top_srcdir)/include
2001-10-04 16:07:29 +04:00
INC_LNS=$(top_srcdir)/include/.symlinks_created
2001-09-21 16:37:43 +04:00
ifdef DESTDIR
INCLUDES+=-I$(DESTDIR)/usr/include
endif
STRIP=
#STRIP=-s
2001-11-28 18:00:49 +03:00
DEPS=$(top_srcdir)/make.tmpl Makefile $(INC_LNS)
2001-09-21 16:37:43 +04:00
OBJECTS=$(SOURCES:%.c=%.o)
2004-02-14 01:56:45 +03:00
POTFILES=$(SOURCES:%.c=%.pot)
2001-09-21 16:37:43 +04:00
SUBDIRS.install := $(SUBDIRS:=.install)
2004-02-14 01:56:45 +03:00
SUBDIRS.pofile := $(SUBDIRS:=.pofile)
2001-09-21 16:37:43 +04:00
SUBDIRS.clean := $(SUBDIRS:=.clean)
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
2004-02-14 01:56:45 +03:00
.PHONY: all install pofile distclean clean
2001-09-21 16:37:43 +04:00
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
2004-02-14 01:56:45 +03:00
.PHONY: $(SUBDIRS.pofile)
2001-09-21 16:37:43 +04:00
all: $(SUBDIRS) $(TARGETS)
install: all $(SUBDIRS.install)
$(SUBDIRS):
$(MAKE) -C $@
2003-05-06 15:58:55 +04:00
$(SUBDIRS.install): $(SUBDIRS)
2001-09-21 16:37:43 +04:00
$(MAKE) -C $(@:.install=) install
$(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
2001-09-21 16:37:43 +04:00
%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
2004-02-14 01:56:45 +03:00
%.pot: %.c
$(CC) -E -P $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
$(CFLAGS) $< > $@
%.pot: Makefile
2002-11-18 17:04:08 +03:00
%.so: %.o
$(CC) -c $(INCLUDES) $(CFLAGS) %< -o $@
%.so: $(OBJECTS)
$(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
-Wl,--version-script,.export.sym $(OBJECTS) -o $@
2001-09-21 16:37:43 +04:00
%.d: %.c
2001-09-24 16:05:04 +04:00
set -e; FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
2001-11-28 18:00:49 +03:00
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
$(CC) -MM $(INCLUDES) $(CFLAGS) $< | \
2004-02-14 01:56:45 +03:00
sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" \
> $@; \
2001-09-21 16:37:43 +04:00
[ -s $@ ] || $(RM) $@
2004-02-14 01:56:45 +03:00
%.mo: %.po
$(MSGFMT) -o $@ $<
2001-09-21 16:37:43 +04:00
clean: $(SUBDIRS.clean)
2004-02-14 01:56:45 +03:00
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d) \
$(SOURCES:%.c=%.pot)
2001-09-21 16:37:43 +04:00
distclean: $(SUBDIRS.distclean)
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
2004-02-14 01:56:45 +03:00
$(RM) $(SOURCES:%.c=%.pot)
2001-09-21 16:37:43 +04:00
$(RM) config.cache config.log config.status
2004-02-14 01:56:45 +03:00
$(RM) Makefile make.tmpl version.h core lvm2.po
2001-09-21 16:37:43 +04:00
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifdef SOURCES
-include $(SOURCES:.c=.d)
endif
endif
endif