xref: /illumos-gate/usr/src/cmd/sgs/m4/i386/Makefile (revision d3b5f56344d8bfcdd6cfb82446af0e5e55ad9ebe)
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
3267298654Sdamicoinclude		../../../sgs/Makefile.var
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gateCOBJS=		m4.o  m4ext.o  m4macs.o
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateYOBJS=		m4objs/m4y.o
377c478bd9Sstevel@tonic-gateXPG4YOBJS=	m4objs.xpg4/m4y_xpg4.o
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateOBJS=		$(COBJS:%=m4objs/%) $(YOBJS)
407c478bd9Sstevel@tonic-gateXPG4OBJS=	$(COBJS:%=m4objs.xpg4/%) $(XPG4YOBJS)
417c478bd9Sstevel@tonic-gateALLOBJS=	$(OBJS) $(XPG4OBJS)
427c478bd9Sstevel@tonic-gate
431dd08564Sab196087YBLTSRCS=	../common/m4y.c
441dd08564Sab196087XPG4BLTSRCS=	../common/m4y_xpg4.c
451dd08564Sab196087BLTSRCS=	$(YBLTSRCS) $(XPG4BLTSRCS)
467c478bd9Sstevel@tonic-gate
471dd08564Sab196087YSRCS=		$(COBJS:%.o=../common/%.c) $(YBLTSRCS)
481dd08564Sab196087XPG4SRCS=	$(COBJS:%.o=../common/%.c) $(XPG4BLTSRCS)
497c478bd9Sstevel@tonic-gateSRCS=		$(COBJS:%.o=../common/%.c) $(BLTSRCS)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateINCLIST=	-I../common
527c478bd9Sstevel@tonic-gateDEFLIST=	-DELF
537c478bd9Sstevel@tonic-gateCPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
549fb11590Smike_sCFLAGS +=	$(CCVERBOSE)
55bd0ce624SYuri PankovCSTD=	$(CSTD_GNU99)
567c478bd9Sstevel@tonic-gate
577014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
587014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
59*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
607014882cSRichard Lowe
61cf9a187cSAndy FiddamanCLEANFILES +=	$(BLTSRCS)
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gatem4objs.xpg4/%.o := CPPFLAGS += -DXPG4
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gatem4objs/%.o m4objs.xpg4/%.o: ../common/%.c
667c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate.KEEP_STATE:
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gateall:		$(PROG) $(XPG4)
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
737c478bd9Sstevel@tonic-gate		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
747c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate$(XPG4):	$(XPG4OBJS)
777c478bd9Sstevel@tonic-gate		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
787c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate$(OBJS):	m4objs
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate$(XPG4OBJS):	m4objs.xpg4
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gatem4objs m4objs.xpg4:
857c478bd9Sstevel@tonic-gate		-@mkdir -p $@
867c478bd9Sstevel@tonic-gate
8767298654Sdamicoinstall:	all $(VAR_SGSBINPROG) $(ROOTXPG4PROG) $(VAR_SGSCCSLINK)
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateclean:
907c478bd9Sstevel@tonic-gate		$(RM) $(ALLOBJS) $(CLEANFILES)
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateinclude		../../../Makefile.targ
93