linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: [patch] allow builds of extras programs under udev
Date: Fri, 05 Dec 2003 23:33:55 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107066731228982@msgid-missing> (raw)

This patch against udev (bitkeeper version as of sometime Dec 4) enables
the building of the "extras" programs using the same build environment as
udev (i.e. build with udev's versions of klibc and sysfsutils).

It does not pass down clean, install, or uninstall targets to the extras
programs.

The current scsi_id under udev won't build with this patch, use the
scsi_id 0.2 I just posted.

Build scsi_id and udev via:

	make EXTRAS=extras/scsi_id

Build scsi_id and udev with klibc via:

	make KLIBC=true EXTRAS=extras/scsi_id

=== Makefile 1.47 vs edited ==--- 1.47/Makefile	Thu Dec  4 11:21:04 2003
+++ edited/Makefile	Fri Dec  5 15:30:28 2003
@@ -42,6 +42,9 @@
 INSTALL_DATA  = ${INSTALL} -m 644
 INSTALL_SCRIPT = ${INSTALL_PROGRAM}
 
+# To build any of the extras programs, run with:
+# 	make EXTRAS="extras/a extras/b" 
+EXTRAS 
 # place to put our device nodes
 udevdir = ${prefix}/udev/
@@ -62,6 +65,8 @@
 
 export CROSS CC AR STRIP RANLIB
 
+export CFLAGS LDFLAGS SYSFS LIB_OBJS ARCH_LIB_OBJS CRT0
+
 # 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'}
@@ -108,20 +113,20 @@
 # If we are using our version of klibc, then we need to build and link it.
 # Otherwise, use glibc and link statically.
 ifeq ($(strip $(KLIBC)),true)
-	KLIBC_DIR	= klibc/klibc
+	KLIBC_BASE	= $(PWD)/klibc
+	KLIBC_DIR	= $(KLIBC_BASE)/klibc
 	INCLUDE_DIR	:= $(KLIBC_DIR)/include
+	LINUX_INCLUDE_DIR	:= $(KLIBC_BASE)/linux/include
 	include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG
 	# arch specific objects
-	LIBGCC		= $(shell $(CC) --print-libgcc)
 	ARCH_LIB_OBJS =	\
-			$(KLIBC_DIR)/libc.a	\
-			$(LIBGCC)
+			$(KLIBC_DIR)/libc.a
 
 
 	CRT0 = $(KLIBC_DIR)/crt0.o
 	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
 	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \
-		-I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -Iklibc/linux/include \
+		-I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -I$(LINUX_INCLUDE_DIR) \
 		-D__KLIBC__
 	LIB_OBJS  	LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs
@@ -133,7 +138,15 @@
 	LDFLAGS = --static 
 endif
 
-all: $(ROOT)
+CFLAGS += -I$(PWD)/libsysfs
+
+
+all: $(ROOT) $(EXTRAS)
+
+FORCE:
+
+$(EXTRAS): $(ROOT) FORCE
+	$(MAKE) LD=$(LD) SYSFS="$(SYSFS)" -C $@
 
 $(ROOT): $(LIBC)
 
@@ -145,13 +158,13 @@
 TDB =	tdb/tdb.o	\
 	tdb/spinlock.o
 
-SYSFS =	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
+SYSFS =	$(PWD)/libsysfs/sysfs_bus.o	\
+	$(PWD)/libsysfs/sysfs_class.o	\
+	$(PWD)/libsysfs/sysfs_device.o	\
+	$(PWD)/libsysfs/sysfs_dir.o	\
+	$(PWD)/libsysfs/sysfs_driver.o	\
+	$(PWD)/libsysfs/sysfs_utils.o	\
+	$(PWD)/libsysfs/dlist.o
 
 OBJS =	udev.o		\
 	udev_config.o	\


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

                 reply	other threads:[~2003-12-05 23:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-107066731228982@msgid-missing \
    --to=patmans@us.ibm.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).