From 869fc2f1ff73209b9aa5dc7d582eba39feaf6f86 Mon Sep 17 00:00:00 2001 From: "greg@kroah.com" Date: Mon, 26 Jan 2004 18:55:37 -0800 Subject: [PATCH] [PATCH] move udevinfo into the main build and clean up the main Makefile a bit. --- Makefile | 34 +++++++++++++++++------- extras/udevinfo/Makefile | 28 ------------------- extras/udevinfo/udevinfo.c => udevinfo.c | 12 ++++----- 3 files changed, 30 insertions(+), 44 deletions(-) delete mode 100644 extras/udevinfo/Makefile rename extras/udevinfo/udevinfo.c => udevinfo.c (97%) diff --git a/Makefile b/Makefile index 5c265492..20c739e4 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ USE_DBUS = false ROOT = udev DAEMON = udevd SENDER = udevsend +HELPERS = udevinfo VERSION = 014_bk INSTALL_DIR = /usr/local/bin RELEASE_NAME = $(ROOT)-$(VERSION) @@ -164,7 +165,7 @@ endif CFLAGS += -I$(PWD)/libsysfs -all: $(ROOT) $(UDEVD) +all: $(ROOT) $(UDEVD) $(HELPERS) @extras="$(EXTRAS)" ; for target in $$extras ; do \ echo $$target ; \ $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ @@ -189,8 +190,7 @@ SYSFS = $(PWD)/libsysfs/sysfs_bus.o \ $(PWD)/libsysfs/sysfs_utils.o \ $(PWD)/libsysfs/dlist.o -OBJS = udev.o \ - udev_config.o \ +OBJS = udev_config.o \ udev-add.o \ udev-remove.o \ udevdb.o \ @@ -200,6 +200,16 @@ OBJS = udev.o \ $(SYSFS) \ $(TDB) +HEADERS = $(GEN_HEADERS) \ + udev.h \ + namedev.h \ + udev_version.h \ + udev_dbus.h \ + udevdb.h \ + klibc_fixups.h \ + logging.h \ + list.h + ifeq ($(strip $(USE_KLIBC)),true) OBJS += klibc_fixups.o endif @@ -234,17 +244,21 @@ $(LOCAL_CFG_DIR)/udev.conf: $(OBJS): $(GEN_HEADERS) -$(ROOT): $(OBJS) udev.h namedev.h udev_version.h udev_dbus.h udevdb.h klibc_fixups.h logging.h list.h - $(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) - $(STRIPCMD) $(ROOT) +$(ROOT): udev.o $(OBJS) $(HEADERS) + $(LD) $(LDFLAGS) -o $@ $(CRT0) udev.o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(STRIPCMD) $@ + +$(HELPERS): udevinfo.o $(OBJS) $(HEADERS) + $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(STRIPCMD) $@ $(DAEMON): udevd.h udevd.o udevd.o logging.o - $(LD) $(LDFLAGS) -o $(DAEMON) $(CRT0) udevd.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS) - $(STRIPCMD) $(ROOT) + $(LD) $(LDFLAGS) -o $@ $(CRT0) udevd.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(STRIPCMD) $@ $(SENDER): udevd.h udevsend.o udevd.o logging.o - $(LD) $(LDFLAGS) -o $(SENDER) $(CRT0) udevsend.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS) - $(STRIPCMD) $(ROOT) + $(LD) $(LDFLAGS) -o $@ $(CRT0) udevsend.o logging.o $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(STRIPCMD) $@ clean: -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ diff --git a/extras/udevinfo/Makefile b/extras/udevinfo/Makefile deleted file mode 100644 index b740b253..00000000 --- a/extras/udevinfo/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -PROG=udevinfo -OBJS= ../../udev_config.o \ - ../../udev-add.o \ - ../../udev-remove.o \ - ../../udevdb.o \ - ../../logging.o \ - ../../namedev.o \ - ../../namedev_parse.o \ - ../../libsysfs/sysfs_bus.o \ - ../../libsysfs/sysfs_class.o \ - ../../libsysfs/sysfs_device.o \ - ../../libsysfs/sysfs_dir.o \ - ../../libsysfs/sysfs_driver.o \ - ../../libsysfs/sysfs_utils.o \ - ../../libsysfs/dlist.o \ - ../../tdb/tdb.o \ - ../../tdb/spinlock.o \ - -all: $(PROG) - -$(PROG): $(PROG).o - $(LD) $(LDFLAGS) -o $(PROG) $(PROG).o $(OBJS) -lc - -clean: - rm -f $(PROG) $(OBJS) $(PROG).o - -me: - cd ../..; make EXTRAS=extras/udevinfo diff --git a/extras/udevinfo/udevinfo.c b/udevinfo.c similarity index 97% rename from extras/udevinfo/udevinfo.c rename to udevinfo.c index 3f03901f..a2f5601b 100644 --- a/extras/udevinfo/udevinfo.c +++ b/udevinfo.c @@ -27,11 +27,11 @@ #include #include -#include "../../udev.h" -#include "../../udev_version.h" -#include "../../logging.h" -#include "../../udevdb.h" -#include "../../libsysfs/libsysfs.h" +#include "udev.h" +#include "udev_version.h" +#include "logging.h" +#include "udevdb.h" +#include "libsysfs/libsysfs.h" # define SYSFS_VALUE_MAX 200 @@ -268,7 +268,7 @@ static int process_options(void) exit(0); case 'V': - printf("udev, version %s\n", UDEV_VERSION); + printf("udevinfo, version %s\n", UDEV_VERSION); exit(0); case 'h': -- 2.39.5