xref: /illumos-gate/usr/src/cmd/ast/ksh/builtins/Makefile (revision da000159)
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 2010 Nexenta Systems, Inc.  All rights reserved.
27# Copyright (c) 2018, Joyent, Inc.
28# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
29#
30
31PROG= alias
32ALIASPROG= \
33	bg \
34	cd \
35	cksum \
36	cmp \
37	comm \
38	command \
39	cut \
40	fc \
41	fg \
42	getopts \
43	hash \
44	jobs \
45	join \
46	kill \
47	paste \
48	print \
49	read \
50	rev \
51	sum \
52	tee \
53	test \
54	type \
55	ulimit \
56	umask \
57	unalias \
58	uniq \
59	wait \
60	wc
61
62XPG4ALIASPROG= \
63	alias \
64	bg \
65	cd \
66	command \
67	fc \
68	fg \
69	getopts \
70	hash \
71	jobs \
72	kill \
73	read \
74	test \
75	type \
76	ulimit \
77	umask \
78	unalias \
79	wait
80
81XPG4SH= \
82	sh
83
84ROOTXPG4ALIAS= \
85	$(XPG4SH:%=$(ROOTXPG4BIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
86ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
87
88include ../../../Makefile.cmd
89$(SPARC_BLD)include ../../../Makefile.cmd.64
90
91FILEMODE= 555
92CERRWARN += -_gcc=-Wno-parentheses
93
94# not linted
95SMATCH=off
96
97.KEEP_STATE:
98
99all: $(PROG)
100
101$(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%):
102	$(RM) $@; $(SYMLINK) ../../bin/alias $@
103
104$(XPG4SH:%=$(ROOTXPG4BIN)/%):
105	$(RM) $@; $(SYMLINK) ../../bin/ksh93 $@
106
107$(ALIASPROG:%=$(ROOTBIN)/%): $(ROOTPROG)
108	$(RM) $@; $(LN) $(ROOTPROG) $@
109
110# Set common AST build flags (e.g., needed to support the math stuff).
111include ../../Makefile.ast
112
113ASTSRC= $(C_AST)/src/cmd/ksh93
114
115OBJECTS= \
116        alias.o
117
118SRCS=	$(OBJECTS:%.o=%.c)
119
120LDLIBS += -lshell -lcmd -last -lumem
121
122CPPFLAGS= \
123	$(DTEXTDOM) $(DTS_ERRNO) \
124	-I$(ASTSRC)/include \
125	-I$(AST)/libshell/$(MACH) \
126	-I$(ROOT)/usr/include/ast \
127	-I$(ROOT)/usr/include
128
129CFLAGS += $(ASTCFLAGS)
130CFLAGS64 += $(ASTCFLAGS64)
131
132ROOTCMDDIR=$(ROOT)/usr/bin
133
134install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTALIASPROG) $(ROOTXPG4ALIAS)
135
136$(PROG):	$(OBJECTS)
137	$(RM) alias
138	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
139	$(POST_PROCESS)
140
141clean clobber:
142	rm -f $(PROG) $(OBJECTS)
143
144_msg:
145