File: Makefile.in

package info (click to toggle)
kexec-tools 1%3A2.0.22-2
  • links: PTS
  • area: main
  • in suites: bookworm, sid
  • size: 2,836 kB
  • sloc: ansic: 28,110; sh: 3,614; asm: 2,625; cpp: 1,752; makefile: 932
file content (398 lines) | stat: -rw-r--r-- 11,991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# Hey Emacs this is a -*- makefile-*-

PACKAGE_NAME	= @PACKAGE_NAME@
PACKAGE_VERSION	= @PACKAGE_VERSION@

prefix		= @prefix@
exec_prefix	= @exec_prefix@

bindir		= @bindir@
sbindir		= @sbindir@
libexecdir	= @libexecdir@
datadir		= @datadir@
datarootdir	= @datarootdir@
sysconfdir	= @sysconfdir@
sharedstatedir	= @sharedstatedir@
localstatedir	= @localstatedir@
libdir		= @libdir@
infodir		= @infodir@
mandir		= @mandir@
includedir	= @includedir@


# The target architecture
ARCH		= @ARCH@
SUBARCH		= @SUBARCH@
OBJDIR		= @OBJDIR@
target		= @target@
host		= @host@

# Compiler for building kexec
CC		= @CC@
CPP		= @CPP@
LD		= @LD@
AS		= @AS@
OBJCOPY		= @OBJCOPY@
AR		= @AR@

# C compiler for binaries to run during the build
BUILD_CC	= @BUILD_CC@
BUILD_CFLAGS	= @BUILD_CFLAGS@
TARGET_CC	= @TARGET_CC@
TARGET_LD	= @TARGET_LD@
TARGET_CFLAGS	= @TARGET_CFLAGS@


# Base compiler flags. These are extended by the subcomponent-Makefiles
# where necessary.
CPPFLAGS	= @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \
			-Iinclude/ $($(ARCH)_CPPFLAGS)
CFLAGS		= @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes
PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@
ASFLAGS		= @ASFLAGS@ $($(ARCH)_ASFLAGS)
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

# Utilities called by the makefiles
INSTALL		= @INSTALL@
CHMOD		= @CHMOD@
CD		= cd
MKDIR		= @MKDIR@
RM		= @RM@
CP		= @CP@
LN		= @LN@
TAR		= @TAR@
RPMBUILD	= @RPMBUILD@
SED		= @SED@
FIND		= @FIND@
XARGS		= @XARGS@
DIRNAME		= @DIRNAME@
STRIP		= @STRIP@


pkgdatadir = $(datadir)/$(PACKAGE_NAME)
pkglibdir = $(libdir)/$(PACKAGE_NAME)
pkgincludedir = $(includedir)/$(PACKAGE_NAME)

# You can specify DESTDIR on the command line to do a add
# a prefix to the install so it doesn't really happen
# Useful for building binary packages
DESTDIR =

srcdir		= @srcdir@
VPATH		= .:$(srcdir)

# install paths
BUILD_PREFIX:=build
SBINDIR=$(BUILD_PREFIX)/sbin
BINDIR=$(BUILD_PREFIX)/bin
LIBEXECDIR=$(BUILD_PREFIX)/libexec
DATADIR=$(BUILD_PREFIX)/share
SYSCONFDIR=$(BUILD_PREFIX)/etc
SHAREDSTATEDIR=$(BUILD_PREFIX)/com
LOCALSTATEDIR=$(BUILD_PREFIX)/var
LIBDIR=$(BUILD_PREFIX)/lib
INFODIR=$(BUILD_PREFIX)/info
MANDIR=$(BUILD_PREFIX)/share/man
MAN1DIR=$(MANDIR)/man1
MAN2DIR=$(MANDIR)/man2
MAN3DIR=$(MANDIR)/man3
MAN4DIR=$(MANDIR)/man4
MAN5DIR=$(MANDIR)/man5
MAN6DIR=$(MANDIR)/man6
MAN7DIR=$(MANDIR)/man7
MAN8DIR=$(MANDIR)/man8
INCLUDEDIR=$(BUILD_PREFIX)/include

PKGDATADIR=$(DATADIR)/$(PACKAGE_NAME)
PKGLIBDIR=$(LIBDIR)/$(PACKAGE_NAME)
PKGINCLUDEIR=$(INCLUDEDIR)/$(PACKAGE_NAME)

ALLOWED_UNINSTALL_DIRS := \
	$(SBINDIR) \
	$(sbindir) $(bindir) $(libexecdir) $(datadir) $(sysconfdir) \
	$(sharedstatedir) $(localstatedir) $(libdir) $(infodir) \
	$(mandir)/man1 $(mandir)/man2 $(mandir)/man3 $(mandir)/man4 \
	$(mandir)/man5 $(mandir)/man6 $(mandir)/man7 $(mandir)/man8 \
	$(includedir) $(pkgdatadir) $(pkglibdir) $(pkgincludedir)

all: targets

# generic build rules
%.o: %.c
	@$(MKDIR) -p $(@D)
	$(COMPILE.c) -MD -o $@ $<

%.o: %.S
	@$(MKDIR) -p $(@D)
	$(COMPILE.S) -MD -o $@ $<

# collect objects to be removed in 'make clean'
clean =

dist =	AUTHORS COPYING INSTALL News TODO Makefile.in configure.ac configure \
	kexec-tools.spec.in config/

# utility function for converting a list of files (with extension) to
# file.o (or file.d) format.
objify = $(addsuffix .o, $(basename $(1)))
depify = $(addsuffix .d, $(basename $(1)))

# Documentation
#
include $(srcdir)/doc/Makefile

# Headers
#
include $(srcdir)/include/Makefile

# Utility function library
#
include $(srcdir)/util_lib/Makefile

#
# Stand alone utilities
#
include $(srcdir)/util/Makefile

#
# purgatory (code between kernels)
#
include $(srcdir)/purgatory/Makefile

#
# kexec (linux booting linux)
#
include $(srcdir)/kexec/Makefile

# vmcore-dmesg (read dmesg from a vmcore)
#
include $(srcdir)/vmcore-dmesg/Makefile

#
# kexec_test (test program)
#
include $(srcdir)/kexec_test/Makefile

SPEC=$(PACKAGE_NAME).spec
GENERATED_SRCS:= $(SPEC)
TARBALL=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
TARBALL.gz=$(TARBALL).gz
SRCS:= $(dist)
PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
PGSRCS:=$(foreach s, $(GENERATED_SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))

MAN_PAGES:=$(KEXEC_MANPAGE) $(VMCORE_DMESG_MANPAGE)
MAN_PAGES+=$(MANDIR)/man8/coldreboot.8
BINARIES_i386:=$(KEXEC_TEST)
BINARIES_x86_64:=$(KEXEC_TEST)
BINARIES:=$(KEXEC) $(VMCORE_DMESG) $(BINARIES_$(ARCH))
SCRIPTS:=$(SBINDIR)/coldreboot

UNINSTALL_KDUMP = $(sbindir)/kdump
UNINSTALL_KDUMP_MANPAGE = $(mandir)/man8/kdump.8
UNINSTALL_KEXEC = $(sbindir)/kexec
UNINSTALL_KEXEC_MANPAGE = $(mandir)/man8/kexec.8
UNINSTALL_KEXEC_TEST = $(pkglibdir)/kexec_test
UNINSTALL_VMCORE_DMESG = $(sbindir)/vmcore-dmesg
UNINSTALL_VMCORE_DMESG_MANPAGE = $(mandir)/man8/vmcore-dmesg.8

TARGETS:=$(BINARIES) $(MAN_PAGES) $(SCRIPTS)
targets: $(TARGETS)

UNINSTALL_TARGETS_i386:=$(UNINSTALL_KEXEC_TEST)
UNINSTALL_TARGETS_x86_64:=$(UNINSTALL_KEXEC_TEST)
UNINSTALL_TARGETS:=$(UNINSTALL_KDUMP) $(UNINSTALL_KDUMP_MANPAGE) \
		   $(UNINSTALL_KEXEC) $(UNINSTALL_KEXEC_MANPAGE) \
		   $(UNINSTALL_VMCORE_DMESG) $(UNINSTALL_VMCORE_DMESG_MANPAGE) \
		   $(UNINSTALL_TARGETS_$(ARCH))
uninstall-targets: $(UNINSTALL_TARGETS)

Makefile: Makefile.in config.status
	./config.status

configure: configure.ac
	cd $(srcdir) && autoheader && autoconf && rm -rf autom4te.cache

dist: tarball

tarball: $(TARBALL.gz)

$(TARBALL): $(SRCS) $(GENERATED_SRCS)
	[ ! -d $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] || \
	        $(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(TAR) -c $(SRCS) $(GENERATED_SRCS) | \
	        $(TAR) -C $(PACKAGE_NAME)-$(PACKAGE_VERSION) -x
	$(TAR) -cf $@ $(PSRCS)
	$(TAR) -rf $@ $(PGSRCS)
	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)

$(TARBALL.gz): $(TARBALL)
	gzip -c < $^ > $@

rpm: $(TARBALL.gz)
	unset MAKEFLAGS MAKELEVEL;
	$(RPMBUILD) -ta $(TARBALL.gz)

$(SPEC): kexec-tools.spec.in Makefile
	$(SED) -e 's,^Version: $$,Version: $(PACKAGE_VERSION),' $< > $@

echo::
	@echo ARCH=$(ARCH)
	@echo BINARIES=$(BINARIES)
	@echo TARGETS=$(TARGETS)
	@echo UNINSTALL_TARGETS=$(UNINSTALL_TARGETS)
	@echo CC=$(CC)
	@echo AR=$(AR)
	@echo LD=$(LD)
	@echo STRIP=$(STRIP)

clean:
	$(RM) -f $(clean)
	$(RM) -rf build
	$(RM) -f $(TARBALL) $(TARBALL.gz)

distclean: dist-clean

dist-clean: clean
	$(RM) -f config.log config.status config.cache Makefile include/config.h include/stamp-h*
	$(RM) -f include/config.h.in configure $(SPEC)
	$(RM) -rf autom4te.cache

distuninstallcheck:
	FOUND=$$(find $(distuninstallcheck_dir) ! -type d) && \
		[ -z "$$FOUND" ] || { \
			echo "Unexpeced files found after uninstall:" && \
			echo "$$FOUND" && \
			exit 1; }

distcheck: $(TARBALL)
	[ ! -d $(PACKAGE_NAME)-$(PACKAGE_VERSION) ] || \
	        $(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(TAR) -xf $(TARBALL)
	$(MKDIR) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build \
	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build/sub \
	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_inst \
	         $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_dest
	$(CHMOD) a-w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build
	INSTALL_BASE=$$($(CD) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,') &&\
		DESTDIR="$(PACKAGE_NAME)-$(PACKAGE_VERSION)/_dest" && \
		$(CD) $(PACKAGE_NAME)-$(PACKAGE_VERSION)/_build/sub && \
			../../configure \
			$(DISTCHECK_CONFIGURE_FLAGS) \
			--srcdir=../.. --prefix="$$INSTALL_BASE" && \
		$(MAKE) $(AM_MAKEFLAGS) && \
		$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" install && \
		$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" uninstall && \
		$(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$DESTDIR" \
			distuninstallcheck
	$(CHMOD) u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION)
	$(RM) -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)

install: $(TARGETS)
	for file in $(TARGETS) ; do \
		if test `$(DIRNAME) $$file` =     "$(SBINDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(sbindir)/; \
			$(INSTALL) -m 755  $$file $(DESTDIR)/$(sbindir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(BINDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(bindir)/; \
			$(INSTALL) -m 755 $$file $(DESTDIR)/$(bindir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(LIBEXECDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(libexecdir)/; \
			$(INSTALL) -m 755 $$file $(DESTDIR)/$(libexecdir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(DATADIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(datadir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(datadir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(SYSCONFDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(sysconfdir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(sysconfdir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(SHAREDSTATEDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(sharedstatedir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(sharedstatedir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(LOCALSTATEDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(localstatedir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(localstatedir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(LIBDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(libdir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(libdir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(INFODIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(infodir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(infodir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN1DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man1; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man1; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN2DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man2; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man2; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN3DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man3/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man3/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN4DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man4/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man4/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN5DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man5/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man5/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN6DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man6/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man6/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN7DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man7/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man7/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(MAN8DIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(mandir)/man8/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(mandir)/man8/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(INCLUDEDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(includedir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(includedir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(PKGDATADIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(pkgdatadir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(pkgdatadir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(PKGLIBDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(pkglibdir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(pkglibdir)/; \
		fi; \
		if test `$(DIRNAME) $$file` =     "$(PKGINCLUDEDIR)" ; then \
			$(MKDIR) -p     $(DESTDIR)/$(pkgincludedir)/; \
			$(INSTALL) -m 644 $$file $(DESTDIR)/$(pkgincludedir)/; \
		fi; \
	done

uninstall:
	UINSTALL_LIST='$(UNINSTALL_TARGETS)'; \
	for file in $$UINSTALL_LIST ; do \
		DIRS='$(ALLOWED_UNINSTALL_DIRS)'; \
		for dir in $$DIRS ; do \
			if test `$(DIRNAME) $$file` = "$$dir" ; then \
				rm -rf $(DESTDIR)/$$file ; \
				break ; \
			fi; \
		done; \
	done

.PHONY: echo install uninstall distuninstallcheck all targets \
	uninstall-targets clean dist-clean distclean distcheck \
	maintainer-clean maintainerclean dist tarball rpm