xref: /titanic_52/usr/src/cmd/allocate/Makefile (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 1989, 1998-2002 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29include		../Makefile.cmd
30
31ROOTSEC =	$(ROOTETC)/security
32ROOTSECDEV =	$(ROOTSEC)/dev
33ROOTSECLIB =	$(ROOTSEC)/lib
34ROOTDIRS =	$(ROOTSECDEV) $(ROOTSECLIB)
35
36PROG1 =		allocate
37PROG2 =		mkdevmaps mkdevalloc
38PROG3 =		audio_clean
39PROG =		$(PROG1) $(PROG2) $(PROG3)
40DEFILE =	deallocate
41LISTFILE =	list_devices
42RTLCKS =	audio fd0 sr0 st0 st1
43SCRIPTS =	st_clean fd_clean sr_clean
44ALLSCRIPTS =	allscripts.sh
45
46POFILE=		allocate_all.po
47POFILES=	$(OBJS:%.o=%.po) $(ALLSCRIPTS:%.sh=%.po)
48
49# make DFLAGS=-DDEBUG
50
51DFLAGS=
52CPPFLAGS +=	$(DFLAGS)
53
54ROOTPROG =	$(PROG1:%=$(ROOTUSRSBIN)/%) $(PROG2:%=$(ROOTUSRSBIN)/%) \
55		$(PROG3:%=$(ROOTSECLIB)/%)
56ROOTLOCKS=	$(RTLCKS:%=$(ROOTSECDEV)/%)
57ROOTSCRIPTS=	$(SCRIPTS:%=$(ROOTSECLIB)/%)
58
59CLOBBERFILES += $(SCRIPTS)
60
61allocate :=	POBJS = allocate.o  allocate3.o
62mkdevmaps :=	POBJS = mkdevmaps.o
63mkdevalloc :=	POBJS = mkdevalloc.o
64audio_clean :=	POBJS = audio_clean.o
65
66OBJS =		allocate.o allocate3.o audio_clean.o mkdevmaps.o mkdevalloc.o
67SRCS =		$(OBJS:%.o=%.c)
68
69FILEMODE=       0755
70DIRMODE=        0755
71OWNER=          root
72GROUP=          sys
73
74$(ROOTUSRSBIN)/% :=     OWNER = root
75$(ROOTUSRSBIN)/% :=     GROUP = bin
76
77$(ROOTUSRSBIN)/allocate := 	FILEMODE = 04755
78$(ROOTUSRSBIN)/deallocate :=	FILEMODE = 04755
79$(ROOTUSRSBIN)/list_devices :=	FILEMODE = 04755
80
81$(ROOTSECDEV)/% :=		FILEMODE = 0400
82$(ROOTSECDEV)/% :=              OWNER = root
83$(ROOTSECDEV)/% :=              GROUP = bin
84
85$(ROOTSECLIB)/% :=		FILEMODE = 0751
86
87allocate :=	LDLIBS += -lbsm -lsecdb
88
89.KEEP_STATE:
90
91all :		$(PROG) $(RTLCKS) $(SCRIPTS)
92
93install :	all $(ROOTDIRS) $(ROOTPROG) $(ROOTLOCKS) $(ROOTSCRIPTS)
94		$(RM) $(ROOTUSRSBIN)/$(DEFILE)
95		$(LN) $(ROOTUSRSBIN)/$(PROG1) $(ROOTUSRSBIN)/$(DEFILE)
96		$(RM) $(ROOTUSRSBIN)/$(LISTFILE)
97		$(LN) $(ROOTUSRSBIN)/$(PROG1) $(ROOTUSRSBIN)/$(LISTFILE)
98
99$(PROG) :	$$(POBJS)
100		$(LINK.c) $(POBJS) -o $@ $(LDLIBS)
101		$(POST_PROCESS)
102
103$(RTLCKS):
104		$(TOUCH) $@
105
106$(ROOTDIRS):
107		$(INS.dir)
108
109$(ROOTSECDEV)/%: %
110		$(INS.file)
111
112$(ROOTSECLIB)/%: %
113		$(INS.file)
114
115$(POFILE):      $(POFILES)
116		$(RM) $@; $(CAT) $(POFILES) > $@; $(RM)  $(POFILES)
117
118#
119# Concatenate all the scripts into one before we build the catalogue.
120# Done to shrink the catalogue since some messages are shared between
121# the various scripts.
122#
123$(ALLSCRIPTS):	$(SCRIPTS:%=%.sh)
124		$(CAT) $(SCRIPTS:%=%.sh) > $@
125
126clean :
127		$(RM) $(OBJS) $(RTLCKS) $(ALLSCRIPTS)
128
129lint :		lint_SRCS
130
131strip :
132		$(STRIP) $(PROG)
133
134include		../Makefile.targ
135