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