[go: up one dir, main page]

File: Makefile.in

package info (click to toggle)
drbd-utils 9.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,388 kB
  • sloc: ansic: 43,698; xml: 15,968; cpp: 7,783; sh: 3,699; makefile: 1,353; perl: 353
file content (147 lines) | stat: -rw-r--r-- 4,877 bytes parent folder | download | duplicates (2)
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
# Makefile for drbd.o
#
# This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
#
# drbd is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# drbd 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with drbd; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#

VPATH = ../../drbd-headers:../shared

# variables set by configure
DISTRO = @DISTRO@
prefix = @prefix@
exec_prefix = @exec_prefix@
localstatedir = @localstatedir@
datarootdir = @datarootdir@
datadir = @datadir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LN_S = @LN_S@

DRBD_LIB_DIR = @DRBD_LIB_DIR@
DRBD_RUN_DIR = @DRBD_RUN_DIR@
DRBD_LOCK_DIR = @DRBD_LOCK_DIR@
DRBD_CONFIG_DIR = @DRBD_CONFIG_DIR@

# features enabled or disabled by configure
WITH_83_SUPPORT = @WITH_83_SUPPORT@
WITH_84_SUPPORT = @WITH_84_SUPPORT@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@

# for some reason some of the commands below only work correctly in bash,
# and not in e.g. dash. I'm too lazy to fix it to be compatible.
SHELL=/bin/bash

# variables meant to be overridden from the make command line
DESTDIR ?= /

CFLAGS += -Wall -I../../drbd-headers -I.. -I. -I../shared
CFLAGS += $(EXTRA_CFLAGS)

GENETLINK_H := /usr/include/linux/genetlink.h
libgenl.o: CFLAGS += $(shell for w in CTRL_ATTR_VERSION CTRL_ATTR_HDRSIZE CTRL_ATTR_MCAST_GROUPS; do grep -qw $$w $(GENETLINK_H) && echo -DHAVE_$$w; done)

drbdadm-obj = drbdadm_scanner.o drbdadm_parser.o drbdadm_postparse.o \
	      drbdadm_main.o drbdadm_adjust.o drbdadm_dump.o drbdtool_common.o \
	      drbdadm_usage_cnt.o drbd_buildtag.o registry.o config_flags.o \
	      libgenl.o drbd_nla.o shared_tool.o shared_main.o shared_parser.o

drbdsetup-obj = libgenl.o registry.o drbdsetup.o drbdtool_common.o \
		drbd_buildtag.o drbd_strings.o config_flags.o drbd_nla.o \
		wrap_printf.o drbdsetup_colors.o shared_tool.o

drbdmeta-obj = drbdmeta.o drbdmeta_scanner.o drbdtool_common.o drbd_buildtag.o \
	       drbd_strings.o shared_tool.o

all-obj := $(drbdadm-obj) $(drbdsetup-obj) $(drbdmeta-obj)

all: tools

../shared_prereqs.mk: ;
include ../shared_prereqs.mk

tools: drbdadm drbdmeta drbdsetup

drbdadm: $(drbdadm-obj)
	$(LINK.c) $(LDFLAGS) -o $@ $^

drbdadm_scanner.c: drbdadm_scanner.fl drbdadm_parser.h
	flex -s -odrbdadm_scanner.c drbdadm_scanner.fl

drbdsetup: $(drbdsetup-obj)
	$(LINK.c) $(LDFLAGS) -o $@ $^

drbdmeta: $(drbdmeta-obj)
	$(LINK.c) $(LDFLAGS) -o $@ $^

clean:
	rm -f drbdadm_scanner.c
	rm -f drbdsetup drbdadm drbdmeta $(all-obj)
	rm -f drbd_strings.c drbd_strings.h
	rm -f *~

distclean: clean
	rm -f $(all-dep)

install:
	install -d $(DESTDIR)$(sbindir)
	install -d $(DESTDIR)$(localstatedir)/lib/drbd
	install -d $(DESTDIR)$(localstatedir)/lock
	if getent group haclient > /dev/null 2> /dev/null ; then	\
		install -g haclient -m 4750 drbdsetup $(DESTDIR)$(sbindir) ;	\
		install -g haclient -m 4750 drbdmeta $(DESTDIR)$(sbindir) ;	\
		install -m 755 drbdadm $(DESTDIR)$(sbindir) ;		\
	else								\
		install -m 755 drbdsetup $(DESTDIR)$(sbindir) ;		\
		install -m 755 drbdmeta $(DESTDIR)$(sbindir) ;		\
		install -m 755 drbdadm $(DESTDIR)$(sbindir) ;		\
	fi
	if test -d $(DESTDIR)/sbin && \
	 ! test $(DESTDIR)/sbin -ef $(DESTDIR)$(sbindir) ; then		\
		ln -sf $(sbindir)/drbdsetup $(DESTDIR)/sbin ;		\
		ln -sf $(sbindir)/drbdmeta $(DESTDIR)/sbin ;		\
		ln -sf $(sbindir)/drbdadm $(DESTDIR)/sbin ;		\
	fi
	install -d $(DESTDIR)$(DRBD_LIB_DIR)

uninstall:
	rm -f $(DESTDIR)$(sbindir)/{drbdsetup,drbdadm,drbdmeta}
	rm -f $(DESTDIR)/sbin/{drbdsetup,drbdadm,drbdmeta}

spell:
	for f in drbdadm_adjust.c drbdadm_main.c drbdadm_parser.c drbdadm_usage_cnt.c drbdmeta.c drbdsetup.c drbdtool_common.c; do \
	 	aspell --save-repl --dont-backup --personal=./../documentation/aspell.en.per check $$f; \
	done

.PHONY: install uninstall clean distclean spell
../../configure:
	@echo "please (re-)run ./autogen.sh with appropriate arguments"; exit 1
../../config.status: ../../configure
	@echo "please (re-)run ./configure with appropriate arguments"; exit 1
Makefile.in: ;
Makefile: Makefile.in ../../config.status
	cd ../.. && ./config.status user/v9/Makefile