]>
Commit | Line | Data |
---|---|---|
8dfc8dbe | 1 | # Makefile for udev |
f0083e3d | 2 | # |
8dfc8dbe | 3 | # Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com> |
f0083e3d GKH |
4 | # |
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; version 2 of the License. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | # General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 | # | |
18 | ||
54988802 KS |
19 | # Set the following to control the use of syslog |
20 | # Set it to `false' to remove all logging | |
05230184 | 21 | USE_LOG = true |
54988802 KS |
22 | |
23 | # Set the following to `true' to log the debug | |
24 | # and make a unstripped, unoptimized binary. | |
f0083e3d | 25 | # Leave this set to `false' for production use. |
29b82deb | 26 | DEBUG = false |
f0083e3d | 27 | |
5aebfbcb DZ |
28 | # Set the following to `true' to make udev emit a D-BUS signal when a |
29 | # new node is created. | |
66626948 | 30 | USE_DBUS = false |
5aebfbcb | 31 | |
f0083e3d GKH |
32 | |
33 | ROOT = udev | |
7fafc032 KS |
34 | DAEMON = udevd |
35 | SENDER = udevsend | |
e56f0058 | 36 | INFO = udevinfo |
eb10f97f | 37 | TESTER = udevtest |
82b9a637 | 38 | STARTER = udevstart |
b99c85e4 | 39 | VERSION = 022 |
f0083e3d | 40 | INSTALL_DIR = /usr/local/bin |
1e7a3f9e | 41 | RELEASE_NAME = $(ROOT)-$(VERSION) |
6d88260a | 42 | LOCAL_CFG_DIR = etc/udev |
8e2229c4 | 43 | HOTPLUG_EXEC = $(ROOT) |
f0083e3d | 44 | |
4360a56d | 45 | DESTDIR = |
977083c2 GKH |
46 | |
47 | KERNEL_DIR = /lib/modules/${shell uname -r}/build | |
48 | ||
6739707d | 49 | # override this to make udev look in a different location for it's config files |
9f53b06a GKH |
50 | prefix = |
51 | exec_prefix = ${prefix} | |
52 | etcdir = ${prefix}/etc | |
53 | sbindir = ${exec_prefix}/sbin | |
e56f0058 | 54 | usrbindir = ${exec_prefix}/usr/bin |
9f53b06a GKH |
55 | mandir = ${prefix}/usr/share/man |
56 | hotplugdir = ${etcdir}/hotplug.d/default | |
5aebfbcb | 57 | dbusdir = ${etcdir}/dbus-1/system.d |
9f53b06a | 58 | configdir = ${etcdir}/udev/ |
dbc9b3f3 | 59 | initdir = ${etcdir}/init.d/ |
9f53b06a GKH |
60 | srcdir = . |
61 | ||
62 | INSTALL = /usr/bin/install -c | |
63 | INSTALL_PROGRAM = ${INSTALL} | |
64 | INSTALL_DATA = ${INSTALL} -m 644 | |
65 | INSTALL_SCRIPT = ${INSTALL_PROGRAM} | |
66 | ||
eadb1bbc PM |
67 | # To build any of the extras programs, run with: |
68 | # make EXTRAS="extras/a extras/b" | |
69 | EXTRAS= | |
6739707d GKH |
70 | |
71 | # place to put our device nodes | |
18a0d652 | 72 | udevdir = ${prefix}/udev |
f0083e3d GKH |
73 | |
74 | # Comment out this line to build with something other | |
75 | # than the local version of klibc | |
66626948 | 76 | #USE_KLIBC = true |
f0083e3d | 77 | |
89067448 GKH |
78 | # set up PWD so that older versions of make will work with our build. |
79 | PWD = $(shell pwd) | |
80 | ||
f0083e3d | 81 | # If you are running a cross compiler, you may want to set this |
e64280b8 | 82 | # to something more interesting, like "arm-linux-". If you want |
f0083e3d GKH |
83 | # to compile vs uClibc, that can be done here as well. |
84 | CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- | |
85 | CC = $(CROSS)gcc | |
74894b53 | 86 | LD = $(CROSS)gcc |
f0083e3d GKH |
87 | AR = $(CROSS)ar |
88 | STRIP = $(CROSS)strip | |
b137e367 | 89 | RANLIB = $(CROSS)ranlib |
f0083e3d | 90 | |
eadb1bbc | 91 | export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS ARCH_LIB_OBJS CRT0 |
f0083e3d GKH |
92 | |
93 | # code taken from uClibc to determine the current arch | |
94 | ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \ | |
bfd8a5d0 | 95 | -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'} |
f0083e3d GKH |
96 | |
97 | # code taken from uClibc to determine the gcc include dir | |
98 | GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"} | |
99 | ||
100 | # code taken from uClibc to determine the libgcc.a filename | |
101 | GCC_LIB := $(shell $(CC) -print-libgcc-file-name ) | |
102 | ||
103 | # use '-Os' optimization if available, else use -O2 | |
104 | OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ | |
105 | then echo "-Os"; else echo "-O2" ; fi} | |
106 | ||
7bfd1a56 | 107 | # add -Wredundant-decls when libsysfs gets cleaned up |
eea34a0e | 108 | WARNINGS := -Wall |
f0083e3d GKH |
109 | |
110 | # Some nice architecture specific optimizations | |
111 | ifeq ($(strip $(TARGET_ARCH)),arm) | |
112 | OPTIMIZATION+=-fstrict-aliasing | |
113 | endif | |
114 | ifeq ($(strip $(TARGET_ARCH)),i386) | |
115 | OPTIMIZATION+=-march=i386 | |
116 | OPTIMIZATION += ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc \ | |
117 | /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi} | |
118 | OPTIMIZATION += ${shell if $(CC) -malign-functions=0 -malign-jumps=0 -S -o /dev/null -xc \ | |
119 | /dev/null >/dev/null 2>&1; then echo "-malign-functions=0 -malign-jumps=0"; fi} | |
120 | CFLAGS+=-pipe | |
121 | else | |
122 | CFLAGS+=-pipe | |
123 | endif | |
124 | ||
05230184 | 125 | ifeq ($(strip $(USE_LOG)),true) |
54988802 KS |
126 | CFLAGS += -DLOG |
127 | endif | |
128 | ||
f0083e3d GKH |
129 | # if DEBUG is enabled, then we do not strip or optimize |
130 | ifeq ($(strip $(DEBUG)),true) | |
eea34a0e | 131 | CFLAGS += -O1 -g -DDEBUG -D_GNU_SOURCE |
f0083e3d GKH |
132 | LDFLAGS += -Wl,-warn-common |
133 | STRIPCMD = /bin/true -Since_we_are_debugging | |
134 | else | |
eea34a0e | 135 | CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE |
f0083e3d GKH |
136 | LDFLAGS += -s -Wl,-warn-common |
137 | STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment | |
138 | endif | |
139 | ||
fb43c2b2 GKH |
140 | # If we are using our version of klibc, then we need to build, link it, and then |
141 | # link udev against it statically. | |
142 | # Otherwise, use glibc and link dynamically. | |
66626948 | 143 | ifeq ($(strip $(USE_KLIBC)),true) |
eadb1bbc PM |
144 | KLIBC_BASE = $(PWD)/klibc |
145 | KLIBC_DIR = $(KLIBC_BASE)/klibc | |
f0083e3d | 146 | INCLUDE_DIR := $(KLIBC_DIR)/include |
977083c2 GKH |
147 | LINUX_INCLUDE_DIR := $(KERNEL_DIR)/include |
148 | # LINUX_INCLUDE_DIR := $(KLIBC_BASE)/linux/include | |
74894b53 | 149 | include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG |
f0083e3d GKH |
150 | # arch specific objects |
151 | ARCH_LIB_OBJS = \ | |
eadb1bbc | 152 | $(KLIBC_DIR)/libc.a |
f0083e3d | 153 | |
f0083e3d | 154 | |
2d5b6886 | 155 | CRT0 = $(KLIBC_DIR)/crt0.o |
74894b53 | 156 | LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) |
eea34a0e | 157 | CFLAGS += $(WARNINGS) -nostdinc \ |
60ea6945 | 158 | $(OPTFLAGS) \ |
eea34a0e GKH |
159 | -D__KLIBC__ -fno-builtin-printf \ |
160 | -I$(INCLUDE_DIR) \ | |
161 | -I$(KLIBC_DIR)/arch/$(ARCH)/include \ | |
162 | -I$(INCLUDE_DIR)/bits$(BITSIZE) \ | |
163 | -I$(GCCINCDIR) \ | |
164 | -I$(LINUX_INCLUDE_DIR) | |
2d5b6886 | 165 | LIB_OBJS = |
7f2ea6a3 | 166 | LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs |
f0083e3d | 167 | else |
eea34a0e | 168 | WARNINGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations |
2d5b6886 | 169 | CRT0 = |
f0083e3d | 170 | LIBC = |
eea34a0e | 171 | CFLAGS += $(WARNINGS) -I$(GCCINCDIR) |
f0083e3d | 172 | LIB_OBJS = -lc |
fb43c2b2 | 173 | LDFLAGS = |
f0083e3d GKH |
174 | endif |
175 | ||
eadb1bbc PM |
176 | CFLAGS += -I$(PWD)/libsysfs |
177 | ||
e56f0058 | 178 | all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(STARTER) |
49cd31b3 | 179 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc | 180 | echo $$target ; \ |
977083c2 GKH |
181 | $(MAKE) prefix=$(prefix) \ |
182 | LD="$(LD)" \ | |
183 | SYSFS="$(SYSFS)" \ | |
184 | KERNEL_DIR="$(KERNEL_DIR)" \ | |
eadb1bbc PM |
185 | -C $$target $@ ; \ |
186 | done ; \ | |
f0083e3d | 187 | |
871ea775 PM |
188 | $(ARCH_LIB_OBJS) : $(CRT0) |
189 | ||
190 | $(CRT0): | |
977083c2 | 191 | $(MAKE) -C klibc KERNEL_DIR=$(KERNEL_DIR) |
f0083e3d | 192 | |
5c75a3ec GKH |
193 | TDB = tdb/tdb.o \ |
194 | tdb/spinlock.o | |
195 | ||
eadb1bbc PM |
196 | SYSFS = $(PWD)/libsysfs/sysfs_bus.o \ |
197 | $(PWD)/libsysfs/sysfs_class.o \ | |
198 | $(PWD)/libsysfs/sysfs_device.o \ | |
199 | $(PWD)/libsysfs/sysfs_dir.o \ | |
200 | $(PWD)/libsysfs/sysfs_driver.o \ | |
201 | $(PWD)/libsysfs/sysfs_utils.o \ | |
202 | $(PWD)/libsysfs/dlist.o | |
a2822451 | 203 | |
c81b35c0 KS |
204 | OBJS = udev_lib.o \ |
205 | udev_config.o \ | |
ea733a2f GKH |
206 | udev-add.o \ |
207 | udev-remove.o \ | |
a2822451 | 208 | udevdb.o \ |
a2822451 | 209 | namedev.o \ |
19feb351 | 210 | namedev_parse.o \ |
5c75a3ec | 211 | $(SYSFS) \ |
a2822451 | 212 | $(TDB) |
28972fe8 | 213 | |
1f6d07b9 | 214 | HEADERS = udev.h \ |
c81b35c0 | 215 | udev_lib.h \ |
869fc2f1 GKH |
216 | namedev.h \ |
217 | udev_version.h \ | |
218 | udev_dbus.h \ | |
219 | udevdb.h \ | |
220 | klibc_fixups.h \ | |
221 | logging.h \ | |
222 | list.h | |
223 | ||
66626948 | 224 | ifeq ($(strip $(USE_KLIBC)),true) |
6a670d61 GKH |
225 | OBJS += klibc_fixups.o |
226 | endif | |
227 | ||
66626948 | 228 | ifeq ($(USE_DBUS), true) |
bbd063b5 GKH |
229 | CFLAGS += -DUSE_DBUS |
230 | CFLAGS += $(shell pkg-config --cflags dbus-1) | |
62adf3f7 | 231 | LDFLAGS += $(shell pkg-config --libs dbus-1) |
bbd063b5 GKH |
232 | OBJS += udev_dbus.o |
233 | endif | |
234 | ||
8481f8ce GKH |
235 | # if USE_SELINUX is enabled, then we do not strip or optimize |
236 | ifeq ($(strip $(USE_SELINUX)),true) | |
237 | CFLAGS += -DUSE_SELINUX | |
238 | OBJS += udev_selinux.o | |
239 | LIB_OBJS += -lselinux | |
240 | endif | |
241 | ||
242 | ||
f0083e3d GKH |
243 | # header files automatically generated |
244 | GEN_HEADERS = udev_version.h | |
245 | ||
246 | # Rules on how to create the generated header files | |
247 | udev_version.h: | |
6739707d | 248 | @echo \#define UDEV_VERSION \"$(VERSION)\" > $@ |
18a0d652 OH |
249 | @echo \#define UDEV_ROOT \"$(udevdir)/\" >> $@ |
250 | @echo \#define UDEV_DB \"$(udevdir)/\.udev.tdb\" >> $@ | |
3836a3c4 GKH |
251 | @echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@ |
252 | @echo \#define UDEV_CONFIG_FILE \"$(configdir)\udev.conf\" >> $@ | |
253 | @echo \#define UDEV_RULES_FILE \"$(configdir)\udev.rules\" >> $@ | |
254 | @echo \#define UDEV_PERMISSION_FILE \"$(configdir)\udev.permissions\" >> $@ | |
4d803d8d | 255 | @echo \#define UDEV_LOG_DEFAULT \"yes\" >> $@ |
8e2229c4 KS |
256 | @echo \#define UDEV_BIN \"$(DESTDIR)$(sbindir)/udev\" >> $@ |
257 | @echo \#define UDEVD_BIN \"$(DESTDIR)$(sbindir)/udevd\" >> $@ | |
f0083e3d | 258 | |
71896b56 | 259 | # config files automatically generated |
6d88260a | 260 | GEN_CONFIGS = $(LOCAL_CFG_DIR)/udev.conf |
71896b56 GKH |
261 | |
262 | # Rules on how to create the generated config files | |
6d88260a GKH |
263 | $(LOCAL_CFG_DIR)/udev.conf: |
264 | sed -e "s:@udevdir@:$(udevdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@ | |
71896b56 GKH |
265 | |
266 | ||
871ea775 | 267 | $(OBJS): $(GEN_HEADERS) |
eb10f97f GKH |
268 | $(ROOT).o: $(GEN_HEADERS) |
269 | $(TESTER).o: $(GEN_HEADERS) | |
e56f0058 | 270 | $(INFO).o: $(GEN_HEADERS) |
eb10f97f GKH |
271 | $(DAEMON).o: $(GEN_HEADERS) |
272 | $(SENDER).o: $(GEN_HEADERS) | |
82b9a637 | 273 | $(STARTER).o: $(GEN_HEADERS) |
f0083e3d | 274 | |
eb10f97f | 275 | $(ROOT): $(ROOT).o $(OBJS) $(HEADERS) $(LIBC) |
869fc2f1 GKH |
276 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udev.o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) |
277 | $(STRIPCMD) $@ | |
278 | ||
eb10f97f GKH |
279 | $(TESTER): $(TESTER).o $(OBJS) $(HEADERS) $(LIBC) |
280 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udevtest.o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) | |
281 | $(STRIPCMD) $@ | |
282 | ||
e56f0058 | 283 | $(INFO): $(INFO).o $(OBJS) $(HEADERS) $(LIBC) |
c81b35c0 | 284 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o udev_lib.o udev_config.o udevdb.o $(SYSFS) $(TDB) $(LIB_OBJS) $(ARCH_LIB_OBJS) |
869fc2f1 | 285 | $(STRIPCMD) $@ |
f0083e3d | 286 | |
eb10f97f | 287 | $(DAEMON): $(DAEMON).o udevd.h $(LIBC) |
2f6cbd19 | 288 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udevd.o $(LIB_OBJS) $(ARCH_LIB_OBJS) |
869fc2f1 | 289 | $(STRIPCMD) $@ |
7fafc032 | 290 | |
eb10f97f | 291 | $(SENDER): $(SENDER).o udevd.h $(LIBC) |
c81b35c0 | 292 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udevsend.o udev_lib.o $(LIB_OBJS) $(ARCH_LIB_OBJS) |
869fc2f1 | 293 | $(STRIPCMD) $@ |
7fafc032 | 294 | |
82b9a637 GKH |
295 | $(STARTER): $(STARTER).o $(HEADERS) $(LIBC) |
296 | $(LD) $(LDFLAGS) -o $@ $(CRT0) udevstart.o $(LIB_OBJS) $(ARCH_LIB_OBJS) | |
297 | $(STRIPCMD) $@ | |
298 | ||
f0083e3d GKH |
299 | clean: |
300 | -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ | |
301 | | xargs rm -f | |
e56f0058 | 302 | -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(INFO) $(DAEMON) $(SENDER) $(TESTER) $(STARTER) |
f0083e3d | 303 | $(MAKE) -C klibc clean |
49cd31b3 | 304 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc PM |
305 | echo $$target ; \ |
306 | $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ | |
307 | -C $$target $@ ; \ | |
308 | done ; \ | |
f0083e3d | 309 | |
2761f9b9 OH |
310 | spotless: clean |
311 | ||
e64280b8 | 312 | DISTFILES = $(shell find . \( -not -name '.' \) -print | grep -v -e CVS -e "\.tar\.gz$" -e "\/\." -e releases -e BitKeeper -e SCCS -e "\.tdb$" -e test/sys | sort ) |
f0083e3d GKH |
313 | DISTDIR := $(RELEASE_NAME) |
314 | srcdir = . | |
54e3a5d3 | 315 | release: clean |
e9b2679f GKH |
316 | -rm -rf $(DISTDIR) |
317 | mkdir $(DISTDIR) | |
318 | chmod 777 $(DISTDIR) | |
319 | bk export $(DISTDIR) | |
320 | tar -c $(DISTDIR) | gzip -9 > $(RELEASE_NAME).tar.gz | |
321 | rm -rf $(DISTDIR) | |
322 | @echo "$(RELEASE_NAME).tar.gz created" | |
54e3a5d3 GKH |
323 | |
324 | ||
325 | small_release: $(DISTFILES) clean | |
f0083e3d GKH |
326 | # @echo $(DISTFILES) |
327 | @-rm -rf $(DISTDIR) | |
328 | @mkdir $(DISTDIR) | |
329 | @-chmod 777 $(DISTDIR) | |
330 | @for file in $(DISTFILES); do \ | |
331 | if test -d $$file; then \ | |
332 | mkdir $(DISTDIR)/$$file; \ | |
333 | else \ | |
334 | cp -p $$file $(DISTDIR)/$$file; \ | |
335 | fi; \ | |
336 | done | |
337 | @tar -c $(DISTDIR) | gzip -9 > $(RELEASE_NAME).tar.gz | |
338 | @rm -rf $(DISTDIR) | |
339 | @echo "Built $(RELEASE_NAME).tar.gz" | |
9f53b06a GKH |
340 | |
341 | ||
66626948 | 342 | ifeq ($(USE_DBUS), true) |
5aebfbcb DZ |
343 | install-dbus-policy: |
344 | $(INSTALL) -d $(DESTDIR)$(dbusdir) | |
8ccd82e0 GKH |
345 | $(INSTALL_DATA) etc/dbus-1/system.d/udev_sysbus_policy.conf $(DESTDIR)$(dbusdir) |
346 | ||
5aebfbcb DZ |
347 | uninstall-dbus-policy: |
348 | - rm $(DESTDIR)$(dbusdir)/udev_sysbus_policy.conf | |
349 | else | |
350 | install-dbus-policy: | |
351 | - | |
352 | uninstall-dbus-policy: | |
353 | - | |
354 | endif | |
355 | ||
c58f8c30 | 356 | install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB |
357 | @if [ -f /etc/redhat-release ]; then \ | |
dfe421a9 | 358 | $(INSTALL_DATA) -D etc/init.d/udev $(DESTDIR)$(initdir)/udev; \ |
c58f8c30 | 359 | elif [ -f /etc/SuSE-release ]; then \ |
dfe421a9 | 360 | $(INSTALL_DATA) -D etc/init.d/udev.init.LSB $(DESTDIR)$(initdir)/udev; \ |
c58f8c30 | 361 | elif [ -f /etc/debian_version ]; then \ |
dfe421a9 | 362 | $(INSTALL_DATA) -D etc/init.d/udev.debian $(DESTDIR)$(initdir)/udev; \ |
c58f8c30 | 363 | fi |
364 | ||
7591c18a | 365 | install-config: $(GEN_CONFIGS) |
4360a56d | 366 | $(INSTALL) -d $(DESTDIR)$(configdir) |
7591c18a | 367 | @if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \ |
6d88260a GKH |
368 | echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ |
369 | $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ | |
7591c18a KS |
370 | fi |
371 | @if [ ! -r $(DESTDIR)$(configdir)udev.rules ]; then \ | |
6d88260a GKH |
372 | echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir); \ |
373 | $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir); \ | |
7591c18a KS |
374 | fi |
375 | @if [ ! -r $(DESTDIR)$(configdir)udev.permissions ]; then \ | |
6d88260a GKH |
376 | echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \ |
377 | $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \ | |
7591c18a KS |
378 | fi |
379 | ||
c58f8c30 | 380 | install: install-initscript install-config install-dbus-policy all |
7591c18a | 381 | $(INSTALL) -d $(DESTDIR)$(udevdir) |
4360a56d OH |
382 | $(INSTALL) -d $(DESTDIR)$(hotplugdir) |
383 | $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT) | |
8e2229c4 KS |
384 | $(INSTALL_PROGRAM) -D $(DAEMON) $(DESTDIR)$(sbindir)/$(DAEMON) |
385 | $(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER) | |
e56f0058 | 386 | $(INSTALL_PROGRAM) -D $(INFO) $(DESTDIR)$(usrbindir)/$(INFO) |
8a0acf85 | 387 | $(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(usrbindir)/$(TESTER) |
1f63fbdd | 388 | $(INSTALL_PROGRAM) -D $(STARTER) $(DESTDIR)$(sbindir)/$(STARTER) |
4360a56d | 389 | $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8 |
e31474a1 | 390 | $(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8 |
8a0acf85 | 391 | $(INSTALL_DATA) -D udevtest.8 $(DESTDIR)$(mandir)/man8/udevtest.8 |
b5e0fc32 | 392 | $(INSTALL_DATA) -D udevstart.8 $(DESTDIR)$(mandir)/man8/udevstart.8 |
7dae391f | 393 | $(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8 |
f070df16 | 394 | - ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevsend.8 |
db8f5cf2 | 395 | - ln -f -s $(sbindir)/$(SENDER) $(DESTDIR)$(hotplugdir)/$(ROOT).hotplug |
f070df16 KS |
396 | ifndef DESTDIR |
397 | - killall udevd | |
398 | - rm -f $(udevdir)/.udev.tdb | |
399 | endif | |
49cd31b3 | 400 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc PM |
401 | echo $$target ; \ |
402 | $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ | |
403 | -C $$target $@ ; \ | |
404 | done ; \ | |
6785820d | 405 | |
5aebfbcb | 406 | uninstall: uninstall-dbus-policy |
6785820d | 407 | - rm $(hotplugdir)/udev.hotplug |
d4112087 | 408 | - rm $(configdir)/udev.permissions |
e8baccca GKH |
409 | - rm $(configdir)/udev.rules |
410 | - rm $(configdir)/udev.conf | |
316c5150 | 411 | - rm $(initdir)/udev |
6785820d | 412 | - rm $(mandir)/man8/udev.8 |
e31474a1 | 413 | - rm $(mandir)/man8/udevinfo.8 |
8a0acf85 KS |
414 | - rm $(mandir)/man8/udevtest.8 |
415 | - rm $(mandir)/man8/udevstart.8 | |
416 | - rm $(mandir)/man8/udevd.8 | |
417 | - rm $(mandir)/man8/udevsend.8 | |
6785820d | 418 | - rm $(sbindir)/$(ROOT) |
8e2229c4 KS |
419 | - rm $(sbindir)/$(DAEMON) |
420 | - rm $(sbindir)/$(SENDER) | |
e56f0058 | 421 | - rm $(usrbindir)/$(INFO) |
6785820d GKH |
422 | - rmdir $(hotplugdir) |
423 | - rmdir $(configdir) | |
552a4d42 | 424 | - rm $(udevdir)/.udev.tdb |
6785820d | 425 | - rmdir $(udevdir) |
49cd31b3 | 426 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc PM |
427 | echo $$target ; \ |
428 | $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ | |
429 | -C $$target $@ ; \ | |
430 | done ; \ |