3 # Makefile for hotplug-ng
5 # Copyright (C) 2007 Andreas Oberritter
6 # Copyright (C) 2003-2005 Greg Kroah-Hartman <greg@kroah.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 ###############################################################################
24 CC = $(CROSS_COMPILE)gcc
25 CFLAGS ?= -pipe -Wall -Wextra -Wno-unused -Os -fomit-frame-pointer
26 LDFLAGS ?= -Wl,-warn-common -s
29 #CPPFLAGS += -DUDEVMONITOR
30 #CPPFLAGS += -DUDEVTRIGGER
32 # Set the following to control the use of syslog
33 # Unset it to remove all logging
34 #CPPFLAGS += -DUSE_LOG
36 # Set the following to log the debug.
37 # Leave this unset for production use.
40 ###############################################################################
43 hotplug_links = bdpoll
46 hotplug_basename.o hotplug_devpath.o hotplug_pidfile.o \
47 hotplug_setenv.o hotplug_socket.o hotplug_timeout.o hotplug_util.o \
48 module_block.o module_firmware.o module_ieee1394.o \
49 module_pci.o module_scsi.o module_usb.o \
50 udev_sysdeps.o udev_sysfs.o udev_utils.o udev_utils_string.o
52 ifneq ($(findstring -DUDEVMONITOR,$(CPPFLAGS)),)
53 hotplug_links += udevmonitor
54 hotplug_objs += udevmonitor.o
56 ifneq ($(findstring -DUDEVTRIGGER,$(CPPFLAGS)),)
57 hotplug_links += udevtrigger
58 hotplug_objs += udevtrigger.o
63 udev_version.h: .svn/entries
64 ./gen_udev_version.sh > $@
66 $(hotplug_objs): udev_version.h
68 $(hotplug_bin): $(hotplug_objs)
71 $(RM) $(hotplug_bin) $(hotplug_objs) udev_version.h
73 install: $(hotplug_bin)
74 $(INSTALL) -d $(DESTDIR)/sbin
75 $(INSTALL) -m755 $^ $(DESTDIR)/sbin
76 $(foreach link,$(hotplug_links),ln -sf $(hotplug_bin) $(DESTDIR)/sbin/$(link);)
79 $(foreach file,$(hotplug_bin) $(hotplug_links),$(RM) $(DESTDIR)/sbin/$(file);)