xref: /illumos-gate/usr/src/cmd/hal/tools/Makefile (revision eade8b27e8185317f75d0a41e3a1b0d620d3e99c)
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# ident	"%Z%%M%	%I%	%E% SMI"
2618c2aff7Sartem#
2718c2aff7Sartem
28d2ec54f7SphitranSUBDIR =	sunos
29d2ec54f7Sphitran
3018c2aff7SartemHAL_PROG =	hal-device hal-find-by-capability hal-find-by-property \
3118c2aff7Sartem		hal-get-property hal-set-property lshal
3218c2aff7Sartem
33d2ec54f7SphitranHAL_LIB =	hal-is-caller-privileged
34d2ec54f7Sphitran
35d2ec54f7SphitranSCRIPT_BIN =	hal-fdi-validate
36d2ec54f7Sphitran
37d2ec54f7SphitranSCRIPT_LIB =	hal-system-lcd-set-brightness  hal-system-lcd-get-brightness \
38d2ec54f7Sphitran		hal-system-power-hibernate hal-system-power-suspend \
39d2ec54f7Sphitran		hal-system-power-reboot hal-system-power-shutdown hal-functions
4018c2aff7Sartem
4118c2aff7SartemSTORAGE_METHOD_PROG = hal-storage-closetray hal-storage-eject \
4218c2aff7Sartem		hal-storage-mount hal-storage-unmount \
4318c2aff7Sartem		hal-storage-zpool-export hal-storage-zpool-import
4418c2aff7Sartem
4518c2aff7SartemSTORAGE_PROG =	$(STORAGE_METHOD_PROG) \
4618c2aff7Sartem		hal-storage-cleanup-mountpoint \
4718c2aff7Sartem		hal-storage-cleanup-all-mountpoints
4818c2aff7Sartem
4918c2aff7SartemPROGSRCS =	$(PROG:%=%.c) $(STORAGE_PROG:%=%.c)
5018c2aff7Sartem
51a9da3307Snp
5218c2aff7SartemSTORAGE_OBJS =		$(STORAGE_PROG:%=%.o)
53*eade8b27SnpSTORAGE_SHAREDOBJS =	hal-storage-shared.o adt_data.o
54*eade8b27SnpSTORAGE_SHAREDSRCS =	$(STORAGE_SHAREDOBJS:%.o=%.c) $(STORAGE_SHAREDOBJS:%.o=../utils/%.c)
5518c2aff7Sartem
5618c2aff7SartemSRCS =		$(PROGSRCS) $(STORAGE_SHAREDSRCS)
5718c2aff7Sartem
58d2ec54f7SphitranCLOBBERFILES += $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB)
5918c2aff7SartemCLEANFILES += $(STORAGE_SHAREDOBJS) $(STORAGE_OBJS)
6018c2aff7Sartem
6118c2aff7Sarteminclude ../../Makefile.cmd
6218c2aff7Sarteminclude ../Makefile.hal
6318c2aff7Sartem
6418c2aff7Sartem$(HAL_PROG) :=		LDLIBS += -lc -ldbus-1 -lhal
6518c2aff7Sartem
6618c2aff7Sartemlshal :=		LDLIBS += -ldbus-glib-1 -lglib-2.0
6718c2aff7Sartem
68d2ec54f7Sphitran$(HAL_LIB) :=	LDLIBS += -lc -ldbus-1 -lpolkit $(ZIGNORE) -lglib-2.0
69d2ec54f7Sphitran
7018c2aff7Sartem$(STORAGE_PROG)	:=	LDLIBS += -lc -ldbus-1 -lglib-2.0 -lhal -lhal-storage -lbsm
7118c2aff7Sartem
7218c2aff7Sartem$(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
7318c2aff7Sartem
7418c2aff7SartemCPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
7518c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/hal
7618c2aff7SartemCPPFLAGS += -I$(ROOT)/usr/include/libpolkit
7718c2aff7SartemC99MODE = $(C99_ENABLE)
7818c2aff7Sartem
79d2ec54f7SphitranROOTUSRSBINPROG =	$(HAL_PROG:%=$(ROOTUSRSBIN)/%) \
80d2ec54f7Sphitran			$(SCRIPT_BIN:%=$(ROOTUSRSBIN)/%)
8118c2aff7Sartem
8218c2aff7SartemROOTCMDDIR =		$(ROOTLIB_HAL)
83d2ec54f7SphitranROOTCMD =		$(STORAGE_PROG:%=$(ROOTCMDDIR)/%) \
84d2ec54f7Sphitran			$(HAL_LIB:%=$(ROOTCMDDIR)/%) \
85d2ec54f7Sphitran			$(SCRIPT_LIB:%=$(ROOTCMDDIR)/%)
86d2ec54f7Sphitran
87d2ec54f7Sphitranall :=          TARGET= all
88d2ec54f7Sphitraninstall :=      TARGET= install
89d2ec54f7Sphitranclean :=        TARGET= clean
90d2ec54f7Sphitranclobber :=      TARGET= clobber
9118c2aff7Sartem
9218c2aff7Sartem.KEEP_STATE:
9318c2aff7Sartem
94d2ec54f7Sphitranall: $(HAL_PROG) $(STORAGE_PROG) $(SCRIPT_BIN) $(SCRIPT_LIB) $(HAL_LIB) $(SUBDIR)
9518c2aff7Sartem
96a9da3307Snphal-storage-shared.o: hal-storage-shared.c
97a9da3307Snp	$(COMPILE.c) -o $@ hal-storage-shared.c
98a9da3307Snp
99a9da3307Snpadt_data.o: ../utils/adt_data.c
100a9da3307Snp	$(COMPILE.c) -o $@ ../utils/adt_data.c
101a9da3307Snp
10218c2aff7Sartemhal-storage-closetray: hal-storage-closetray.o $(STORAGE_SHAREDOBJS)
10318c2aff7Sartem	$(LINK.c) hal-storage-closetray.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10418c2aff7Sartem	$(POST_PROCESS)
10518c2aff7Sartem
10618c2aff7Sartemhal-storage-eject: hal-storage-eject.o $(STORAGE_SHAREDOBJS)
10718c2aff7Sartem	$(LINK.c) hal-storage-eject.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
10818c2aff7Sartem	$(POST_PROCESS)
10918c2aff7Sartem
11018c2aff7Sartemhal-storage-mount: hal-storage-mount.o $(STORAGE_SHAREDOBJS)
11118c2aff7Sartem	$(LINK.c) hal-storage-mount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11218c2aff7Sartem	$(POST_PROCESS)
11318c2aff7Sartem
11418c2aff7Sartemhal-storage-unmount: hal-storage-unmount.o $(STORAGE_SHAREDOBJS)
11518c2aff7Sartem	$(LINK.c) hal-storage-unmount.o $(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
11618c2aff7Sartem	$(POST_PROCESS)
11718c2aff7Sartem
11818c2aff7Sartemhal-storage-cleanup-mountpoint: hal-storage-cleanup-mountpoint.c \
11918c2aff7Sartem		$(STORAGE_SHAREDOBJS)
12018c2aff7Sartem	$(LINK.c) hal-storage-cleanup-mountpoint.c \
12118c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12218c2aff7Sartem	$(POST_PROCESS)
12318c2aff7Sartem
12418c2aff7Sartemhal-storage-cleanup-all-mountpoints: hal-storage-cleanup-all-mountpoints.c \
12518c2aff7Sartem		$(STORAGE_SHAREDOBJS)
12618c2aff7Sartem	$(LINK.c) hal-storage-cleanup-all-mountpoints.c \
12718c2aff7Sartem		$(STORAGE_SHAREDOBJS) -o $@ $(LDLIBS)
12818c2aff7Sartem	$(POST_PROCESS)
12918c2aff7Sartem
13018c2aff7Sartemhal-storage-zpool-export: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
13118c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"export\" hal-storage-zpool.c $(LDLIBS)
13218c2aff7Sartem	$(POST_PROCESS)
13318c2aff7Sartem
13418c2aff7Sartemhal-storage-zpool-import: hal-storage-zpool.c $(STORAGE_SHAREDOBJS)
13518c2aff7Sartem	$(LINK.c) -o $@ $(STORAGE_SHAREDOBJS) -DZPOOL_SUBCMD=\"import\" hal-storage-zpool.c $(LDLIBS)
13618c2aff7Sartem	$(POST_PROCESS)
13718c2aff7Sartem
13818c2aff7Sartemhal-device: hal-device.c
13918c2aff7Sartem	$(LINK.c) -o $@ hal-device.c $(LDLIBS)
14018c2aff7Sartem	$(POST_PROCESS)
14118c2aff7Sartem
14218c2aff7Sartemhal-find-by-capability: hal_find_by_capability.c
14318c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_capability.c $(LDLIBS)
14418c2aff7Sartem	$(POST_PROCESS)
14518c2aff7Sartem
14618c2aff7Sartemhal-find-by-property: hal_find_by_property.c
14718c2aff7Sartem	$(LINK.c) -o $@ hal_find_by_property.c $(LDLIBS)
14818c2aff7Sartem	$(POST_PROCESS)
14918c2aff7Sartem
15018c2aff7Sartemhal-get-property: hal_get_property.c
15118c2aff7Sartem	$(LINK.c) -o $@ hal_get_property.c $(LDLIBS)
15218c2aff7Sartem	$(POST_PROCESS)
15318c2aff7Sartem
15418c2aff7Sartemhal-set-property: hal_set_property.c
15518c2aff7Sartem	$(LINK.c) -o $@ hal_set_property.c $(LDLIBS)
15618c2aff7Sartem	$(POST_PROCESS)
15718c2aff7Sartem
15818c2aff7Sartemlshal: lshal.c
15918c2aff7Sartem	$(LINK.c) -o $@ lshal.c $(LDLIBS)
16018c2aff7Sartem	$(POST_PROCESS)
16118c2aff7Sartem
162d2ec54f7Sphitraninstall: all $(ROOTUSRSBINPROG) $(ROOTCMD) $(SUBDIR)
16318c2aff7Sartem
164d2ec54f7Sphitranclean: $(SUBDIR)
16518c2aff7Sartem	$(RM) $(CLEANFILES)
16618c2aff7Sartem
167d2ec54f7Sphitran$(SUBDIR): FRC
168d2ec54f7Sphitran	@cd $@; pwd; $(MAKE) $(TARGET)
169d2ec54f7Sphitran
170d2ec54f7SphitranFRC:
171d2ec54f7Sphitran
17218c2aff7Sarteminclude ../../Makefile.targ
173