xref: /titanic_51/usr/src/cmd/hal/tools/Makefile (revision b6805bf78d2bbbeeaea8909a05623587b42d58b3)
118c2aff7Sartem#
218c2aff7Sartem# CDDL HEADER START
318c2aff7Sartem#
418c2aff7Sartem# The contents of this file are subject to the terms of the
518c2aff7Sartem# Common Development and Distribution License (the "License").
618c2aff7Sartem# You may not use this file except in compliance with the License.
718c2aff7Sartem#
818c2aff7Sartem# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
918c2aff7Sartem# or http://www.opensolaris.org/os/licensing.
1018c2aff7Sartem# See the License for the specific language governing permissions
1118c2aff7Sartem# and limitations under the License.
1218c2aff7Sartem#
1318c2aff7Sartem# When distributing Covered Code, include this CDDL HEADER in each
1418c2aff7Sartem# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1518c2aff7Sartem# If applicable, add the following below this CDDL HEADER, with the
1618c2aff7Sartem# fields enclosed by brackets "[]" replaced with your own identifying
1718c2aff7Sartem# information: Portions Copyright [yyyy] [name of copyright owner]
1818c2aff7Sartem#
1918c2aff7Sartem# CDDL HEADER END
2018c2aff7Sartem#
2118c2aff7Sartem#
22d2ec54f7Sphitran# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2318c2aff7Sartem# Use is subject to license terms.
2418c2aff7Sartem#
2518c2aff7Sartem
26d2ec54f7SphitranSUBDIR =	sunos
27d2ec54f7Sphitran
2818c2aff7SartemHAL_PROG =	hal-device hal-find-by-capability hal-find-by-property \
2918c2aff7Sartem		hal-get-property hal-set-property lshal
3018c2aff7Sartem
31d2ec54f7SphitranHAL_LIB =	hal-is-caller-privileged
32d2ec54f7Sphitran
33d2ec54f7SphitranSCRIPT_BIN =	hal-fdi-validate
34d2ec54f7Sphitran
35d2ec54f7SphitranSCRIPT_LIB =	hal-system-lcd-set-brightness  hal-system-lcd-get-brightness \
36d2ec54f7Sphitran		hal-system-power-hibernate hal-system-power-suspend \
37d2ec54f7Sphitran		hal-system-power-reboot hal-system-power-shutdown hal-functions
3818c2aff7Sartem
3918c2aff7SartemSTORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
4018c2aff7Sartem		hal-storage-mount hal-storage-unmount \
4118c2aff7Sartem		hal-storage-zpool-export hal-storage-zpool-import
4218c2aff7Sartem
4318c2aff7SartemSTORAGE_PROG =	$(STORAGE_METHOD_PROG) \
4418c2aff7Sartem		hal-storage-cleanup-mountpoint \
4518c2aff7Sartem		hal-storage-cleanup-all-mountpoints
4618c2aff7Sartem
4718c2aff7SartemPROGSRCS =	$(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
4818c2aff7Sartem
49a9da3307Snp146283
5018c2aff7SartemSTORAGE_OBJS =		$(STORAGE_PROG:%=%.o)
51eade8b27Snp146283STORAGE_SHAREDOBJS =	hal-storage-shared.o adt_data.o
52eade8b27Snp146283STORAGE_SHAREDSRCS =	$(STORAGE_SHAREDOBJS:%.o=%.c) $(STORAGE_SHAREDOBJS:%.o=../utils/%.c)
5318c2aff7Sartem
5418c2aff7SartemSRCS =		$(PROGSRCS) $(STORAGE_SHAREDSRCS)
5518c2aff7Sartem
56d2ec54f7SphitranCLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB)
57*b6805bf7SGordon RossCLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS) hal-storage-zpool.o
5818c2aff7Sartem
5918c2aff7Sarteminclude ../../Makefile.cmd
6018c2aff7Sarteminclude ../Makefile.hal
6118c2aff7Sartem
6218c2aff7Sartem$(HAL_PROG) :=		LDLIBS += -lc -ldbus-1 -lhal
6318c2aff7Sartem
6418c2aff7Sartemlshal :=		LDLIBS += -ldbus-glib-1 -lglib-2.0
6518c2aff7Sartem
66d2ec54f7Sphitran$(HAL_LIB) :=	LDLIBS += -lc -ldbus-1 -lpolkit $(ZIGNORE) -lglib-2.0
67d2ec54f7Sphitran
6818c2aff7Sartem$(STORAGE_PROG)	:=	LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
6918c2aff7Sartem
7018c2aff7Sartem$(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
7118c2aff7Sartem
7218c2aff7SartemCPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
7318c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/hal
7418c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/libpolkit
7518c2aff7SartemC99MODE = $(C99_ENABLE)
7618c2aff7Sartem
77d2ec54f7SphitranROOTUSRSBINPROG =	$(HAL_PROG:%=$(ROOTUSRSBIN)/%) \
78d2ec54f7Sphitran			$(SCRIPT_BIN:%=$(ROOTUSRSBIN)/%)
7918c2aff7Sartem
8018c2aff7SartemROOTCMDDIR =		$(ROOTLIB_HAL)
81d2ec54f7SphitranROOTCMD =		$(STORAGE_PROG:%=$(ROOTCMDDIR)/%) \
82d2ec54f7Sphitran			$(HAL_LIB:%=$(ROOTCMDDIR)/%) \
83d2ec54f7Sphitran			$(SCRIPT_LIB:%=$(ROOTCMDDIR)/%)
84d2ec54f7Sphitran
85d2ec54f7Sphitranall :=          TARGET= all
86d2ec54f7Sphitraninstall :=      TARGET= install
87d2ec54f7Sphitranclean :=        TARGET= clean
88d2ec54f7Sphitranclobber :=      TARGET= clobber
8918c2aff7Sartem
9018c2aff7Sartem.KEEP_STATE:
9118c2aff7Sartem
92d2ec54f7Sphitranall: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB) $(SUBDIR)
9318c2aff7Sartem
94a9da3307Snp146283hal-storage-shared.o: hal-storage-shared.c
95a9da3307Snp146283	$(COMPILE.c) -o $@ hal-storage-shared.c
96a9da3307Snp146283
97a9da3307Snp146283adt_data.o: ../utils/adt_data.c
98a9da3307Snp146283	$(COMPILE.c) -o $@ ../utils/adt_data.c
99a9da3307Snp146283
10018c2aff7Sartemhal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
10118c2aff7Sartem	$(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10218c2aff7Sartem	$(POST_PROCESS)
10318c2aff7Sartem
10418c2aff7Sartemhal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
10518c2aff7Sartem	$(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10618c2aff7Sartem	$(POST_PROCESS)
10718c2aff7Sartem
10818c2aff7Sartemhal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
10918c2aff7Sartem	$(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11018c2aff7Sartem	$(POST_PROCESS)
11118c2aff7Sartem
11218c2aff7Sartemhal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
11318c2aff7Sartem	$(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11418c2aff7Sartem	$(POST_PROCESS)
11518c2aff7Sartem
11618c2aff7Sartemhal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
11718c2aff7Sartem		$(STORAGE_SHAREDOBJS)
11818c2aff7Sartem	$(LINK.c) hal-storage-cleanup-mountpoint.c \
11918c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12018c2aff7Sartem	$(POST_PROCESS)
12118c2aff7Sartem
12218c2aff7Sartemhal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
12318c2aff7Sartem		$(STORAGE_SHAREDOBJS)
12418c2aff7Sartem	$(LINK.c) hal-storage-cleanup-all-mountpoints.c \
12518c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12618c2aff7Sartem	$(POST_PROCESS)
12718c2aff7Sartem
12818c2aff7Sartemhal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
12918c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
13018c2aff7Sartem	$(POST_PROCESS)
13118c2aff7Sartem
13218c2aff7Sartemhal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
13318c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
13418c2aff7Sartem	$(POST_PROCESS)
13518c2aff7Sartem
13618c2aff7Sartemhal-device: hal-device.c
13718c2aff7Sartem	$(LINK.c) -o $@ hal-device.c $(LDLIBS)
13818c2aff7Sartem	$(POST_PROCESS)
13918c2aff7Sartem
14018c2aff7Sartemhal-find-by-capability: hal_find_by_capability.c
14118c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
14218c2aff7Sartem	$(POST_PROCESS)
14318c2aff7Sartem
14418c2aff7Sartemhal-find-by-property: hal_find_by_property.c
14518c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
14618c2aff7Sartem	$(POST_PROCESS)
14718c2aff7Sartem
14818c2aff7Sartemhal-get-property: hal_get_property.c
14918c2aff7Sartem	$(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
15018c2aff7Sartem	$(POST_PROCESS)
15118c2aff7Sartem
15218c2aff7Sartemhal-set-property: hal_set_property.c
15318c2aff7Sartem	$(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
15418c2aff7Sartem	$(POST_PROCESS)
15518c2aff7Sartem
15618c2aff7Sartemlshal: lshal.c
15718c2aff7Sartem	$(LINK.c) -o $@ lshal.c $(LDLIBS)
15818c2aff7Sartem	$(POST_PROCESS)
15918c2aff7Sartem
160d2ec54f7Sphitraninstall: all $(ROOTUSRSBINPROG) $(ROOTCMD) $(SUBDIR)
16118c2aff7Sartem
162d2ec54f7Sphitranclean: $(SUBDIR)
16318c2aff7Sartem	$(RM) $(CLEANFILES)
16418c2aff7Sartem
165d2ec54f7Sphitran$(SUBDIR): FRC
166d2ec54f7Sphitran	@cd $@; pwd; $(MAKE) $(TARGET)
167d2ec54f7Sphitran
168d2ec54f7SphitranFRC:
169d2ec54f7Sphitran
17018c2aff7Sarteminclude ../../Makefile.targ
171