blob: 3d4ded713e00436c125ea2c1653b3bc30a978631 [file] [log] [blame]
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +00001#############################################################
2#
3# hal
4#
5#############################################################
Ulf Samuelssone1621a42007-07-11 14:06:06 +00006HAL_VERSION:=0.5.8
7HAL_SOURCE:=hal-$(HAL_VERSION).tar.gz
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +00008HAL_SITE:=http://people.freedesktop.org/~david/dist/
Ulf Samuelssone1621a42007-07-11 14:06:06 +00009HAL_DIR:=$(BUILD_DIR)/hal-$(HAL_VERSION)
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000010HAL_CAT:=$(ZCAT)
11HAL_BINARY:=hald/hald
12HAL_TARGET_BINARY:=usr/sbin/hald
13
Ulf Samuelssona2e51132007-08-11 22:26:56 +000014GLIB_CFLAGS:=-I$(STAGING_DIR)/usr/include/glib-2.0 \
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000015 -I$(STAGING_DIR)/lib/glib/include
16GLIB_LIBS:=$(STAGING_DIR)/lib/libglib-2.0.so \
17 $(STAGING_DIR)/lib/libgmodule-2.0.so \
18 $(STAGING_DIR)/lib/libgobject-2.0.so \
19 $(STAGING_DIR)/lib/libgthread-2.0.so
20DBUS_GLIB_LIBS:=$(STAGING_DIR)/usr/lib/libdbus-glib-1.so
21
22$(DL_DIR)/$(HAL_SOURCE):
23 $(WGET) -P $(DL_DIR) $(HAL_SITE)/$(HAL_SOURCE)
24
25hal-source: $(DL_DIR)/$(HAL_SOURCE)
26
27$(HAL_DIR)/.unpacked: $(DL_DIR)/$(HAL_SOURCE)
28 $(HAL_CAT) $(DL_DIR)/$(HAL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
29 toolchain/patch-kernel.sh $(HAL_DIR) package/hal/ \*.patch
30 touch $(HAL_DIR)/.unpacked
31
32$(HAL_DIR)/.configured: $(HAL_DIR)/.unpacked /usr/bin/pkg-config
33 (cd $(HAL_DIR); rm -rf config.cache; \
34 $(TARGET_CONFIGURE_OPTS) \
Bernhard Reutner-Fischer74d518d2007-06-27 12:01:27 +000035 $(TARGET_CONFIGURE_ARGS) \
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000036 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/lib/glib-2.0/include" \
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000037 GLIB_CFLAGS="$(GLIB_CFLAGS)" \
38 GLIB_LIBS="$(GLIB_LIBS)" \
39 DBUS_CFLAGS="-I$(STAGING_DIR)/usr/include/dbus-1.0 -I$(STAGING_DIR)/usr/lib/dbus-1.0/include" \
40 DBUS_LIBS="$(STAGING_DIR)/usr/lib/libdbus-1.so" \
41 VOLUME_ID_CFLAGS="$(TARGET_CFLAGS)" \
42 VOLUME_ID_LIBS="$(STAGING_DIR)/usr/lib/libvolume_id.so" \
43 PKG_CONFIG=/usr/bin/pkg-config \
44 ac_cv_path_LIBUSB_CONFIG= \
45 ./configure \
46 --target=$(GNU_TARGET_NAME) \
47 --host=$(GNU_TARGET_NAME) \
48 --build=$(GNU_HOST_NAME) \
49 --prefix=/usr \
50 --datadir=/usr/share \
51 --sysconfdir=/etc \
52 --localstatedir=/var \
53 --with-hwdata=$(TARGET_DIR)/usr/share/hwdata \
54 --disable-policy-kit \
55 --disable-gtk-doc \
56 --disable-static \
57 --disable-acpi-acpid \
58 --disable-acpi-proc \
59 );
60 touch $(HAL_DIR)/.configured
61
62$(HAL_DIR)/hald/hald: $(HAL_DIR)/.configured
63 $(MAKE) STAGING_DIR="$(STAGING_DIR)" DESTDIR="$(TARGET_DIR)" DBUS_GLIB_LIBS="$(DBUS_GLIB_LIBS)" -C $(HAL_DIR)
64
65$(TARGET_DIR)/$(HAL_TARGET_BINARY): $(HAL_DIR)/hald/hald
66 $(MAKE) STAGING_DIR="$(STAGING_DIR)" DESTDIR="$(TARGET_DIR)" -C $(HAL_DIR) install
67 rm -rf $(TARGET_DIR)/usr/share/locale
68 rm -rf $(TARGET_DIR)/usr/share/doc
69 rm -rf $(TARGET_DIR)/usr/share/gtk-doc
70 rm -rf $(TARGET_DIR)/usr/share/hal/device-manager
71 rm -rf $(TARGET_DIR)/usr/lib/pkgconfig
Ulf Samuelssona2e51132007-08-11 22:26:56 +000072 # remove _everything_ in $(TARGET_DIR)/usr/include?
Ulf Samuelsson488f5d72007-08-12 23:33:44 +000073 # rm -rf $(TARGET_DIR)/usr/include
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000074 rm -rf $(TARGET_DIR)/usr/lib/libhal*.so
75 rm -rf $(TARGET_DIR)/usr/lib/libhal*.la
76 rm -rf $(TARGET_DIR)/usr/lib/hal
77 rm -rf $(TARGET_DIR)/etc/PolicyKit
"Steven J. Hill"6b00c902007-05-09 22:48:41 +000078 $(INSTALL) -m 0755 -D package/hal/S98haldaemon $(TARGET_DIR)/etc/init.d
"Steven J. Hill"af9a0cc2007-01-14 23:21:36 +000079 rm -rf $(TARGET_DIR)/etc/rc.d
80 for file in hald-addon-acpi* hald-addon-cpufreq \
81 hald-addon-keyboard hald-addon-pmu \
82 hald-probe-pc-floppy hald-probe-printer \
83 hald-probe-serial hald-probe-smbios \
84 hal-storage-eject hal-storage-closetray \
85 hal-system-power-pmu hald-probe-input \
86 hald-probe-hiddev hald-addon-hid-ups; do \
87 rm -f $(TARGET_DIR)/usr/libexec/$$file; \
88 done
89 -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libhal*
90
91hal: uclibc dbus-glib hwdata udev-volume_id $(TARGET_DIR)/$(HAL_TARGET_BINARY)
92
93hal-clean:
94 rm -f $(TARGET_DIR)/etc/dbus-1/system.d/hal.conf
95 rm -rf $(TARGET_DIR)/etc/hal $(TARGET_DIR)/usr/share/hal
96 rm -f $(TARGET_DIR)/etc/init.d/S98haldaemon
97 rm -f $(TARGET_DIR)/etc/udev/rules.d/90-hal.rules
98 rm -f $(TARGET_DIR)/usr/bin/hal-* $(TARGET_DIR)/usr/bin/lshal
99 rm -f $(TARGET_DIR)/usr/sbin/hald
100 rm -f $(TARGET_DIR)/usr/libexec/hald-* $(TARGET_DIR)/usr/libexec/hal-*
101 rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/libexec
102 rm -f $(TARGET_DIR)/usr/lib/libhal.so.1*
103 rm -f $(TARGET_DIR)/usr/lib/libhal-storage.so.1*
104 -$(MAKE) -C $(HAL_DIR) clean
105
106hal-dirclean:
107 rm -rf $(HAL_DIR)
108
109#############################################################
110#
111# Toplevel Makefile options
112#
113#############################################################
114ifeq ($(strip $(BR2_PACKAGE_HAL)),y)
115TARGETS+=hal
116endif