From db28d2ea4f95aee82ec3619546546eb1506be46a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 14 Sep 2005 17:00:02 +0200 Subject: [PATCH] EXTRAS: cleanup and sync all Makefiles Signed-off-by: Kay Sievers --- Makefile | 17 +++-- extras/ata_id/Makefile | 54 ++++++++++------ extras/cdrom_id/Makefile | 61 ++++++++++++------ extras/dasd_id/Makefile | 54 ++++++++++------ extras/edd_id/Makefile | 54 ++++++++++------ extras/firmware/Makefile | 54 ++++++++++------ extras/floppy/Makefile | 53 ++++++++++------ extras/run_directory/Makefile | 65 +++++++++++-------- extras/scsi_id/Makefile | 116 ++++++++++++++++++---------------- extras/usb_id/Makefile | 54 ++++++++++------ extras/volume_id/Makefile | 60 +++++++++++------- test/simple-build-check.sh | 1 - 12 files changed, 405 insertions(+), 238 deletions(-) diff --git a/Makefile b/Makefile index 7e3adb975b..46d5365694 100644 --- a/Makefile +++ b/Makefile @@ -147,8 +147,6 @@ STRIP = $(CROSS)strip RANLIB = $(CROSS)ranlib HOSTCC = gcc -export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS - # code taken from uClibc to determine the current arch ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \ -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'} @@ -229,7 +227,12 @@ all: $(KLCC) $(PROGRAMS) $(MAN_PAGES) @extras="$(EXTRAS)"; for target in $$extras; do \ echo $$target; \ $(MAKE) prefix=$(prefix) \ + CC="$(CC)" \ + CFLAGS="$(CFLAGS)" \ LD="$(LD)" \ + LDFLAGS="$(LDFLAGS)" \ + STRIPCMD="$(STRIPCMD)" \ + LIB_OBJS="$(LIB_OBJS)" \ LIBUDEV="$(PWD)/$(LIBUDEV)" \ LIBSYSFS="$(PWD)/$(LIBSYSFS)" \ KERNEL_DIR="$(KERNEL_DIR)" \ @@ -243,7 +246,7 @@ all: $(KLCC) $(PROGRAMS) $(MAN_PAGES) .SUFFIXES: # build the objects -%.o: %.c +%.o: %.c $(GEN_HEADERS) $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ # "Static Pattern Rule" to build all programs @@ -379,15 +382,15 @@ install-bin: $(INSTALL_PROGRAM) -D udevinfo $(DESTDIR)$(usrbindir)/udevinfo $(INSTALL_PROGRAM) -D udevtest $(DESTDIR)$(usrbindir)/udevtest $(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart + @extras="$(EXTRAS)"; for target in $$extras; do \ + echo $$target; \ + $(MAKE) prefix=$(prefix) -C $$target $@; \ + done; ifndef DESTDIR - killall udevd - rm -rf $(udevdb) - $(sbindir)/udevd --daemon endif - @extras="$(EXTRAS)"; for target in $$extras; do \ - echo $$target; \ - $(MAKE) prefix=$(prefix) -C $$target $@; \ - done; .PHONY: install-bin uninstall-bin: diff --git a/extras/ata_id/Makefile b/extras/ata_id/Makefile index 769b7e3c2d..d93e694778 100644 --- a/extras/ata_id/Makefile +++ b/extras/ata_id/Makefile @@ -1,15 +1,15 @@ -# Makefile for ata_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = ata_id - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,23 +26,43 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = ata_id.o $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config + diff --git a/extras/cdrom_id/Makefile b/extras/cdrom_id/Makefile index c6dfc4e1a8..3e91d4fc47 100644 --- a/extras/cdrom_id/Makefile +++ b/extras/cdrom_id/Makefile @@ -1,16 +1,15 @@ -# Makefile for cdrom_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004 Kay Sievers -# Copyright (C) 2005 Greg Kroah-Hartman +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = cdrom_id - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -19,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -29,23 +26,49 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = cdrom_id.o $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config + +install: all install-bin install-config install-man +.PHONY: install + +uninstall: uninstall-bin uninstall-man +.PHONY: uninstall + diff --git a/extras/dasd_id/Makefile b/extras/dasd_id/Makefile index 23331ce14c..2a14050d66 100644 --- a/extras/dasd_id/Makefile +++ b/extras/dasd_id/Makefile @@ -1,15 +1,15 @@ -# Makefile for dasd_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = dasd_id - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,23 +26,43 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = dasd_id.o $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config + diff --git a/extras/edd_id/Makefile b/extras/edd_id/Makefile index aa3db4f209..70244ea468 100644 --- a/extras/edd_id/Makefile +++ b/extras/edd_id/Makefile @@ -1,15 +1,15 @@ -# Makefile for edd_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = edd_id - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,23 +26,43 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = $(PROG).o $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config + diff --git a/extras/firmware/Makefile b/extras/firmware/Makefile index 5632e0dee5..7de94c40a7 100644 --- a/extras/firmware/Makefile +++ b/extras/firmware/Makefile @@ -1,15 +1,15 @@ -# Makefile for firmware_helper +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2005 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = firmware_helper - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,24 +26,42 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = $(PROG).o $(LIBUDEV) $(LIBSYSFS) -HEADERS = +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config diff --git a/extras/floppy/Makefile b/extras/floppy/Makefile index b7915fc484..8568e28edf 100644 --- a/extras/floppy/Makefile +++ b/extras/floppy/Makefile @@ -1,15 +1,15 @@ -# Makefile for create_floppy_devices +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = create_floppy_devices - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,23 +26,42 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = $(PROG).o $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config diff --git a/extras/run_directory/Makefile b/extras/run_directory/Makefile index 38ef7b128e..8444c3ba63 100644 --- a/extras/run_directory/Makefile +++ b/extras/run_directory/Makefile @@ -1,16 +1,14 @@ -# Makefile for run_directory +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2005 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # - -DEVD = udev_run_devd -HOTPLUGD = udev_run_hotplugd - -all: $(DEVD) $(HOTPLUGD) +PROG = udev_run_devd udev_run_hotplugd +OBJS = run_directory.o +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -19,9 +17,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -29,25 +25,44 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = $(LIBUDEV) +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -$(DEVD): $(HEADERS) $(DEVD).o run_directory.o - $(QUIET) $(LD) $(LDFLAGS) -o $(DEVD) $(DEVD).o run_directory.o $(OBJS) +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(HOTPLUGD): $(HEADERS) $(HOTPLUGD).o run_directory.o - $(QUIET) $(LD) $(LDFLAGS) -o $(HOTPLUGD) $(HOTPLUGD).o run_directory.o $(OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(DEVD) $(HOTPLUGD) run_directory.o - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(DEVD) $(DESTDIR)$(sbindir)/$(DEVD) - $(INSTALL_PROGRAM) $(HOTPLUGD) $(DESTDIR)$(sbindir)/$(HOTPLUGD) + $(INSTALL_PROGRAM) udev_run_devd $(DESTDIR)$(sbindir)/udev_run_devd + $(INSTALL_PROGRAM) udev_run_devd $(DESTDIR)$(sbindir)/udev_run_hotplugd +.PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(DEVD) + - rm $(DESTDIR)$(sbindir)/udev_run_devd + - rm $(DESTDIR)$(sbindir)/udev_run_hotplugd +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config diff --git a/extras/scsi_id/Makefile b/extras/scsi_id/Makefile index 3b75e165fb..bb3422a9c4 100644 --- a/extras/scsi_id/Makefile +++ b/extras/scsi_id/Makefile @@ -1,85 +1,93 @@ +# Makefile for udev extra invoked from the udev main Makefile # # Copyright (C) 2003 IBM +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -SCSI_ID_VERSION=0.9 +SCSI_ID_VERSION = 0.9 + +PROG = scsi_id +OBJS= scsi_serial.o +HEADERS = scsi_id.h scsi.h scsi_id_version.h +GEN_HEADERS = scsi_id_version.h +MAN_PAGES = scsi_id.8 prefix = -etcdir = ${prefix}/etc -sbindir = ${prefix}/sbin +exec_prefix = ${prefix} +etcdir = ${prefix}/etc +sbindir = ${exec_prefix}/sbin +usrbindir = ${exec_prefix}/usr/bin +usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man +configdir = ${etcdir}/udev/ +srcdir = . -INSTALL = /usr/bin/install -c +INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} -# Note some of the variables used here are set when built under udev, and -# otherwise might not be set. +# be able to run without udev +LIBSYSFS = -lsysfs +CROSS = +QUIET = +CC = $(CROSS)gcc +LD = $(CROSS)gcc +AR = $(CROSS)ar +STRIPCMD = $(CROSS)strip +RANLIB = $(CROSS)ranlib +HOSTCC = gcc +CFLAGS += -Wall -pipe -fno-builtin -Wstrict-prototypes -Wsign-compare -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 +LDFLAGS += -Wl -CFLAGS+=-Wall -fno-builtin +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -PROG=scsi_id -LIBSYSFS=-lsysfs +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -# -# Built static and stripped when built with udev. -# -# STRIP=-s -# LDFLAGS=$(STRIP) -LD=$(CC) +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -OBJS= scsi_id.o scsi_serial.o +scsi_id_version.h: + @echo "/* This file is auto-generated by the Makefile */" > $@ + @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@ + @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@ -all: $(PROG) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 -# XXX use a compressed man page? +clean: + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all - $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin + +uninstall-bin: + - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin install-man: $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8 +.PHONY: uninstall-man + +uninstall-man: + -rm -f $(mandir)/man8/scsi_id.8 +.PHONY: uninstall-man install-config: @if [ ! -r $(DESTDIR)$(etcdir)/scsi_id.config ]; then \ echo $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir); \ $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir)/scsi_id.config; \ fi - -uninstall-bin: - -rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-config -uninstall-man: - -rm $(DESTDIR)$(mandir)/man8/scsi_id.8 - -GEN_HEADER=scsi_id_version.h - -scsi_id_version.h: - @echo "/* This file is auto-generated by the Makefile */" > $@ - @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@ - @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@ -$(OBJS): scsi_id.h scsi.h scsi_id_version.h - -clean: - rm -f $(PROG) $(OBJS) $(GEN_HEADER) - -spotless: clean - -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< - -$(PROG): $(OBJS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(LIBSYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS) diff --git a/extras/usb_id/Makefile b/extras/usb_id/Makefile index 10dd09da21..1796aaea09 100644 --- a/extras/usb_id/Makefile +++ b/extras/usb_id/Makefile @@ -1,15 +1,15 @@ -# Makefile for usb_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2005 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # PROG = usb_id - -all: $(PROG) +OBJ = +HEADERS = +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +18,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,24 +26,42 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -OBJS = $(PROG).o $(VOLUME_ID_OBJS) $(LIBUDEV) $(LIBSYSFS) -HEADERS = +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -$(OBJS): $(HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIB_OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config diff --git a/extras/volume_id/Makefile b/extras/volume_id/Makefile index c1dd74f0f7..56cab10e23 100644 --- a/extras/volume_id/Makefile +++ b/extras/volume_id/Makefile @@ -1,15 +1,18 @@ -# Makefile for volume_id +# Makefile for udev extra invoked from the udev main Makefile # -# Copyright (C) 2004, 2005 Kay Sievers +# Copyright (C) 2004-2005 Kay Sievers # -# This program 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; version 2 of the License. +# Released under the GNU General Public License, version 2. # +VOLUME_ID_BASE=volume_id +include $(VOLUME_ID_BASE)/Makefile.inc + PROG = vol_id - -all: $(PROG) +OBJS = $(VOLUME_ID_OBJS) +HEADERS = $(VOLUME_ID_HEADERS) +GEN_HEADERS = +MAN_PAGES = prefix = exec_prefix = ${prefix} @@ -18,9 +21,7 @@ sbindir = ${exec_prefix}/sbin usrbindir = ${exec_prefix}/usr/bin usrsbindir = ${exec_prefix}/usr/sbin mandir = ${prefix}/usr/share/man -devddir = ${etcdir}/dev.d/default configdir = ${etcdir}/udev/ -initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -28,27 +29,42 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -VOLUME_ID_BASE=volume_id -include $(VOLUME_ID_BASE)/Makefile.inc +all: $(PROG) $(MAN_PAGES) +.PHONY: all +.DEFAULT: all -OBJS = vol_id.o $(VOLUME_ID_OBJS) $(LIBUDEV) -HEADERS = $(VOLUME_ID_HEADERS) +%.o: %.c $(GEN_HEADERS) + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -$(OBJS): $(HEADERS) +$(PROG): %: $(HEADERS) %.o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ -.c.o: - $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< - -$(PROG): $(OBJS) $(HEADERS) - $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(OBJS) +# man pages +%.8: %.xml + xmlto man $? +.PRECIOUS: %.8 clean: - rm -f $(PROG) $(OBJS) - -spotless: clean + rm -f $(PROG) $(OBJS) $(GEN_HEADERS) +.PHONY: clean install-bin: all $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: install-bin uninstall-bin: - rm $(DESTDIR)$(sbindir)/$(PROG) +.PHONY: uninstall-bin + +install-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +uninstall-man: + @echo "Please create a man page for this tool." +.PHONY: uninstall-man + +install-config: + @echo "no config file to install" +.PHONY: install-config diff --git a/test/simple-build-check.sh b/test/simple-build-check.sh index 27e5c93d90..8becb0b057 100755 --- a/test/simple-build-check.sh +++ b/test/simple-build-check.sh @@ -1,7 +1,6 @@ #/bin/sh EXTRAS="\ - extras/chassis_id \ extras/scsi_id \ extras/ata_id \ extras/volume_id \