dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / allocate / Makefile
blob7755f549c8d7418ee118ae0adeb11285bc9fa9f5
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
23 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
26 include ../Makefile.cmd
28 CERRWARN += -Wno-unused-value
29 CERRWARN += -Wno-uninitialized
30 CERRWARN += -Wno-parentheses
31 CERRWARN += -Wno-clobbered
33 ROOTSEC = $(ROOTETC)/security
34 ROOTSECDEV = $(ROOTSEC)/dev
35 ROOTSECLIB = $(ROOTSEC)/lib
36 ROOTDIRS = $(ROOTSECDEV) $(ROOTSECLIB)
38 ROOTMANIFESTDIR= $(ROOTSVCSYSTEMDEVICE)
39 SVCMETHOD = svc-allocate
40 MANIFEST = allocate.xml
42 RTLCKS = audio fd0 sr0 st0 st1
43 CLEANfd = fd_clean
44 CLEANsr = sr_clean
45 CLEANst = st_clean
46 CLEANaudio = audio_clean
47 CLEAN_SCRIPTS = $(CLEANfd) $(CLEANsr) $(CLEANst) $(CLEANaudio)
48 SCRIPTS = $(CLEAN_SCRIPTS)
49 ALLSCRIPTS = allscripts.sh
51 PROGalloc = allocate
52 PROGmkdevalloc = mkdevalloc
53 PROGdminfo = dminfo
54 PROG = $(PROGalloc) $(PROGmkdevalloc) $(PROGdminfo)
56 LINKPROGalloc = deallocate list_devices
57 LINKPROGmkdevalloc = mkdevmaps
59 POFILE = allocate_all.po
60 POFILES = $(OBJS:%.o=%.po) $(ALLSCRIPTS:%.sh=%.po)
62 CPPFLAGS += $(DFLAGS)
64 ROOTLOCKS = $(RTLCKS:%=$(ROOTSECDEV)/%)
65 ROOTSCRIPTS = $(SCRIPTS:%=$(ROOTSECLIB)/%)
67 ROOTPROG = $(PROGallocate:%=$(ROOTUSRSBIN)/%) \
68 $(PROGmkdevalloc:%=$(ROOTUSRSBIN)/%) \
69 $(PROGdminfo:%=$(ROOTUSRSBIN)/%) \
70 $(PROGaddaloc:%=$(ROOTUSRSBIN)/%)
71 ROOTLINKalloc = $(LINKPROGalloc:%=$(ROOTUSRSBIN)/%)
72 ROOTLINKmkdevalloc = $(LINKPROGmkdevalloc:%=$(ROOTUSRSBIN)/%)
73 ROOTLINKS = $(ROOTLINKalloc) $(ROOTLINKmkdevalloc)
75 PROGallocOBJS = allocate.o allocate3.o
76 PROGmkdevallocOBJS = mkdevalloc.o
77 PROGdminfoOBJS = dminfo.o
79 OBJS = $(PROGallocOBJS) \
80 $(PROGmkdevallocOBJS) \
81 $(PROGdminfoOBJS)
83 SRCS = $(OBJS:%.o=%.c)
85 $(ROOTUSRSBIN)/% := FILEMODE = 555
86 $(ROOTUSRSBIN)/allocate := FILEMODE = 4555
87 $(ROOTSECDEV)/% := FILEMODE = 0400
88 $(ROOTSECLIB)/% := FILEMODE = 0555
91 $(PROGalloc) := LDLIBS += -lbsm -lsec -lsecdb
92 $(PROGmkdevalloc) := LDLIBS += -lbsm
93 $(PROGdminfo) := LDLIBS += -lbsm
95 CLOBBERFILES += $(SCRIPTS)
97 .KEEP_STATE:
99 all : $(PROG) $(RTLCKS) $(SCRIPTS)
101 install : $(PROG) $(ROOTDIRS) $(ROOTPROG) $(ROOTLOCKS) \
102 $(ROOTSCRIPTS) $(ROOTLINKS) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
103 $(RTLCKS):
104 $(TOUCH) $@
106 $(ROOTSECLIB)/%: %.sh
107 $(INS.rename)
109 $(PROGalloc) : $(PROGallocOBJS)
110 $(LINK.c) $(PROGallocOBJS) -o $@ $(LDLIBS)
111 $(POST_PROCESS)
113 $(PROGmkdevalloc) : $(PROGmkdevallocOBJS)
114 $(LINK.c) $(PROGmkdevallocOBJS) -o $@ $(LDLIBS)
115 $(POST_PROCESS)
117 $(PROGdminfo) : $(PROGdminfoOBJS)
118 $(LINK.c) $(PROGdminfoOBJS) -o $@ $(LDLIBS)
119 $(POST_PROCESS)
121 $(ROOTDIRS) :
122 $(INS.dir)
124 $(ROOTSECDEV)/%: %
125 $(INS.file)
127 $(ROOTSECLIB)/%: %
128 $(RM) $@
129 $(INS.file)
131 $(ROOTLINKalloc) : $(PROGalloc:%=$(ROOTUSRSBIN)/%)
132 $(RM) $@
133 $(LN) $(PROGalloc:%=$(ROOTUSRSBIN)/%) $@
135 $(ROOTLINKmkdevalloc) : $(PROGmkdevalloc:%=$(ROOTUSRSBIN)/%)
136 $(RM) $@
137 $(LN) $(PROGmkdevalloc:%=$(ROOTUSRSBIN)/%) $@
140 $(ROOTETCSECLIB)/%.windowing: %
141 $(RM) $@
142 $(SYMLINK) $< $@
144 $(POFILE): $(POFILES)
145 $(RM) $@
146 $(CAT) $(POFILES) > $@
149 # Concatenate all the scripts into one before we build the catalogue.
150 # Done to shrink the catalogue since some messages are shared between
151 # the various scripts.
153 $(ALLSCRIPTS): $(SCRIPTS:%=%.sh)
154 $(CAT) $(SCRIPTS:%=%.sh) > $@
156 clean :
157 $(RM) $(PROG) $(RTLCKS) $(OBJS) \
158 $(SCRIPTS) $(ALLSCRIPTS) $(POFILE) $(POFILES)
160 strip :
161 $(STRIP) $(PROG)
163 include ../Makefile.targ