1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

Makefile: remove dynamic config file generation

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
Kay Sievers 2006-01-23 03:24:16 +01:00
parent aaa14841de
commit d8a57e7c26
4 changed files with 13 additions and 26 deletions

View File

@ -43,7 +43,7 @@ USE_STATIC = false
# make EXTRAS="extras/<extra1> extras/<extra2>"
EXTRAS =
# make the build silent. Set this to something else to make it noisy again.
# make the build silent.
V = false
PROGRAMS = \
@ -89,10 +89,6 @@ MAN_PAGES = \
udevinfo.8 \
udevstart.8
# config files automatically generated
GEN_CONFIGS = \
$(LOCAL_CFG_DIR)/udev.conf
GEN_HEADERS = \
udev_version.h
@ -105,12 +101,11 @@ libudevdir = ${prefix}/lib/udev
mandir = ${prefix}/usr/share/man
configdir = ${etcdir}/udev
udevdir = /dev
LOCAL_CFG_DIR = etc/udev
DESTDIR =
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
PWD = $(shell pwd)
@ -149,7 +144,6 @@ ifeq ($(strip $(USE_GCOV)),true)
LDFLAGS += -fprofile-arcs
endif
# if our own version of klibc is used, we need to build it
ifeq ($(strip $(USE_KLIBC)),true)
KLCC = /usr/bin/$(CROSS)klcc
CC = $(KLCC)
@ -211,14 +205,9 @@ $(LIBUDEV): $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(UDEV_OBJS)
$(QUIET) $(AR) cq $@ $(UDEV_OBJS)
$(QUIET) $(RANLIB) $@
# generate config files
$(GEN_CONFIGS):
sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $@.in > $@
# generate config header file
udev_version.h:
@echo "Creating udev_version.h"
@echo \#define UDEV_VERSION \"$(VERSION)\" > $@
@echo "/* Generated by make. */" > $@
@echo \#define UDEV_VERSION \"$(VERSION)\" >> $@
@echo \#define UDEV_ROOT \"$(udevdir)\" >> $@
@echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@
@ -239,8 +228,9 @@ clean:
- find -name "*.gcda" -print0 | xargs -0rt rm -f
- find -name "*.gcov" -print0 | xargs -0rt rm -f
- rm -f udev_gcov.txt
- rm -f core $(PROGRAMS) $(GEN_HEADERS) $(GEN_CONFIGS)
- rm -f core $(PROGRAMS) $(GEN_HEADERS)
- rm -f udev-$(VERSION).tar.gz
- rm -f udev-$(VERSION).tar.bz2
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
$(MAKE) -C $$target $@ || exit 1; \
@ -249,14 +239,13 @@ clean:
release:
git-tar-tree HEAD udev-$(VERSION) | gzip -9v > udev-$(VERSION).tar.gz
@echo "udev-$(VERSION).tar.gz created"
git-tar-tree HEAD udev-$(VERSION) | bzip2 -9v > udev-$(VERSION).tar.bz2
.PHONY: release
install-config: $(GEN_CONFIGS)
install-config:
$(INSTALL) -d $(DESTDIR)$(configdir)/rules.d
@if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \
echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \
$(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \
$(INSTALL_DATA) etc/udev/udev.conf $(DESTDIR)$(configdir); \
fi
@if [ ! -r $(DESTDIR)$(configdir)/rules.d/50-udev.rules ]; then \
echo; \
@ -327,8 +316,8 @@ uninstall-bin:
- rm -f $(DESTDIR)$(sbindir)/udevcontrol
- rm -f $(DESTDIR)$(sbindir)/udevstart
- rm -f $(DESTDIR)$(usrsbindir)/udevmonitor
- rm -f $(usrbindir)/udevinfo
- rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest
- rm -f $(DESTDIR)$(usrbindir)/udevinfo
- rm -f $(DESTDIR)$(usrbindir)/udevtest
ifndef DESTDIR
- killall udevd
- rm -rf /dev/.udev
@ -387,4 +376,3 @@ udev_gcov.txt: $(wildcard *.gcda) $(wildcard *.gcno)
echo >> $@; \
done; \
echo "view $@ for the result"

View File

@ -275,7 +275,7 @@ struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *dev)
if (strncmp(parent_devpath, "/class", 6) == 0) {
pos = strrchr(parent_devpath, '/');
if (pos == &parent_devpath[6] || pos == parent_devpath) {
dbg("class top level, look for device link");
dbg("/class top level, look for device link");
goto device_link;
}
}

View File

@ -30,7 +30,6 @@
#include <sys/un.h>
#include <sys/wait.h>
#include <sys/select.h>
#include <unistd.h>
#include "udev.h"
@ -51,7 +50,7 @@ int pass_env_to_socket(const char *sockname, const char *devpath, const char *ac
sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
memset(&saddr, 0x00, sizeof(struct sockaddr_un));
saddr.sun_family = AF_LOCAL;
/* only abstract namespace is supported */
/* abstract namespace only */
strcpy(&saddr.sun_path[1], sockname);
addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1;