]>
Commit | Line | Data |
---|---|---|
8dfc8dbe | 1 | # Makefile for udev |
f0083e3d | 2 | # |
e7c4f85f | 3 | # Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com> |
6c18b1fb | 4 | # Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org> |
f0083e3d GKH |
5 | # |
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; version 2 of the License. | |
9 | # | |
10 | # This program 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 | # General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | # | |
19 | ||
6b493a20 | 20 | # Set this to make use of syslog. |
05230184 | 21 | USE_LOG = true |
54988802 | 22 | |
6b493a20 KS |
23 | # Set this to compile-in development debug messages. Pass UDEV_LOG="debug" |
24 | # to the executed binary or set the value in the udev configuration file to | |
25 | # let udev print the debug messages to syslog. | |
29b82deb | 26 | DEBUG = false |
f0083e3d | 27 | |
6c18b1fb | 28 | # Set this to include Security-Enhanced Linux support. |
9825617b | 29 | USE_SELINUX = false |
f0083e3d | 30 | |
6b493a20 | 31 | # Set this to comile with klibc instead of glibc. |
6c18b1fb KS |
32 | USE_KLIBC = false |
33 | ||
34 | # Set this to create statically linked binaries. | |
35 | USE_STATIC = false | |
36 | ||
37 | # To build any of the extras programs, run with: | |
38 | # make EXTRAS="extras/a extras/b" | |
39 | EXTRAS= | |
40 | ||
41 | # make the build silent. Set this to something else to make it noisy again. | |
42 | V=false | |
43 | ||
f0083e3d | 44 | ROOT = udev |
7fafc032 KS |
45 | DAEMON = udevd |
46 | SENDER = udevsend | |
e56f0058 | 47 | INFO = udevinfo |
eb10f97f | 48 | TESTER = udevtest |
82b9a637 | 49 | STARTER = udevstart |
9530f1fe | 50 | VERSION = 057 |
f0083e3d | 51 | INSTALL_DIR = /usr/local/bin |
1e7a3f9e | 52 | RELEASE_NAME = $(ROOT)-$(VERSION) |
6d88260a | 53 | LOCAL_CFG_DIR = etc/udev |
4360a56d | 54 | DESTDIR = |
977083c2 GKH |
55 | KERNEL_DIR = /lib/modules/${shell uname -r}/build |
56 | ||
6739707d | 57 | # override this to make udev look in a different location for it's config files |
9f53b06a GKH |
58 | prefix = |
59 | exec_prefix = ${prefix} | |
60 | etcdir = ${prefix}/etc | |
61 | sbindir = ${exec_prefix}/sbin | |
e56f0058 | 62 | usrbindir = ${exec_prefix}/usr/bin |
9f53b06a GKH |
63 | mandir = ${prefix}/usr/share/man |
64 | hotplugdir = ${etcdir}/hotplug.d/default | |
aef6bb13 KS |
65 | configdir = ${etcdir}/udev |
66 | initdir = ${etcdir}/init.d | |
67 | dev_ddir = ${etcdir}/dev.d | |
9f53b06a GKH |
68 | srcdir = . |
69 | ||
70 | INSTALL = /usr/bin/install -c | |
71 | INSTALL_PROGRAM = ${INSTALL} | |
72 | INSTALL_DATA = ${INSTALL} -m 644 | |
73 | INSTALL_SCRIPT = ${INSTALL_PROGRAM} | |
74 | ||
6739707d | 75 | # place to put our device nodes |
2b41e68a KS |
76 | udevdir = ${prefix}/udev |
77 | udevdb = ${udevdir}/.udevdb | |
f0083e3d | 78 | |
89067448 GKH |
79 | # set up PWD so that older versions of make will work with our build. |
80 | PWD = $(shell pwd) | |
81 | ||
f0083e3d | 82 | # If you are running a cross compiler, you may want to set this |
e64280b8 | 83 | # to something more interesting, like "arm-linux-". If you want |
f0083e3d GKH |
84 | # to compile vs uClibc, that can be done here as well. |
85 | CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- | |
86 | CC = $(CROSS)gcc | |
74894b53 | 87 | LD = $(CROSS)gcc |
f0083e3d GKH |
88 | AR = $(CROSS)ar |
89 | STRIP = $(CROSS)strip | |
b137e367 | 90 | RANLIB = $(CROSS)ranlib |
c04a1647 | 91 | HOSTCC = gcc |
f0083e3d | 92 | |
92ebb398 | 93 | export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS |
f0083e3d GKH |
94 | |
95 | # code taken from uClibc to determine the current arch | |
96 | ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \ | |
bfd8a5d0 | 97 | -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'} |
f0083e3d GKH |
98 | |
99 | # code taken from uClibc to determine the gcc include dir | |
1352a36f | 100 | GCCINCDIR := ${shell LC_ALL=C $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"} |
f0083e3d GKH |
101 | |
102 | # code taken from uClibc to determine the libgcc.a filename | |
103 | GCC_LIB := $(shell $(CC) -print-libgcc-file-name ) | |
104 | ||
105 | # use '-Os' optimization if available, else use -O2 | |
106 | OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ | |
107 | then echo "-Os"; else echo "-O2" ; fi} | |
108 | ||
51df9ee4 KS |
109 | # check if compiler option is supported |
110 | cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;} | |
111 | ||
92ebb398 KS |
112 | CFLAGS += -Wall -fno-builtin -Wchar-subscripts -Wpointer-arith -Wstrict-prototypes -Wsign-compare |
113 | CFLAGS += $(call cc-supports,-Wno-pointer-sign) | |
114 | CFLAGS += $(call cc-supports,-Wdeclaration-after-statement) | |
115 | CFLAGS += -pipe | |
116 | CFLAGS += -D_GNU_SOURCE | |
12901d99 | 117 | |
045b1f0f | 118 | HEADERS = \ |
57e1a277 KS |
119 | udev.h \ |
120 | udev_utils.h \ | |
e5e322bc | 121 | udev_rules.h \ |
57e1a277 KS |
122 | udev_version.h \ |
123 | udev_db.h \ | |
124 | udev_sysfs.h \ | |
125 | logging.h \ | |
126 | udev_libc_wrapper.h \ | |
127 | udev_selinux.h \ | |
045b1f0f KS |
128 | list.h |
129 | ||
130 | SYSFS_OBJS = \ | |
045b1f0f KS |
131 | libsysfs/sysfs_class.o \ |
132 | libsysfs/sysfs_device.o \ | |
133 | libsysfs/sysfs_dir.o \ | |
134 | libsysfs/sysfs_driver.o \ | |
135 | libsysfs/sysfs_utils.o \ | |
136 | libsysfs/dlist.o | |
137 | ||
138 | UDEV_OBJS = \ | |
139 | udev_utils.o \ | |
140 | udev_config.o \ | |
141 | udev_add.o \ | |
142 | udev_remove.o \ | |
045b1f0f KS |
143 | udev_sysfs.o \ |
144 | udev_db.o \ | |
145 | udev_multiplex.o \ | |
e5e322bc KS |
146 | udev_rules.o \ |
147 | udev_rules_parse.o \ | |
57e1a277 | 148 | udev_libc_wrapper.o |
045b1f0f KS |
149 | |
150 | OBJS = \ | |
151 | udev.a \ | |
152 | libsysfs/sysfs.a | |
153 | ||
154 | SYSFS = $(PWD)/libsysfs/sysfs.a | |
155 | ||
156 | CFLAGS += -I$(PWD)/libsysfs/sysfs \ | |
157 | -I$(PWD)/libsysfs | |
158 | ||
05230184 | 159 | ifeq ($(strip $(USE_LOG)),true) |
6c18b1fb | 160 | CFLAGS += -DUSE_LOG |
54988802 KS |
161 | endif |
162 | ||
f0083e3d GKH |
163 | # if DEBUG is enabled, then we do not strip or optimize |
164 | ifeq ($(strip $(DEBUG)),true) | |
92ebb398 KS |
165 | CFLAGS += -O1 -g -DDEBUG |
166 | LDFLAGS += -Wl | |
f0083e3d GKH |
167 | STRIPCMD = /bin/true -Since_we_are_debugging |
168 | else | |
92ebb398 KS |
169 | CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer |
170 | LDFLAGS += -s -Wl | |
f0083e3d GKH |
171 | STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment |
172 | endif | |
173 | ||
fb43c2b2 | 174 | # If we are using our version of klibc, then we need to build, link it, and then |
045b1f0f | 175 | # link udev against it statically. Otherwise, use glibc and link dynamically. |
66626948 | 176 | ifeq ($(strip $(USE_KLIBC)),true) |
92ebb398 KS |
177 | KLIBC_INSTALL = $(PWD)/klibc/.install |
178 | KLCC = $(KLIBC_INSTALL)/bin/klcc | |
179 | CC = $(KLCC) | |
180 | LD = $(KLCC) | |
181 | LDFLAGS += -static | |
f0083e3d | 182 | else |
92ebb398 | 183 | CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations |
f0083e3d GKH |
184 | endif |
185 | ||
9825617b | 186 | ifeq ($(strip $(USE_SELINUX)),true) |
045b1f0f | 187 | UDEV_OBJS += udev_selinux.o |
9825617b | 188 | LIB_OBJS += -lselinux |
045b1f0f | 189 | CFLAGS += -DUSE_SELINUX |
9825617b HH |
190 | endif |
191 | ||
6c18b1fb KS |
192 | ifeq ($(strip $(USE_STATIC)),true) |
193 | CFLAGS += -DUSE_STATIC | |
194 | LDFLAGS += -static | |
195 | endif | |
196 | ||
045b1f0f KS |
197 | ifeq ($(strip $(V)),false) |
198 | QUIET=@$(PWD)/ccdv | |
199 | HOST_PROGS=ccdv | |
200 | else | |
201 | QUIET= | |
202 | HOST_PROGS= | |
203 | endif | |
eadb1bbc | 204 | |
b8898800 | 205 | # config files automatically generated |
206 | GEN_CONFIGS = $(LOCAL_CFG_DIR)/udev.conf | |
207 | ||
92ebb398 | 208 | all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(STARTER) $(GEN_CONFIGS) $(KLCC) |
49cd31b3 | 209 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc | 210 | echo $$target ; \ |
977083c2 GKH |
211 | $(MAKE) prefix=$(prefix) \ |
212 | LD="$(LD)" \ | |
125930b4 | 213 | SYSFS="$(SYSFS)" \ |
977083c2 | 214 | KERNEL_DIR="$(KERNEL_DIR)" \ |
09f27560 | 215 | QUIET="$(QUIET)" \ |
eadb1bbc PM |
216 | -C $$target $@ ; \ |
217 | done ; \ | |
f0083e3d | 218 | |
92ebb398 | 219 | $(KLCC): |
87b60f72 | 220 | $(MAKE) -j1 -C klibc KRNLSRC=$(KERNEL_DIR) SUBDIRS=klibc TESTS= \ |
92ebb398 KS |
221 | SHLIBDIR=$(KLIBC_INSTALL)/lib \ |
222 | INSTALLDIR=$(KLIBC_INSTALL) \ | |
223 | bindir=$(KLIBC_INSTALL)/bin \ | |
224 | mandir=$(KLIBC_INSTALL)/man all install | |
21c03673 | 225 | -find $(KLIBC_INSTALL)/include -name SCCS -print| xargs rm -rf |
f0083e3d | 226 | |
7c2aae11 | 227 | udev.a: $(UDEV_OBJS) |
9aa0485c | 228 | rm -f $@ |
7c2aae11 KS |
229 | $(QUIET) $(AR) cq $@ $(UDEV_OBJS) |
230 | $(QUIET) $(RANLIB) $@ | |
231 | ||
232 | libsysfs/sysfs.a: $(SYSFS_OBJS) | |
9aa0485c | 233 | rm -f $@ |
7c2aae11 KS |
234 | $(QUIET) $(AR) cq $@ $(SYSFS_OBJS) |
235 | $(QUIET) $(RANLIB) $@ | |
236 | ||
f0083e3d GKH |
237 | # header files automatically generated |
238 | GEN_HEADERS = udev_version.h | |
239 | ||
c04a1647 GKH |
240 | ccdv: |
241 | @echo "Building ccdv" | |
242 | @$(HOSTCC) -O1 ccdv.c -o ccdv | |
243 | ||
f0083e3d GKH |
244 | # Rules on how to create the generated header files |
245 | udev_version.h: | |
c36f0ac3 | 246 | @echo "Creating udev_version.h" |
aef6bb13 | 247 | @echo \#define UDEV_VERSION \"$(VERSION)\" > $@ |
2b41e68a KS |
248 | @echo \#define UDEV_ROOT \"$(udevdir)\" >> $@ |
249 | @echo \#define UDEV_DB \"$(udevdb)\" >> $@ | |
aef6bb13 KS |
250 | @echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@ |
251 | @echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@ | |
252 | @echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@ | |
aef6bb13 KS |
253 | @echo \#define UDEV_BIN \"$(DESTDIR)$(sbindir)/udev\" >> $@ |
254 | @echo \#define UDEVD_BIN \"$(DESTDIR)$(sbindir)/udevd\" >> $@ | |
f0083e3d | 255 | |
71896b56 | 256 | # Rules on how to create the generated config files |
31a6e028 GKH |
257 | $(LOCAL_CFG_DIR)/udev.conf: |
258 | sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@ | |
71896b56 | 259 | |
08b5da6a GKH |
260 | GEN_MANPAGES = udev.8 |
261 | GEN_MANPAGESIN = udev.8.in | |
438ac360 | 262 | # Rules on how to create the man pages |
31a6e028 GKH |
263 | $(GEN_MANPAGES): $(GEN_MANPAGESIN) |
264 | sed -e "s:@udevdir@:$(udevdir):" < $@.in > $@ | |
438ac360 | 265 | |
87b60f72 KS |
266 | $(UDEV_OBJS): $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) |
267 | $(SYSFS_OBJS): $(HOST_PROGS) $(KLCC) | |
268 | $(OBJS): $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
269 | $(ROOT).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
270 | $(TESTER).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
271 | $(INFO).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
272 | $(DAEMON).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
273 | $(SENDER).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
274 | $(STARTER).o: $(GEN_HEADERS) $(HOST_PROGS) $(KLCC) | |
f0083e3d | 275 | |
92ebb398 KS |
276 | $(ROOT): $(KLCC) $(ROOT).o $(OBJS) $(HEADERS) $(GEN_MANPAGES) |
277 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(ROOT).o $(OBJS) $(LIB_OBJS) | |
c04a1647 | 278 | $(QUIET) $(STRIPCMD) $@ |
869fc2f1 | 279 | |
92ebb398 KS |
280 | $(TESTER): $(KLCC) $(TESTER).o $(OBJS) $(HEADERS) |
281 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(TESTER).o $(OBJS) $(LIB_OBJS) | |
c04a1647 | 282 | $(QUIET) $(STRIPCMD) $@ |
eb10f97f | 283 | |
92ebb398 KS |
284 | $(INFO): $(KLCC) $(INFO).o $(OBJS) $(HEADERS) |
285 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(INFO).o $(OBJS) $(LIB_OBJS) | |
c04a1647 | 286 | $(QUIET) $(STRIPCMD) $@ |
f0083e3d | 287 | |
92ebb398 KS |
288 | $(DAEMON): $(KLCC) $(DAEMON).o $(OBJS) udevd.h |
289 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(DAEMON).o $(OBJS) $(LIB_OBJS) | |
c04a1647 | 290 | $(QUIET) $(STRIPCMD) $@ |
7fafc032 | 291 | |
92ebb398 KS |
292 | $(SENDER): $(KLCC) $(SENDER).o $(OBJS) udevd.h |
293 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(SENDER).o $(OBJS) $(LIB_OBJS) | |
c04a1647 | 294 | $(QUIET) $(STRIPCMD) $@ |
7fafc032 | 295 | |
92ebb398 KS |
296 | $(STARTER): $(KLCC) $(STARTER).o $(OBJS) |
297 | $(QUIET) $(LD) $(LDFLAGS) -o $@ $(STARTER).o $(OBJS) $(LIB_OBJS) | |
56a8a624 KS |
298 | $(QUIET) $(STRIPCMD) $@ |
299 | ||
c04a1647 GKH |
300 | .c.o: |
301 | $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< | |
302 | ||
f0083e3d GKH |
303 | clean: |
304 | -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ | |
305 | | xargs rm -f | |
319112e2 KS |
306 | -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(GEN_MANPAGES) $(INFO) $(DAEMON) \ |
307 | $(SENDER) $(TESTER) $(STARTER) | |
c36f0ac3 | 308 | -rm -f ccdv |
0d9057a1 | 309 | $(MAKE) -C klibc SUBDIRS=klibc clean |
49cd31b3 | 310 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc PM |
311 | echo $$target ; \ |
312 | $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ | |
313 | -C $$target $@ ; \ | |
314 | done ; \ | |
f0083e3d | 315 | |
2761f9b9 | 316 | spotless: clean |
0d9057a1 | 317 | $(MAKE) -C klibc SUBDIRS=klibc spotless |
92ebb398 | 318 | rm -rf klibc/.install |
2761f9b9 | 319 | |
2b41e68a | 320 | DISTFILES = $(shell find . \( -not -name '.' \) -print | grep -v -e CVS -e "\.tar\.gz" -e "\/\." -e releases -e BitKeeper -e SCCS -e test/sys | sort ) |
f0083e3d GKH |
321 | DISTDIR := $(RELEASE_NAME) |
322 | srcdir = . | |
04b49aab | 323 | release: spotless |
e9b2679f GKH |
324 | -rm -rf $(DISTDIR) |
325 | mkdir $(DISTDIR) | |
326 | chmod 777 $(DISTDIR) | |
6b3df431 | 327 | bk export -w $(DISTDIR) |
e9b2679f GKH |
328 | tar -c $(DISTDIR) | gzip -9 > $(RELEASE_NAME).tar.gz |
329 | rm -rf $(DISTDIR) | |
330 | @echo "$(RELEASE_NAME).tar.gz created" | |
54e3a5d3 GKH |
331 | |
332 | ||
04b49aab | 333 | small_release: $(DISTFILES) spotless |
f0083e3d GKH |
334 | # @echo $(DISTFILES) |
335 | @-rm -rf $(DISTDIR) | |
336 | @mkdir $(DISTDIR) | |
337 | @-chmod 777 $(DISTDIR) | |
338 | @for file in $(DISTFILES); do \ | |
339 | if test -d $$file; then \ | |
340 | mkdir $(DISTDIR)/$$file; \ | |
341 | else \ | |
342 | cp -p $$file $(DISTDIR)/$$file; \ | |
343 | fi; \ | |
344 | done | |
345 | @tar -c $(DISTDIR) | gzip -9 > $(RELEASE_NAME).tar.gz | |
346 | @rm -rf $(DISTDIR) | |
347 | @echo "Built $(RELEASE_NAME).tar.gz" | |
9f53b06a | 348 | |
b8898800 | 349 | install-config: |
aef6bb13 | 350 | $(INSTALL) -d $(DESTDIR)$(configdir)/rules.d |
aef6bb13 | 351 | @if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \ |
6d88260a GKH |
352 | echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ |
353 | $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ | |
7591c18a | 354 | fi |
aef6bb13 KS |
355 | @if [ ! -r $(DESTDIR)$(configdir)/rules.d/50-udev.rules ]; then \ |
356 | echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir)/rules.d/50-udev.rules; \ | |
357 | $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir)/rules.d/50-udev.rules; \ | |
7591c18a | 358 | fi |
7591c18a | 359 | |
df73b398 | 360 | install-dev.d: |
aef6bb13 KS |
361 | $(INSTALL) -d $(DESTDIR)$(dev_ddir)/default |
362 | $(INSTALL_PROGRAM) -D etc/dev.d/net/hotplug.dev $(DESTDIR)$(dev_ddir)/net/hotplug.dev | |
42e4b681 GKH |
363 | |
364 | uninstall-dev.d: | |
aef6bb13 KS |
365 | - rm $(dev_ddir)/net/hotplug.dev |
366 | - rmdir $(dev_ddir)/net | |
367 | - rmdir $(dev_ddir)/default | |
42e4b681 | 368 | - rmdir $(dev_ddir) |
df73b398 | 369 | |
487c1b35 | 370 | install-man: |
438ac360 GKH |
371 | $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8 |
372 | $(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8 | |
373 | $(INSTALL_DATA) -D udevtest.8 $(DESTDIR)$(mandir)/man8/udevtest.8 | |
374 | $(INSTALL_DATA) -D udevstart.8 $(DESTDIR)$(mandir)/man8/udevstart.8 | |
375 | $(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8 | |
376 | - ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevsend.8 | |
377 | ||
378 | uninstall-man: | |
379 | - rm $(mandir)/man8/udev.8 | |
380 | - rm $(mandir)/man8/udevinfo.8 | |
381 | - rm $(mandir)/man8/udevtest.8 | |
382 | - rm $(mandir)/man8/udevstart.8 | |
383 | - rm $(mandir)/man8/udevd.8 | |
384 | - rm $(mandir)/man8/udevsend.8 | |
385 | ||
c6408198 | 386 | install: install-config install-man install-dev.d all |
7591c18a | 387 | $(INSTALL) -d $(DESTDIR)$(udevdir) |
4360a56d OH |
388 | $(INSTALL) -d $(DESTDIR)$(hotplugdir) |
389 | $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT) | |
8e2229c4 KS |
390 | $(INSTALL_PROGRAM) -D $(DAEMON) $(DESTDIR)$(sbindir)/$(DAEMON) |
391 | $(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER) | |
e56f0058 | 392 | $(INSTALL_PROGRAM) -D $(INFO) $(DESTDIR)$(usrbindir)/$(INFO) |
8a0acf85 | 393 | $(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(usrbindir)/$(TESTER) |
56a8a624 | 394 | $(INSTALL_PROGRAM) -D $(STARTER) $(DESTDIR)$(sbindir)/$(STARTER) |
cb7c281b | 395 | - ln -f -s $(sbindir)/$(SENDER) $(DESTDIR)$(hotplugdir)/10-udev.hotplug |
f070df16 | 396 | ifndef DESTDIR |
2b41e68a KS |
397 | - killall $(DAEMON) |
398 | - rm -rf $(udevdb) | |
f070df16 | 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 | |
438ac360 | 406 | uninstall: uninstall-man uninstall-dev.d |
cb7c281b | 407 | - rm $(hotplugdir)/10-udev.hotplug |
aef6bb13 | 408 | - rm $(configdir)/rules.d/50-udev.rules |
e8baccca | 409 | - rm $(configdir)/udev.conf |
aef6bb13 | 410 | - rmdir $(configdir)/rules.d |
aef6bb13 | 411 | - rmdir $(configdir) |
6785820d | 412 | - rm $(sbindir)/$(ROOT) |
8e2229c4 KS |
413 | - rm $(sbindir)/$(DAEMON) |
414 | - rm $(sbindir)/$(SENDER) | |
aef6bb13 | 415 | - rm $(sbindir)/$(STARTER) |
e56f0058 | 416 | - rm $(usrbindir)/$(INFO) |
aef6bb13 | 417 | - rm $(usrbindir)/$(TESTER) |
6785820d | 418 | - rmdir $(hotplugdir) |
2b41e68a | 419 | - rm -rf $(udevdb) |
6785820d | 420 | - rmdir $(udevdir) |
2b41e68a | 421 | - killall $(DAEMON) |
49cd31b3 | 422 | @extras="$(EXTRAS)" ; for target in $$extras ; do \ |
eadb1bbc PM |
423 | echo $$target ; \ |
424 | $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ | |
425 | -C $$target $@ ; \ | |
426 | done ; \ | |
bd842ba4 GKH |
427 | |
428 | test: all | |
e9f65389 | 429 | @ cd test && ./udev-test.pl |
05bd6efb | 430 | @ cd test && ./udevstart-test.pl |