dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / acct / Makefile
blob57e804ba137c84e7c135821088f4972d5d51eb08
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 2015 Gary Mills
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 PROG= acctcms acctcom acctcon acctcon1 acctcon2 \
28 acctdisk acctdusg acctmerg accton acctprc acctprc1 \
29 acctprc2 acctwtmp closewtmp fwtmp \
30 wtmpfix utmp2wtmp
31 SHFILE1= acct chargefee ckpacct dodisk lastlogin\
32 monacct nulladm prctmp prdaily prtacct \
33 remove runacct shutacct startup turnacct
34 SHFILE2= ptecms.awk ptelus.awk
35 SUBDIRS= lib
36 ALL= $(PROG) $(SHFILE1) $(SHFILE2) holidays
38 SRCS= $(PROG:%=%.c)
39 SHFILE1SRCS= $(SHFILE1:%=%.sh)
41 BINPROG= acctcom
42 LIBPROG= acctcms acctcon acctcon1 acctcon2 acctdisk \
43 acctdusg acctmerg accton acctprc acctprc1 acctprc2 \
44 acctwtmp closewtmp fwtmp utmp2wtmp \
45 wtmpfix chargefee ckpacct dodisk monacct \
46 lastlogin nulladm prctmp prdaily prtacct \
47 remove runacct shutacct startup turnacct \
48 ptecms.awk ptelus.awk
49 ETCPROG= holidays
50 INITPROG= acct
52 include ../Makefile.cmd
54 all:= TARGET= all
55 install:= TARGET= install
56 clean:= TARGET= clean
57 clobber:= TARGET= clobber
59 acctcom := LDLIBS += lib/a.a
60 acctcms acctcon acctcon1 acctmerg acctprc1 acctprc := LDLIBS += lib/a.a
62 acctdusg:= CPPFLAGS += -D_FILE_OFFSET_BITS=64
63 acctdusg:= LDLIBS += -lcmdutils
65 LIBACCTD= $(ROOTLIB)/acct
66 ETCACCTD= $(ROOTETC)/acct
67 ETCINITD= $(ROOTETC)/init.d
68 VARADMD= $(ROOT)/var/adm
69 ACCTDIR= $(VARADMD)/acct
70 ACCTSUBDIRS= $(ACCTDIR)/nite $(ACCTDIR)/fiscal $(ACCTDIR)/sum
71 WKDIRS= $(ACCTDIR) $(ACCTSUBDIRS)
73 # DIRS is directories to create. $(ETCINITD) [aka: /etc/init.d] is created
74 # in /usr/src/Targetdirs and hence should be assumed to exist.
75 DIRS= $(LIBACCTD) $(ETCACCTD) $(WKDIRS)
77 USRBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
78 LIBACCTPROG= $(LIBPROG:%=$(LIBACCTD)/%)
79 ETCACCTPROG= $(ETCPROG:%=$(ETCACCTD)/%)
80 ETCINITPROG= $(INITPROG:%=$(ETCINITD)/%)
82 $(LIBACCTD) := DIRMODE= 755
83 $(ETCACCTD) := DIRMODE= 755
84 $(WKDIRS) := DIRMODE= 775
85 $(LIBACCTD)/accton := FILEMODE= 04755
86 $(ETCINITPROG) := FILEMODE= 0744
87 $(ETCACCTPROG) := FILEMODE= 0644
89 CERRWARN += -Wno-implicit-function-declaration
90 CERRWARN += -Wno-parentheses
91 CERRWARN += -Wno-unused-variable
92 CERRWARN += -Wno-address
94 .KEEP_STATE:
96 .PARALLEL: $(ALL)
98 all: $(SUBDIRS) .WAIT $(ALL)
100 install: all .WAIT $(DIRS) .WAIT $(USRBINPROG) $(LIBACCTPROG) $(ETCACCTPROG) \
101 $(ETCINITPROG)
103 THIS_YEAR:sh= date +%Y
105 holidays: FRC
106 @if grep $(THIS_YEAR) holidays > /dev/null 2>&1;\
107 then \
109 else \
110 $(ECHO) "building holidays";\
112 $(ECHO) "* @(#)holidays\tJanuary 1, `date +%Y`";\
113 $(ECHO) "*";\
114 $(ECHO) "* Prime/Nonprime Table for UNIX Accounting System";\
115 $(ECHO) "*";\
116 $(ECHO) "* Curr\tPrime\tNon-Prime";\
117 $(ECHO) "* Year\tStart\tStart";\
118 $(ECHO) "*";\
119 $(ECHO) " `date +%Y`\t0800\t1800";\
120 $(ECHO) "*";\
121 $(ECHO) "* only the first column (month/day) is significiant.";\
122 $(ECHO) "*";\
123 $(ECHO) "* month/day\tCompany";\
124 $(ECHO) "* \t\tHoliday";\
125 $(ECHO) "*";\
126 $(ECHO) "1/1\t\tNew Years Day";\
127 $(ECHO) "7/4\t\tIndep. Day";\
128 $(ECHO) "12/25\t\tChristmas" ) > holidays;\
131 $(DIRS):
132 $(INS.dir)
134 $(LIBACCTD)/% : %
135 $(INS.file)
137 $(ETCACCTD)/% : %
138 $(INS.file)
140 $(ETCINITD)/% : %
141 $(INS.file)
143 $(SUBDIRS): FRC
144 @cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET)
146 FRC:
148 clean: $(SUBDIRS)
150 clobber: $(SUBDIRS)
151 $(RM) $(PROG) $(SHFILE1) holidays