chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace libsysfs
[elogind.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index de305cb9bffb202853d6d9aae9471796e40f8378..461f5ac012e981e3b0015f1cfee44a593c192bab 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-17,7
+17,7
@@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-VERSION = 07
5
+VERSION = 07
9
# set this to make use of syslog
USE_LOG = true
# set this to make use of syslog
USE_LOG = true
@@
-58,21
+58,19
@@
PROGRAMS = \
HEADERS = \
udev.h \
HEADERS = \
udev.h \
- udev_utils.h \
udev_rules.h \
udev_rules.h \
- udev_db.h \
logging.h \
udev_libc_wrapper.h \
udev_selinux.h \
list.h
UDEV_OBJS = \
logging.h \
udev_libc_wrapper.h \
udev_selinux.h \
list.h
UDEV_OBJS = \
- udev_event.o \
udev_device.o \
udev_config.o \
udev_add.o \
udev_remove.o \
udev_db.o \
udev_device.o \
udev_config.o \
udev_add.o \
udev_remove.o \
udev_db.o \
+ udev_sysfs.o \
udev_rules.o \
udev_rules_parse.o \
udev_utils.o \
udev_rules.o \
udev_rules_parse.o \
udev_utils.o \
@@
-91,15
+89,6
@@
MAN_PAGES = \
udevinfo.8 \
udevstart.8
udevinfo.8 \
udevstart.8
-SYSFS_OBJS = \
- libsysfs/sysfs_class.o \
- libsysfs/sysfs_device.o \
- libsysfs/sysfs_dir.o \
- libsysfs/sysfs_driver.o \
- libsysfs/sysfs_utils.o \
- libsysfs/dlist.o
-LIBSYSFS = libsysfs/libsysfs.a
-
# config files automatically generated
GEN_CONFIGS = \
$(LOCAL_CFG_DIR)/udev.conf
# config files automatically generated
GEN_CONFIGS = \
$(LOCAL_CFG_DIR)/udev.conf
@@
-107,17
+96,15
@@
GEN_CONFIGS = \
GEN_HEADERS = \
udev_version.h
GEN_HEADERS = \
udev_version.h
-# override this to make udev look in a different location for it's config files
prefix =
prefix =
-exec_prefix = ${prefix}
etcdir = ${prefix}/etc
etcdir = ${prefix}/etc
-sbindir = ${exec_prefix}/sbin
-usrbindir = ${exec_prefix}/usr/bin
-usrsbindir = ${exec_prefix}/usr/sbin
+sbindir = ${prefix}/sbin
+usrbindir = ${prefix}/usr/bin
+usrsbindir = ${prefix}/usr/sbin
+libudevdir = ${prefix}/lib/udev
mandir = ${prefix}/usr/share/man
configdir = ${etcdir}/udev
udevdir = /dev
mandir = ${prefix}/usr/share/man
configdir = ${etcdir}/udev
udevdir = /dev
-udevdb = ${udevdir}/.udevdb
LOCAL_CFG_DIR = etc/udev
DESTDIR =
LOCAL_CFG_DIR = etc/udev
DESTDIR =
@@
-136,26
+123,17
@@
HOSTCC = gcc
STRIP = $(CROSS)strip
STRIPCMD = $(STRIP) -s
STRIP = $(CROSS)strip
STRIPCMD = $(STRIP) -s
-# check if compiler option is supported
-cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;}
-
CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
-Wchar-subscripts -Wmissing-declarations -Wnested-externs \
-Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
-Wchar-subscripts -Wmissing-declarations -Wnested-externs \
-Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
-WARNINGS += $(call cc-supports, -Wdeclaration-after-statement, )
CFLAGS += $(WARNINGS)
LDFLAGS = -Wl,-warn-common
CFLAGS += $(WARNINGS)
LDFLAGS = -Wl,-warn-common
-# use -Os optimization if available, else use -O2
-OPTFLAGS := $(call cc-supports, -Os, -O2)
+OPTFLAGS = -Os
CFLAGS += $(OPTFLAGS)
CFLAGS += $(OPTFLAGS)
-# include our local copy of libsysfs
-CFLAGS += -I$(PWD)/libsysfs/sysfs \
- -I$(PWD)/libsysfs
-
ifeq ($(strip $(USE_LOG)),true)
CFLAGS += -DUSE_LOG
endif
ifeq ($(strip $(USE_LOG)),true)
CFLAGS += -DUSE_LOG
endif
@@
-208,9
+186,8
@@
all: $(PROGRAMS) $(MAN_PAGES)
STRIPCMD="$(STRIPCMD)" \
LIB_OBJS="$(LIB_OBJS)" \
LIBUDEV="$(PWD)/$(LIBUDEV)" \
STRIPCMD="$(STRIPCMD)" \
LIB_OBJS="$(LIB_OBJS)" \
LIBUDEV="$(PWD)/$(LIBUDEV)" \
- LIBSYSFS="$(PWD)/$(LIBSYSFS)" \
QUIET="$(QUIET)" \
QUIET="$(QUIET)" \
- -C $$target $@; \
+ -C $$target $@
|| exit 1
; \
done;
.PHONY: all
.DEFAULT: all
done;
.PHONY: all
.DEFAULT: all
@@
-219,28
+196,21
@@
all: $(PROGRAMS) $(MAN_PAGES)
.SUFFIXES:
# build the objects
.SUFFIXES:
# build the objects
-%.o: %.c $(GEN_HEADERS)
+%.o: %.c $(
HOST_PROGS) $(HEADERS) $(
GEN_HEADERS)
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@
# "Static Pattern Rule" to build all programs
$(QUIET) $(CC) -c $(CFLAGS) $< -o $@
# "Static Pattern Rule" to build all programs
-$(PROGRAMS): %: $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(LIB
SYSFS) $(LIB
UDEV) %.o
- $(QUIET) $(LD) $(LDFLAGS) $@.o -o $@ $(LIBUDEV) $(LIB
SYSFS) $(LIB
_OBJS)
+$(PROGRAMS): %: $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(LIBUDEV) %.o
+ $(QUIET) $(LD) $(LDFLAGS) $@.o -o $@ $(LIBUDEV) $(LIB_OBJS)
ifneq ($(STRIPCMD),)
$(QUIET) $(STRIPCMD) $@
endif
ifneq ($(STRIPCMD),)
$(QUIET) $(STRIPCMD) $@
endif
-$(UDEV_OBJS):
$(LIBUDEV): $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(UDEV_OBJS)
@rm -f $@
$(QUIET) $(AR) cq $@ $(UDEV_OBJS)
$(QUIET) $(RANLIB) $@
$(LIBUDEV): $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(UDEV_OBJS)
@rm -f $@
$(QUIET) $(AR) cq $@ $(UDEV_OBJS)
$(QUIET) $(RANLIB) $@
-$(SYSFS_OBJS):
-$(LIBSYSFS): $(HOST_PROGS) $(SYSFS_OBJS)
- @rm -f $@
- $(QUIET) $(AR) cq $@ $(SYSFS_OBJS)
- $(QUIET) $(RANLIB) $@
-
# generate config files
$(GEN_CONFIGS):
sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $@.in > $@
# generate config files
$(GEN_CONFIGS):
sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $@.in > $@
@@
-250,11
+220,8
@@
udev_version.h:
@echo "Creating udev_version.h"
@echo \#define UDEV_VERSION \"$(VERSION)\" > $@
@echo \#define UDEV_ROOT \"$(udevdir)\" >> $@
@echo "Creating udev_version.h"
@echo \#define UDEV_VERSION \"$(VERSION)\" > $@
@echo \#define UDEV_ROOT \"$(udevdir)\" >> $@
- @echo \#define UDEV_DB \"$(udevdb)\" >> $@
- @echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@
@echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@
@echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@
- @echo \#define UDEVD_BIN \"$(sbindir)/udevd\" >> $@
# man pages
%.8: docs/%.xml
# man pages
%.8: docs/%.xml
@@
-266,6
+233,7
@@
ccdv: ccdv.c
.SILENT: ccdv
clean:
.SILENT: ccdv
clean:
+ - rm -f $(HOST_PROGS)
- find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print0 | xargs -0rt rm -f
- find -name "*.gcno" -print0 | xargs -0rt rm -f
- find -name "*.gcda" -print0 | xargs -0rt rm -f
- find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print0 | xargs -0rt rm -f
- find -name "*.gcno" -print0 | xargs -0rt rm -f
- find -name "*.gcda" -print0 | xargs -0rt rm -f
@@
-275,7
+243,7
@@
clean:
- rm -f udev-$(VERSION).tar.gz
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- rm -f udev-$(VERSION).tar.gz
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
.PHONY: clean
done;
.PHONY: clean
@@
-297,7
+265,7
@@
install-config: $(GEN_CONFIGS)
fi
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
fi
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
.PHONY: install-config
done;
.PHONY: install-config
@@
-312,7
+280,7
@@
install-man:
- ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevcontrol.8
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevcontrol.8
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
.PHONY: install-man
done;
.PHONY: install-man
@@
-327,7
+295,7
@@
uninstall-man:
- rm -f $(DESTDIR)$(mandir)/man8/udevcontrol.8
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- rm -f $(DESTDIR)$(mandir)/man8/udevcontrol.8
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
.PHONY: uninstall-man
done;
.PHONY: uninstall-man
@@
-343,11
+311,11
@@
install-bin:
$(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
$(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
ifndef DESTDIR
- killall udevd
done;
ifndef DESTDIR
- killall udevd
- - rm -rf
$(udevdb)
+ - rm -rf
/dev/.udev
- $(sbindir)/udevd --daemon
endif
.PHONY: install-bin
- $(sbindir)/udevd --daemon
endif
.PHONY: install-bin
@@
-363,11
+331,11
@@
uninstall-bin:
- rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest
ifndef DESTDIR
- killall udevd
- rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest
ifndef DESTDIR
- killall udevd
- - rm -rf
$(udevdb)
+ - rm -rf
/dev/.udev
endif
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
endif
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
- $(MAKE) -C $$target $@; \
+ $(MAKE) -C $$target $@
|| exit 1
; \
done;
.PHONY: uninstall-bin
done;
.PHONY: uninstall-bin
@@
-383,9
+351,20
@@
test tests: all
.PHONY: test tests
buildtest:
.PHONY: test tests
buildtest:
-
./
test/simple-build-check.sh
+ test/simple-build-check.sh
.PHONY: buildtest
.PHONY: buildtest
+ChangeLog: Makefile
+ @ mv $@ $@.tmp
+ @ echo "Summary of changes from v$(shell printf '%03i' $$(expr $(VERSION) - 1)) to v$(VERSION)" >> $@
+ @ echo "============================================" >> $@
+ @ echo >> $@
+ @ git log --pretty=short $(shell printf '%03i' $$(expr $(VERSION) - 1))..HEAD | git shortlog >> $@
+ @ echo >> $@
+ @ cat $@
+ @ cat $@.tmp >> $@
+ @ rm $@.tmp
+
gcov-all:
$(MAKE) clean all STRIPCMD= USE_GCOV=true
@echo
gcov-all:
$(MAKE) clean all STRIPCMD= USE_GCOV=true
@echo