]>
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@ | |
29 | ||
30 | # Setup directory variables | |
31 | prefix = @prefix@ | |
32 | exec_prefix = @exec_prefix@ | |
33 | bindir = @bindir@ | |
34 | staticlibdir = ${prefix}/lib | |
35 | libdir = @libdir@ | |
36 | sbindir = @sbindir@ | |
37 | infodir = @infodir@ | |
38 | mandir = @mandir@ | |
39 | ||
40 | # setup misc variables | |
41 | # define the ownership variables for the binaries and man pages | |
42 | OWNER=@OWNER@ | |
43 | GROUP=@GROUP@ | |
44 | ||
45 | # The number of jobs to run, if blank, defaults to the make standard | |
46 | ifndef MAKEFLAGS | |
47 | MAKEFLAGS = @JOBS@ | |
48 | endif | |
49 | ||
50 | SUFFIXES= | |
51 | SUFFIXES=.c .d .o | |
52 | ||
a4c0d9c2 | 53 | CFLAGS+=-Wall |
cfd658da | 54 | #CFLAGS+=-O2 |
a4c0d9c2 | 55 | CFLAGS+=-g -fno-omit-frame-pointer |
03a8a07d | 56 | |
a4c0d9c2 | 57 | #CFLAGS+=-pg |
03a8a07d AK |
58 | #LD_FLAGS=-pg |
59 | ||
4790fce2 AK |
60 | CFLAGS+=-DDEBUG_MEM -DDEBUG |
61 | #CFLAGS+=-DBOUNDS_CHECK | |
03a8a07d | 62 | |
fa42e649 | 63 | INCLUDES+=-I. -I$(top_srcdir)/include |
7eee377d | 64 | INC_LNS=$(top_srcdir)/include/.symlinks_created |
795ca3e5 AK |
65 | |
66 | ifeq ("@READLINE@", "yes") | |
67 | CFLAGS += -DREADLINE_SUPPORT | |
68 | EXTRA_LIBS += -lreadline | |
69 | endif | |
70 | ||
71 | OBJECTS=$(SOURCES:%.c=%.o) | |
72 | ||
73 | SUBDIRS.install := $(SUBDIRS:=.install) | |
74 | SUBDIRS.clean := $(SUBDIRS:=.clean) | |
75 | SUBDIRS.distclean := $(SUBDIRS:=.distclean) | |
76 | ||
77 | .PHONY: all install distclean clean | |
78 | .PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean) | |
79 | ||
80 | all: $(SUBDIRS) $(TARGETS) | |
81 | ||
82 | install: all $(SUBDIRS.install) | |
83 | ||
84 | $(SUBDIRS): | |
85 | $(MAKE) -C $@ | |
86 | ||
87 | $(SUBDIRS.install): | |
88 | $(MAKE) -C $(@:.install=) install | |
89 | ||
90 | $(SUBDIRS.clean): | |
91 | $(MAKE) -C $(@:.clean=) clean | |
92 | ||
93 | $(SUBDIRS.distclean): | |
94 | $(MAKE) -C $(@:.distclean=) distclean | |
95 | ||
96 | %.o: %.c | |
97 | $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ | |
98 | ||
99 | %.d: %.c | |
1589a7a4 | 100 | set -e; FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \ |
7eee377d | 101 | INC_LNS=`echo $(INC_LNS) | sed -e 's/\\//\\\\\\//g'`; \ |
fa42e649 | 102 | $(CC) -MM $(INCLUDES) $< | \ |
7eee377d | 103 | sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d : $$INC_LNS /g" > $@; \ |
795ca3e5 AK |
104 | [ -s $@ ] || $(RM) $@ |
105 | ||
106 | clean: $(SUBDIRS.clean) | |
107 | $(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d) | |
108 | ||
109 | distclean: $(SUBDIRS.distclean) | |
110 | $(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d) | |
111 | $(RM) config.cache config.log config.status | |
112 | $(RM) Makefile make.tmpl | |
113 | ||
114 | ifneq ($(MAKECMDGOALS),clean) | |
115 | ifneq ($(MAKECMDGOALS),distclean) | |
116 | ifdef SOURCES | |
117 | -include $(SOURCES:.c=.d) | |
118 | endif | |
119 | endif | |
120 | endif | |
121 |