]>
Commit | Line | Data |
---|---|---|
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 | ||
20 | SHELL = /bin/sh | |
21 | ||
22 | @SET_MAKE@ | |
23 | ||
24 | CC = @CC@ | |
25 | RANLIB = @RANLIB@ | |
26 | SHELL = /bin/sh | |
27 | INSTALL = @INSTALL@ | |
28 | LN_S = @LN_S@ | |
5f68d858 | 29 | LIBS = @LIBS@ |
b896caa1 | 30 | CFLAGS = @CFLAGS@ |
795ca3e5 AK |
31 | |
32 | # Setup directory variables | |
470933a4 AK |
33 | prefix = $(DESTDIR)@prefix@ |
34 | exec_prefix = $(DESTDIR)@exec_prefix@ | |
795ca3e5 | 35 | bindir = @bindir@ |
795ca3e5 AK |
36 | libdir = @libdir@ |
37 | sbindir = @sbindir@ | |
38 | infodir = @infodir@ | |
39 | mandir = @mandir@ | |
40 | ||
41 | # setup misc variables | |
42 | # define the ownership variables for the binaries and man pages | |
43 | OWNER=@OWNER@ | |
44 | GROUP=@GROUP@ | |
45 | ||
46 | # The number of jobs to run, if blank, defaults to the make standard | |
47 | ifndef MAKEFLAGS | |
48 | MAKEFLAGS = @JOBS@ | |
49 | endif | |
50 | ||
51 | SUFFIXES= | |
5a52dca9 | 52 | SUFFIXES=.c .d .o .so |
795ca3e5 | 53 | |
8ef2b021 | 54 | CFLAGS+=-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 | ||
58 | ifeq ("@DEBUG@", "yes") | |
59 | CFLAGS+=-g -fno-omit-frame-pointer -DDEBUG_MEM -DDEBUG | |
60 | else | |
61 | CFLAGS+=-O2 | |
62 | endif | |
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 |
70 | LIB_VERSION := $(shell cat $(top_srcdir)/VERSION | \ |
71 | awk -F '.' '{printf "%s.%s",$$1,$$2}') | |
72 | ||
fa42e649 | 73 | INCLUDES+=-I. -I$(top_srcdir)/include |
7eee377d | 74 | INC_LNS=$(top_srcdir)/include/.symlinks_created |
795ca3e5 | 75 | |
4af6dc96 AK |
76 | ifdef DESTDIR |
77 | INCLUDES+=-I$(DESTDIR)/usr/include | |
78 | endif | |
79 | ||
a03f2320 AK |
80 | STRIP= |
81 | #STRIP=-s | |
82 | ||
14c61d2d AK |
83 | DEPS=$(top_srcdir)/make.tmpl Makefile $(INC_LNS) |
84 | ||
795ca3e5 AK |
85 | OBJECTS=$(SOURCES:%.c=%.o) |
86 | ||
87 | SUBDIRS.install := $(SUBDIRS:=.install) | |
88 | SUBDIRS.clean := $(SUBDIRS:=.clean) | |
89 | SUBDIRS.distclean := $(SUBDIRS:=.distclean) | |
90 | ||
91 | .PHONY: all install distclean clean | |
92 | .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean) | |
93 | ||
94 | all: $(SUBDIRS) $(TARGETS) | |
95 | ||
96 | install: 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 | ||
127 | clean: $(SUBDIRS.clean) | |
128 | $(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d) | |
129 | ||
130 | distclean: $(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 | |
135 | ifneq ($(MAKECMDGOALS),clean) | |
136 | ifneq ($(MAKECMDGOALS),distclean) | |
137 | ifdef SOURCES | |
138 | -include $(SOURCES:.c=.d) | |
139 | endif | |
140 | endif | |
141 | endif | |
142 |