xref: /titanic_52/usr/src/cmd/hal/hald/Makefile (revision b9bd317cda1afb3a01f4812de73e8cec888cbbd7)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28SUBDIRS =	solaris
29
30PROG =		hald
31OBJS =		hald_marshal.o device.o device_info.o device_store.o hald.o \
32		hald_dbus.o hald_runner.o ids.o logger.o property.o util.o \
33		util_helper.o util_pm.o
34OBJS_SOL =	devinfo.o devinfo_ieee1394.o devinfo_misc.o devinfo_pci.o devinfo_storage.o \
35		devinfo_usb.o hotplug.o osspec.o sysevent.o devinfo_acpi.o \
36		devinfo_cpu.o
37OBJS_ALL =	$(OBJS) $(OBJS_SOL:%=solaris/%)
38SRCS =		$(OBJS:%.o=%.c)
39
40include ../../Makefile.cmd
41include ../Makefile.hal
42
43ROOTCMDDIR =	$(ROOTLIB_HAL)
44
45LDLIBS +=	-lc -lm -ldbus-1 -ldbus-glib-1 -lglib-2.0 -lgobject-2.0 \
46		-ldevinfo -lsysevent -lnvpair -lkstat -lcfgadm
47
48all install $(PROG) :=	LDLIBS += -lexpat
49
50CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
51CPPFLAGS +=	-I/usr/sfw/include
52C99MODE =	$(C99_ENABLE)
53
54all :=		TARGET= all
55install :=	TARGET= install
56clean :=	TARGET= clean
57clobber :=	TARGET= clobber
58$(PROG) :=	TARGET= all
59
60.KEEP_STATE:
61
62all: $(SUBDIRS) .WAIT $(PROG)
63
64hald_marshal.o: hald_marshal.h hald_marshal.c
65
66hald_marshal.h: hald_marshal.list
67	glib-genmarshal --prefix=hald_marshal hald_marshal.list --header >> xgen-gmh \
68	&& (cmp -s xgen-gmh hald_marshal.h || cp xgen-gmh hald_marshal.h) \
69	&& rm -f xgen-gmh xgen-gmh~
70
71hald_marshal.c: hald_marshal.list
72	glib-genmarshal --prefix=hald_marshal hald_marshal.list --body >> xgen-gmc \
73	&& (cmp -s xgen-gmc hald_marshal.c || cp xgen-gmc hald_marshal.c) \
74	&& rm -f xgen-gmc xgen-gmc~
75
76$(PROG): $(SUBDIRS) .WAIT $(OBJS_ALL)
77	$(LINK.c) -o $@ $(OBJS_ALL) $(LDLIBS)
78	$(POST_PROCESS)
79
80install: all $(ROOTCMD) $(SUBDIRS)
81
82clean: $(SUBDIRS)
83	$(RM) $(OBJS) hald_marshal.c hald_marshal.h
84
85$(SUBDIRS): FRC
86	@cd $@; pwd; $(MAKE) $(TARGET)
87
88FRC:
89
90include ../../Makefile.targ
91