xref: /illumos-gate/usr/src/cmd/sgs/m4/i386/Makefile (revision 0ba2cbe97e0678a691742f98d2532caed0a2c4aa)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.
26# All rights reserved.
27# Use is subject to license terms.
28#
29# cmd/sgs/m4/i386/Makefile
30#
31
32PROG=		m4
33XPG4PROG=	m4
34
35include 	../../../Makefile.cmd
36
37COBJS=		m4.o  m4ext.o  m4macs.o
38
39YOBJS=		m4objs/m4y.o
40XPG4YOBJS=	m4objs.xpg4/m4y_xpg4.o
41
42OBJS=		$(COBJS:%=m4objs/%) $(YOBJS)
43XPG4OBJS=	$(COBJS:%=m4objs.xpg4/%) $(XPG4YOBJS)
44ALLOBJS=	$(OBJS) $(XPG4OBJS)
45
46BLTSRCS=	../common/m4y.c ../common/m4y_xpg4.c
47
48SRCS=		$(COBJS:%.o=../common/%.c) $(BLTSRCS)
49
50INCLIST=	-I../common
51DEFLIST=	-DELF
52CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
53CFLAGS +=	$(CCVERBOSE)
54C99MODE=	$(C99_ENABLE)
55
56CLEANFILES +=	$(LINTOUT) $(BLTSRCS)
57
58m4objs.xpg4/%.o := CPPFLAGS += -DXPG4
59
60m4objs/%.o m4objs.xpg4/%.o: ../common/%.c
61		$(COMPILE.c) -o $@ $<
62
63.KEEP_STATE:
64
65all:		$(PROG) $(XPG4)
66
67$(PROG):	$(OBJS)
68		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
69		$(POST_PROCESS)
70
71$(XPG4):	$(XPG4OBJS)
72		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
73		$(POST_PROCESS)
74
75$(OBJS):	m4objs
76
77$(XPG4OBJS):	m4objs.xpg4
78
79m4objs m4objs.xpg4:
80		-@mkdir -p $@
81
82install:	all $(ROOTCCSBINPROG) $(ROOTXPG4PROG)
83
84clean:
85		$(RM) $(ALLOBJS) $(CLEANFILES)
86
87lint:		$(LINTOUT)
88
89$(LINTOUT):	$(SRCS)
90		$(LINT.c) $(SRCS) > $(LINTOUT) 2>&1
91
92include		../../../Makefile.targ
93