xref: /titanic_51/usr/src/cmd/shcomp/Makefile (revision 46b2e54fef23f79962caefa489542a11b53acd45)
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
27SHELL=/usr/bin/ksh93
28
29include ../Makefile.cmd
30$(SPARC_BLD)include ../Makefile.cmd.64
31
32.KEEP_STATE:
33
34# Set common AST build flags (e.g., needed to support the math stuff).
35include ../../Makefile.ast
36
37OBJECTS= \
38        shcomp.o
39
40LIBSHELLMACH=$(MACH)
41LIBSHELLBASE=../../lib/libshell
42LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
43
44SRCS=	$(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
45
46LDLIBS += -lshell -last
47
48# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
49# with usr/src/lib/libshell/Makefile.com
50# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
51# case - it MUST come as the last element but future changes in -D options
52# may then cause silent breakage in the AST sources because the last -D
53# option specified overrides previous -D options so we prefer the current
54# way to explicitly list each single flag.
55CPPFLAGS = \
56	$(DTEXTDOM) $(DTS_ERRNO) \
57	$(LIBSHELLCPPFLAGS)
58
59CFLAGS += \
60	$(ASTCFLAGS)
61CFLAGS64 += \
62	$(ASTCFLAGS64)
63
64ROOTCMDDIR=$(ROOT)/usr/bin
65
66PROG= shcomp
67
68%.o:    $(LIBSHELLSRC)/%.c
69	$(COMPILE.c) -c -o $@ $<
70	$(POST_PROCESS_O)
71
72all: $(PROG)
73
74# dummy file since AST/ksh/shcomp doesn't use *.po files
75# (and "shcomp" is just a frontend which calls directly into libshell,
76# e.g. there are no l10n strings here)
77$(PROG).po:
78	$(RM) $(PROG).po ; \
79	$(TOUCH) $(PROG).po
80
81
82install: all $(ROOTCMD)
83
84$(PROG):	$(OBJECTS)
85	$(RM) shcomp
86	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
87	$(POST_PROCESS)
88
89clean lint:
90
91include ../Makefile.targ
92