xref: /illumos-gate/usr/src/cmd/init/Makefile (revision 2aeafac3612e19716bf8164f89c3c9196342979c)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright (c) 2018, Joyent, Inc.
27# Copyright 2020 Oxide Computer Company
28
29PROG= init
30ROOTFS_PROG= $(PROG)
31
32DEFAULTFILES= init.dfl
33
34include ../Makefile.cmd
35
36OBJS = init.o bootbanner.o
37CSTD = $(CSTD_GNU99)
38LDLIBS += -lpam -lbsm -lcontract -lscf
39CERRWARN += -_gcc=-Wno-parentheses
40CERRWARN += $(CNOWARN_UNINIT)
41CLOBBERFILES= $(STATIC)
42CPPFLAGS += -DBOOTBANNER1='"$(BOOTBANNER1)"'
43CPPFLAGS += -DBOOTBANNER2='"$(BOOTBANNER2)"'
44CPPFLAGS += -DBOOTBANNER3='"$(BOOTBANNER3)"'
45CPPFLAGS += -DBOOTBANNER4='"$(BOOTBANNER4)"'
46CPPFLAGS += -DBOOTBANNER5='"$(BOOTBANNER5)"'
47
48# needs work
49SMATCH=off
50
51.KEEP_STATE:
52
53all: $(ROOTFS_PROG)
54
55install: all $(ROOTETCDEFAULTFILES) $(ROOTSBINPROG)
56	$(RM) $(ROOTETCPROG)
57	$(RM) $(ROOTUSRSBINPROG)
58	$(RM) $(ROOTETC)/telinit
59	$(SYMLINK) ../sbin/$(PROG) $(ROOTETCPROG)
60	$(SYMLINK) ../../sbin/$(PROG) $(ROOTUSRSBINPROG)
61	$(SYMLINK) ../sbin/$(PROG) $(ROOTETC)/telinit
62	$(RM) $(ROOTETC)/TIMEZONE
63	cd $(ROOTETC); $(SYMLINK) default/init TIMEZONE
64
65$(PROG):	$(OBJS)
66	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
67	$(POST_PROCESS)
68
69%.o:	$(SRC)/common/bootbanner/%.c
70	$(COMPILE.c) $(OUTPUT_OPTION) $<
71	$(POST_PROCESS_O)
72
73test:
74	rtest $(PROG)
75
76clean:
77
78include ../Makefile.targ
79