Makefile revision 2912:85ea316d9c18
1226584Sdim#
2226584Sdim# CDDL HEADER START
3226584Sdim#
4226584Sdim# The contents of this file are subject to the terms of the
5226584Sdim# Common Development and Distribution License (the "License").
6226584Sdim# You may not use this file except in compliance with the License.
7226584Sdim#
8226584Sdim# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9226584Sdim# or http://www.opensolaris.org/os/licensing.
10226584Sdim# See the License for the specific language governing permissions
11226584Sdim# and limitations under the License.
12226584Sdim#
13226584Sdim# When distributing Covered Code, include this CDDL HEADER in each
14226584Sdim# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15226584Sdim# If applicable, add the following below this CDDL HEADER, with the
16226584Sdim# fields enclosed by brackets "[]" replaced with your own identifying
17226584Sdim# information: Portions Copyright [yyyy] [name of copyright owner]
18226584Sdim#
19226584Sdim# CDDL HEADER END
20226584Sdim#
21226584Sdim#
22243830Sdim# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23234982Sdim# Use is subject to license terms.
24234982Sdim#
25234982Sdim# ident	"%Z%%M%	%I%	%E% SMI"
26243830Sdim#
27226584Sdim
28226584SdimSUBDIRS =	solaris
29226584Sdim
30243830SdimPROG =		hald
31243830SdimOBJS =		hald_marshal.o device.o device_info.o device_store.o hald.o \
32243830Sdim		hald_dbus.o hald_runner.o ids.o logger.o property.o util.o \
33226584Sdim		util_helper.o util_pm.o
34226584SdimOBJS_SOL =	devinfo.o devinfo_ieee1394.o devinfo_misc.o devinfo_pci.o devinfo_storage.o \
35249423Sdim		devinfo_usb.o hotplug.o osspec.o sysevent.o
36226584SdimOBJS_ALL =	$(OBJS) $(OBJS_SOL:%=solaris/%)
37226584SdimSRCS =		$(OBJS:%.o=%.c)
38226584Sdim
39226584Sdiminclude ../../Makefile.cmd
40226584Sdiminclude ../Makefile.hal
41
42ROOTCMDDIR =	$(ROOTLIB_HAL)
43
44LDLIBS +=	-lc -lm -ldbus-1 -ldbus-glib-1 -lglib-2.0 -lgobject-2.0 \
45		-ldevinfo -lsysevent -lnvpair
46
47LDFLAGS +=	-L$(SFW_ROOT)/lib -R$(SFW_ROOT)/lib
48
49all install $(PROG) :=	LDLIBS += -lexpat
50
51CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
52CPPFLAGS +=	-I/usr/sfw/include
53C99MODE =	$(C99_ENABLE)
54
55all :=		TARGET= all
56install :=	TARGET= install
57clean :=	TARGET= clean
58clobber :=	TARGET= clobber
59$(PROG) :=	TARGET= all
60
61.KEEP_STATE:
62
63all: $(SUBDIRS) .WAIT $(PROG)
64
65hald_marshal.o: hald_marshal.h hald_marshal.c
66
67hald_marshal.h: hald_marshal.list
68	glib-genmarshal --prefix=hald_marshal hald_marshal.list --header >> xgen-gmh \
69	&& (cmp -s xgen-gmh hald_marshal.h || cp xgen-gmh hald_marshal.h) \
70	&& rm -f xgen-gmh xgen-gmh~
71
72hald_marshal.c: hald_marshal.list
73	glib-genmarshal --prefix=hald_marshal hald_marshal.list --body >> xgen-gmc \
74	&& (cmp -s xgen-gmc hald_marshal.c || cp xgen-gmc hald_marshal.c) \
75	&& rm -f xgen-gmc xgen-gmc~
76
77$(PROG): $(SUBDIRS) .WAIT $(OBJS_ALL)
78	$(LINK.c) -o $@ $(OBJS_ALL) $(LDLIBS)
79	$(POST_PROCESS)
80
81install: all $(ROOTCMD) $(SUBDIRS)
82
83clean: $(SUBDIRS)
84	$(RM) $(OBJS) hald_marshal.c hald_marshal.h
85
86$(SUBDIRS): FRC
87	@cd $@; pwd; $(MAKE) $(TARGET)
88
89FRC:
90
91include ../../Makefile.targ
92