xref: /illumos-gate/usr/src/cmd/sgs/m4/i386/Makefile (revision e9db39cef1f968a982994f50c05903cc988a3dd3)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
567298654Sdamico# Common Development and Distribution License (the "License").
667298654Sdamico# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
221dd08564Sab196087# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
239fb11590Smike_s# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25cf9a187cSAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
26cf9a187cSAndy Fiddaman#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatePROG=		m4
297c478bd9Sstevel@tonic-gateXPG4PROG=	m4
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude		../../../Makefile.cmd
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateCOBJS=		m4.o  m4ext.o  m4macs.o
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateYOBJS=		m4objs/m4y.o
367c478bd9Sstevel@tonic-gateXPG4YOBJS=	m4objs.xpg4/m4y_xpg4.o
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateOBJS=		$(COBJS:%=m4objs/%) $(YOBJS)
397c478bd9Sstevel@tonic-gateXPG4OBJS=	$(COBJS:%=m4objs.xpg4/%) $(XPG4YOBJS)
407c478bd9Sstevel@tonic-gateALLOBJS=	$(OBJS) $(XPG4OBJS)
417c478bd9Sstevel@tonic-gate
421dd08564Sab196087YBLTSRCS=	../common/m4y.c
431dd08564Sab196087XPG4BLTSRCS=	../common/m4y_xpg4.c
441dd08564Sab196087BLTSRCS=	$(YBLTSRCS) $(XPG4BLTSRCS)
457c478bd9Sstevel@tonic-gate
461dd08564Sab196087YSRCS=		$(COBJS:%.o=../common/%.c) $(YBLTSRCS)
471dd08564Sab196087XPG4SRCS=	$(COBJS:%.o=../common/%.c) $(XPG4BLTSRCS)
487c478bd9Sstevel@tonic-gateSRCS=		$(COBJS:%.o=../common/%.c) $(BLTSRCS)
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gateINCLIST=	-I../common
517c478bd9Sstevel@tonic-gateDEFLIST=	-DELF
527c478bd9Sstevel@tonic-gateCPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
539fb11590Smike_sCFLAGS +=	$(CCVERBOSE)
54bd0ce624SYuri PankovCSTD=	$(CSTD_GNU99)
557c478bd9Sstevel@tonic-gate
567014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
577014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
58d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
597014882cSRichard Lowe
60cf9a187cSAndy FiddamanCLEANFILES +=	$(BLTSRCS)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gatem4objs.xpg4/%.o := CPPFLAGS += -DXPG4
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gatem4objs/%.o m4objs.xpg4/%.o: ../common/%.c
657c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate.KEEP_STATE:
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gateall:		$(PROG) $(XPG4)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
727c478bd9Sstevel@tonic-gate		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
737c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate$(XPG4):	$(XPG4OBJS)
767c478bd9Sstevel@tonic-gate		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
777c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate$(OBJS):	m4objs
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gate$(XPG4OBJS):	m4objs.xpg4
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gatem4objs m4objs.xpg4:
847c478bd9Sstevel@tonic-gate		-@mkdir -p $@
857c478bd9Sstevel@tonic-gate
86*e9db39ceSRichard Loweinstall:	all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTCCSBINLINK)
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gateclean:
897c478bd9Sstevel@tonic-gate		$(RM) $(ALLOBJS) $(CLEANFILES)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateinclude		../../../Makefile.targ
92