8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / hal / tools / Makefile
blob1c4fceb34b227402d4e7cc1fec9df5749fc03171
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
26 SUBDIR = sunos
28 HAL_PROG = hal-device hal-find-by-capability hal-find-by-property \
29 hal-get-property hal-set-property lshal
31 HAL_LIB = hal-is-caller-privileged
33 SCRIPT_BIN = hal-fdi-validate
35 SCRIPT_LIB = hal-system-lcd-set-brightness hal-system-lcd-get-brightness \
36 hal-system-power-hibernate hal-system-power-suspend \
37 hal-system-power-reboot hal-system-power-shutdown hal-functions
39 STORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
40 hal-storage-mount hal-storage-unmount \
41 hal-storage-zpool-export hal-storage-zpool-import
43 STORAGE_PROG = $(STORAGE_METHOD_PROG) \
44 hal-storage-cleanup-mountpoint \
45 hal-storage-cleanup-all-mountpoints
47 PROGSRCS = $(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
50 STORAGE_OBJS = $(STORAGE_PROG:%=%.o)
51 STORAGE_SHAREDOBJS = hal-storage-shared.o adt_data.o
52 STORAGE_SHAREDSRCS = $(STORAGE_SHAREDOBJS:%.o=%.c) $(STORAGE_SHAREDOBJS:%.o=../utils/%.c)
54 SRCS = $(PROGSRCS) $(STORAGE_SHAREDSRCS)
56 CLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB)
57 CLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS) hal-storage-zpool.o
59 include ../../Makefile.cmd
60 include ../Makefile.hal
62 $(HAL_PROG) := LDLIBS += -lc -ldbus-1 -lhal
64 lshal := LDLIBS += -ldbus-glib-1 -lglib-2.0
66 $(HAL_LIB) := LDLIBS += -lc -ldbus-1 -lpolkit $(ZIGNORE) -lglib-2.0
68 $(STORAGE_PROG) := LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
70 $(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
72 CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
73 CPPFLAGS += -I$(ROOT)/usr/include/hal
74 CPPFLAGS += -I$(ROOT)/usr/include/libpolkit
75 C99MODE = $(C99_ENABLE)
77 ROOTUSRSBINPROG = $(HAL_PROG:%=$(ROOTUSRSBIN)/%) \
78 $(SCRIPT_BIN:%=$(ROOTUSRSBIN)/%)
80 ROOTCMDDIR = $(ROOTLIB_HAL)
81 ROOTCMD = $(STORAGE_PROG:%=$(ROOTCMDDIR)/%) \
82 $(HAL_LIB:%=$(ROOTCMDDIR)/%) \
83 $(SCRIPT_LIB:%=$(ROOTCMDDIR)/%)
85 all := TARGET= all
86 install := TARGET= install
87 clean := TARGET= clean
88 clobber := TARGET= clobber
90 .KEEP_STATE:
92 all: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB) $(SUBDIR)
94 hal-storage-shared.o: hal-storage-shared.c
95 $(COMPILE.c) -o $@ hal-storage-shared.c
97 adt_data.o: ../utils/adt_data.c
98 $(COMPILE.c) -o $@ ../utils/adt_data.c
100 hal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
101 $(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
102 $(POST_PROCESS)
104 hal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
105 $(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
106 $(POST_PROCESS)
108 hal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
109 $(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
110 $(POST_PROCESS)
112 hal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
113 $(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
114 $(POST_PROCESS)
116 hal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
117 $(STORAGE_SHAREDOBJS)
118 $(LINK.c) hal-storage-cleanup-mountpoint.c \
119 $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
120 $(POST_PROCESS)
122 hal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
123 $(STORAGE_SHAREDOBJS)
124 $(LINK.c) hal-storage-cleanup-all-mountpoints.c \
125 $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
126 $(POST_PROCESS)
128 hal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
129 $(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
130 $(POST_PROCESS)
132 hal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
133 $(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
134 $(POST_PROCESS)
136 hal-device: hal-device.c
137 $(LINK.c) -o $@ hal-device.c $(LDLIBS)
138 $(POST_PROCESS)
140 hal-find-by-capability: hal_find_by_capability.c
141 $(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
142 $(POST_PROCESS)
144 hal-find-by-property: hal_find_by_property.c
145 $(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
146 $(POST_PROCESS)
148 hal-get-property: hal_get_property.c
149 $(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
150 $(POST_PROCESS)
152 hal-set-property: hal_set_property.c
153 $(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
154 $(POST_PROCESS)
156 lshal: lshal.c
157 $(LINK.c) -o $@ lshal.c $(LDLIBS)
158 $(POST_PROCESS)
160 install: all $(ROOTUSRSBINPROG) $(ROOTCMD) $(SUBDIR)
162 clean: $(SUBDIR)
163 $(RM) $(CLEANFILES)
165 $(SUBDIR): FRC
166 @cd $@; pwd; $(MAKE) $(TARGET)
168 FRC:
170 include ../../Makefile.targ