xref: /illumos-gate/usr/src/cmd/hal/tools/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*18c2aff7SartemHAL_PROG =	hal-device hal-find-by-capability hal-find-by-property \
29*18c2aff7Sartem		hal-get-property hal-set-property lshal
30*18c2aff7Sartem
31*18c2aff7SartemSCRIPT =	hal-fdi-validate
32*18c2aff7Sartem
33*18c2aff7SartemSTORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
34*18c2aff7Sartem		hal-storage-mount hal-storage-unmount \
35*18c2aff7Sartem		hal-storage-zpool-export hal-storage-zpool-import
36*18c2aff7Sartem
37*18c2aff7SartemSTORAGE_PROG =	$(STORAGE_METHOD_PROG) \
38*18c2aff7Sartem		hal-storage-cleanup-mountpoint \
39*18c2aff7Sartem		hal-storage-cleanup-all-mountpoints
40*18c2aff7Sartem
41*18c2aff7SartemPROGSRCS =	$(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
42*18c2aff7Sartem
43*18c2aff7SartemSTORAGE_OBJS =		$(STORAGE_PROG:%=%.o)
44*18c2aff7SartemSTORAGE_SHAREDOBJS =	hal-storage-shared.o
45*18c2aff7SartemSTORAGE_SHAREDSRCS =	$(STORAGE_SHAREDOBJS:%.o=%.c)
46*18c2aff7Sartem
47*18c2aff7SartemSRCS =		$(PROGSRCS) $(STORAGE_SHAREDSRCS)
48*18c2aff7Sartem
49*18c2aff7SartemCLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT)
50*18c2aff7SartemCLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS)
51*18c2aff7Sartem
52*18c2aff7Sarteminclude ../../Makefile.cmd
53*18c2aff7Sarteminclude ../Makefile.hal
54*18c2aff7Sartem
55*18c2aff7Sartem$(HAL_PROG) :=		LDLIBS += -lc -ldbus-1 -lhal
56*18c2aff7Sartem
57*18c2aff7Sartemlshal :=		LDLIBS += -ldbus-glib-1 -lglib-2.0
58*18c2aff7Sartem
59*18c2aff7Sartem$(STORAGE_PROG)	:=	LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
60*18c2aff7Sartem
61*18c2aff7Sartem$(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
62*18c2aff7Sartem
63*18c2aff7SartemCPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
64*18c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/hal
65*18c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/libpolkit
66*18c2aff7SartemC99MODE = $(C99_ENABLE)
67*18c2aff7Sartem
68*18c2aff7SartemROOTUSRSBINPROG =	$(HAL_PROG:%=$(ROOTUSRSBIN)/%) $(SCRIPT:%=$(ROOTUSRSBIN)/%)
69*18c2aff7Sartem
70*18c2aff7SartemROOTCMDDIR =		$(ROOTLIB_HAL)
71*18c2aff7SartemROOTCMD =		$(STORAGE_PROG:%=$(ROOTCMDDIR)/%)
72*18c2aff7Sartem
73*18c2aff7Sartem.KEEP_STATE:
74*18c2aff7Sartem
75*18c2aff7Sartemall: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT)
76*18c2aff7Sartem
77*18c2aff7Sartem$(STORAGE_SHAREDOBJS): $(STORAGE_SHAREDSRCS)
78*18c2aff7Sartem	$(COMPILE.c) $(STORAGE_SHAREDSRCS)
79*18c2aff7Sartem
80*18c2aff7Sartemhal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
81*18c2aff7Sartem	$(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
82*18c2aff7Sartem	$(POST_PROCESS)
83*18c2aff7Sartem
84*18c2aff7Sartemhal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
85*18c2aff7Sartem	$(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
86*18c2aff7Sartem	$(POST_PROCESS)
87*18c2aff7Sartem
88*18c2aff7Sartemhal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
89*18c2aff7Sartem	$(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
90*18c2aff7Sartem	$(POST_PROCESS)
91*18c2aff7Sartem
92*18c2aff7Sartemhal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
93*18c2aff7Sartem	$(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
94*18c2aff7Sartem	$(POST_PROCESS)
95*18c2aff7Sartem
96*18c2aff7Sartemhal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
97*18c2aff7Sartem		$(STORAGE_SHAREDOBJS)
98*18c2aff7Sartem	$(LINK.c) hal-storage-cleanup-mountpoint.c \
99*18c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
100*18c2aff7Sartem	$(POST_PROCESS)
101*18c2aff7Sartem
102*18c2aff7Sartemhal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
103*18c2aff7Sartem		$(STORAGE_SHAREDOBJS)
104*18c2aff7Sartem	$(LINK.c) hal-storage-cleanup-all-mountpoints.c \
105*18c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
106*18c2aff7Sartem	$(POST_PROCESS)
107*18c2aff7Sartem
108*18c2aff7Sartemhal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
109*18c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
110*18c2aff7Sartem	$(POST_PROCESS)
111*18c2aff7Sartem
112*18c2aff7Sartemhal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
113*18c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
114*18c2aff7Sartem	$(POST_PROCESS)
115*18c2aff7Sartem
116*18c2aff7Sartemhal-device: hal-device.c
117*18c2aff7Sartem	$(LINK.c) -o $@ hal-device.c $(LDLIBS)
118*18c2aff7Sartem	$(POST_PROCESS)
119*18c2aff7Sartem
120*18c2aff7Sartemhal-find-by-capability: hal_find_by_capability.c
121*18c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
122*18c2aff7Sartem	$(POST_PROCESS)
123*18c2aff7Sartem
124*18c2aff7Sartemhal-find-by-property: hal_find_by_property.c
125*18c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
126*18c2aff7Sartem	$(POST_PROCESS)
127*18c2aff7Sartem
128*18c2aff7Sartemhal-get-property: hal_get_property.c
129*18c2aff7Sartem	$(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
130*18c2aff7Sartem	$(POST_PROCESS)
131*18c2aff7Sartem
132*18c2aff7Sartemhal-set-property: hal_set_property.c
133*18c2aff7Sartem	$(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
134*18c2aff7Sartem	$(POST_PROCESS)
135*18c2aff7Sartem
136*18c2aff7Sartemlshal: lshal.c
137*18c2aff7Sartem	$(LINK.c) -o $@ lshal.c $(LDLIBS)
138*18c2aff7Sartem	$(POST_PROCESS)
139*18c2aff7Sartem
140*18c2aff7Sarteminstall: all $(ROOTUSRSBINPROG) $(ROOTCMD)
141*18c2aff7Sartem
142*18c2aff7Sartem
143*18c2aff7Sartemclean:
144*18c2aff7Sartem	$(RM) $(CLEANFILES)
145*18c2aff7Sartem
146*18c2aff7Sarteminclude ../../Makefile.targ
147