]> sourceware.org Git - lvm2.git/blame - make.tmpl.in
Dump active configuration
[lvm2.git] / make.tmpl.in
CommitLineData
795ca3e5
AK
1# @configure_input@
2#
3# Copyright (C) 2001 Sistina Software
4#
5# This LVM library is free software; you can redistribute it and/or
6# modify it under the terms of the GNU Library General Public
7# License as published by the Free Software Foundation; either
8# version 2 of the License, or (at your option) any later version.
9#
10# This LVM library is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# Library General Public License for more details.
14#
15# You should have received a copy of the GNU Library General Public
16# License along with this LVM library; if not, write to the Free
17# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18# MA 02111-1307, USA
19
20SHELL = /bin/sh
21
22@SET_MAKE@
23
24CC = @CC@
25RANLIB = @RANLIB@
26SHELL = /bin/sh
27INSTALL = @INSTALL@
28LN_S = @LN_S@
5f68d858 29LIBS = @LIBS@
b896caa1 30CFLAGS = @CFLAGS@
795ca3e5
AK
31
32# Setup directory variables
470933a4
AK
33prefix = $(DESTDIR)@prefix@
34exec_prefix = $(DESTDIR)@exec_prefix@
795ca3e5 35bindir = @bindir@
795ca3e5
AK
36libdir = @libdir@
37sbindir = @sbindir@
38infodir = @infodir@
39mandir = @mandir@
40
41# setup misc variables
42# define the ownership variables for the binaries and man pages
43OWNER=@OWNER@
44GROUP=@GROUP@
45
46# The number of jobs to run, if blank, defaults to the make standard
47ifndef MAKEFLAGS
48MAKEFLAGS = @JOBS@
49endif
50
51SUFFIXES=
5a52dca9 52SUFFIXES=.c .d .o .so
795ca3e5 53
8ef2b021 54CFLAGS+=-fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline
03a8a07d 55
8ef2b021
AK
56#CFLAGS+=-W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wmissing-noreturn
57
58ifeq ("@DEBUG@", "yes")
59 CFLAGS+=-g -fno-omit-frame-pointer -DDEBUG_MEM -DDEBUG
60else
61 CFLAGS+=-O2
62endif
03a8a07d 63
14c61d2d 64#CFLAGS+=-DDEBUG_POOL
4790fce2 65#CFLAGS+=-DBOUNDS_CHECK
03a8a07d 66
8ef2b021
AK
67#CFLAGS+=-pg
68#LD_FLAGS=-pg
69
5a52dca9
AK
70LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \
71 awk -F '.' '{printf "%s.%s",$$1,$$2}')
72
fa42e649 73INCLUDES+=-I. -I$(top_srcdir)/include
7eee377d 74INC_LNS=$(top_srcdir)/include/.symlinks_created
795ca3e5 75
4af6dc96
AK
76ifdef DESTDIR
77 INCLUDES+=-I$(DESTDIR)/usr/include
78endif
79
a03f2320
AK
80STRIP=
81#STRIP=-s
82
14c61d2d
AK
83DEPS=$(top_srcdir)/make.tmpl Makefile $(INC_LNS)
84
795ca3e5
AK
85OBJECTS=$(SOURCES:%.c=%.o)
86
87SUBDIRS.install := $(SUBDIRS:=.install)
88SUBDIRS.clean := $(SUBDIRS:=.clean)
89SUBDIRS.distclean := $(SUBDIRS:=.distclean)
90
91.PHONY: all install distclean clean
92.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
93
94all: $(SUBDIRS) $(TARGETS)
95
96install: all $(SUBDIRS.install)
97
98$(SUBDIRS):
99 $(MAKE) -C $@
100
3ba1348c 101$(SUBDIRS.install): $(SUBDIRS)
795ca3e5
AK
102 $(MAKE) -C $(@:.install=) install
103
104$(SUBDIRS.clean):
5a52dca9 105 -$(MAKE) -C $(@:.clean=) clean
795ca3e5
AK
106
107$(SUBDIRS.distclean):
5a52dca9 108 -$(MAKE) -C $(@:.distclean=) distclean
795ca3e5
AK
109
110%.o: %.c
111 $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
112
5a52dca9
AK
113%.so: %.o
114 $(CC) -c $(INCLUDES) $(CFLAGS) %< -o $@
115
116%.so: $(OBJECTS)
117 $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
118 -Wl,--version-script,.export.sym $(OBJECTS) -o $@
119
795ca3e5 120%.d: %.c
1589a7a4 121 set -e; FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
14c61d2d 122 DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
170f08ce 123 $(CC) -MM $(INCLUDES) $(CFLAGS) $< | \
14c61d2d 124 sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d : $$DEPS /g" > $@; \
795ca3e5
AK
125 [ -s $@ ] || $(RM) $@
126
127clean: $(SUBDIRS.clean)
128 $(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
129
130distclean: $(SUBDIRS.distclean)
131 $(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
132 $(RM) config.cache config.log config.status
f552ba4b 133 $(RM) Makefile make.tmpl version.h core
795ca3e5
AK
134
135ifneq ($(MAKECMDGOALS),clean)
136 ifneq ($(MAKECMDGOALS),distclean)
137 ifdef SOURCES
138 -include $(SOURCES:.c=.d)
139 endif
140 endif
141endif
142
This page took 0.044733 seconds and 5 git commands to generate.