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