xref: /titanic_41/usr/src/cmd/vi/port/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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
524da5b34Srie# Common Development and Distribution License (the "License").
624da5b34Srie# 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#
21ead1f93eSLiane Praza
227c478bd9Sstevel@tonic-gate#
23ead1f93eSLiane Praza# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
26ead1f93eSLiane Praza
277c478bd9Sstevel@tonic-gate# cmd/vi/port/Makefile
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gatePROG= ex
307c478bd9Sstevel@tonic-gateXPG4PROG= ex
317c478bd9Sstevel@tonic-gateXPG6PROG= ex
327c478bd9Sstevel@tonic-gateLIBPROGS= expreserve exrecover
337c478bd9Sstevel@tonic-gateXD4= exobjs.xpg4
347c478bd9Sstevel@tonic-gateXD6= exobjs.xpg6
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateEXOBJS=	bcopy.o ex.o ex_addr.o ex_cmds.o ex_cmds2.o \
377c478bd9Sstevel@tonic-gate	ex_cmdsub.o ex_data.o ex_extern.o ex_get.o \
387c478bd9Sstevel@tonic-gate	ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o \
397c478bd9Sstevel@tonic-gate	ex_temp.o ex_tty.o ex_unix.o ex_v.o ex_vadj.o \
407c478bd9Sstevel@tonic-gate	ex_vget.o ex_vmain.o ex_voper.o ex_vops.o \
417c478bd9Sstevel@tonic-gate	ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
427c478bd9Sstevel@tonic-gate	printf.o
437c478bd9Sstevel@tonic-gateEXOBJS_XPG4= $(EXOBJS) compile.o values-xpg4.o
447c478bd9Sstevel@tonic-gateEXOBJS_XPG6= $(EXOBJS) compile.o values-xpg6.o
457c478bd9Sstevel@tonic-gateXPG4EXOBJS= ${EXOBJS_XPG4:%=$(XD4)/%}
467c478bd9Sstevel@tonic-gateXPG6EXOBJS= ${EXOBJS_XPG6:%=$(XD6)/%}
477c478bd9Sstevel@tonic-gateEXRECOVEROBJS=	exrecover.o ex_extern.o
487c478bd9Sstevel@tonic-gateOBJS= $(EXOBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) expreserve.o exrecover.o
497c478bd9Sstevel@tonic-gateSRCS= $(EXOBJS:%.o=%.c) expreserve.c exrecover.c
507c478bd9Sstevel@tonic-gateTXTS = READ_ME makeoptions asfix.c70 ex.news port.mk.370 port.mk.70	\
517c478bd9Sstevel@tonic-gate	port.mk.c70 port.mk.usg ovdoprnt.s ovprintf.c rofix
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
54*7014882cSRichard Lowe
55*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
56*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-clobbered
57*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
58*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
59*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label
60*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-value
61*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized
62*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-address
63*7014882cSRichard Lowe
647c478bd9Sstevel@tonic-gate#
657c478bd9Sstevel@tonic-gate# For message catalogue files
667c478bd9Sstevel@tonic-gate#
677c478bd9Sstevel@tonic-gatePOFILES= $(EXOBJS:%.o=%.po) expreserve.po exrecover.po
687c478bd9Sstevel@tonic-gatePOFILE= port.po
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate# Include all XPG4 and XPG4ONLY changes in the XPG4 version
717c478bd9Sstevel@tonic-gate$(XPG4) := CFLAGS += -DXPG4 -DXPG4ONLY
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate# Include all XPG4 changes, but don't include XPG4ONLY in the XPG6 version
743a5240e9Scf46844$(XPG6) := CFLAGS += -DXPG4 -DXPG6 -I$(SRC)/lib/libc/inc
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gateCPPFLAGS +=  -DUSG -DSTDIO -DVMUNIX -DTABS=8 -DSINGLE -DTAG_STACK
7724da5b34Srie
7824da5b34Srie# vi maintains its own versions of various routines from libc and libcurses,
7924da5b34Srie# so localize all symbols to avoid name space collisions.
8024da5b34SrieLDFLAGS +=	$(MAPFILE.NGB:%=-M%)
8124da5b34Srie
827c478bd9Sstevel@tonic-gateCLOBBERFILES += $(LIBPROGS)
8367e3a03eSrieex :=		LDLIBS += -lmapmalloc -lcurses -lgen -lcrypt_i
8467e3a03eSrie$(XPG4) :=	LDLIBS += -lmapmalloc -lcurses -lgen -lcrypt_i
8567e3a03eSrie$(XPG6) :=	LDLIBS += -lmapmalloc -lcurses -lgen -lcrypt_i
867c478bd9Sstevel@tonic-gateexrecover :=	LDLIBS += -lmapmalloc -lcrypt_i
877c478bd9Sstevel@tonic-gatelint :=		LDLIBS += -lmapmalloc -lcurses -lgen -lcrypt
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateROOTLIBPROGS= $(LIBPROGS:%=$(ROOTLIB)/%)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate# hard links to ex
92ead1f93eSLiane PrazaROOTLINKS= $(ROOTBIN)/edit $(ROOTHASBIN)/edit $(ROOTBIN)/vedit \
93ead1f93eSLiane Praza	$(ROOTHASBIN)/vedit $(ROOTHASBIN)/vi $(ROOTHASBIN)/view \
94ead1f93eSLiane Praza
957c478bd9Sstevel@tonic-gateROOTXPG4LINKS= $(ROOTXPG4BIN)/vi $(ROOTXPG4BIN)/view $(ROOTXPG4BIN)/edit \
967c478bd9Sstevel@tonic-gate	$(ROOTXPG4BIN)/vedit
977c478bd9Sstevel@tonic-gateROOTXPG6LINKS= $(ROOTXPG6BIN)/vi $(ROOTXPG6BIN)/view $(ROOTXPG6BIN)/edit \
987c478bd9Sstevel@tonic-gate	$(ROOTXPG6BIN)/vedit
997c478bd9Sstevel@tonic-gate.KEEP_STATE:
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS)
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4) $(XPG6) $(LIBPROGS)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gate$(PROG): $(EXOBJS)
1067c478bd9Sstevel@tonic-gate	$(LINK.c) $(EXOBJS) -o $@ $(LDLIBS)
1077c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gateex.xpg4: $(XD4) $(XPG4EXOBJS)
1107c478bd9Sstevel@tonic-gate	$(LINK.c) $(XPG4EXOBJS) -o $@ $(LDLIBS)
1117c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gateex.xpg6: $(XD6) $(XPG6EXOBJS)
1147c478bd9Sstevel@tonic-gate	$(LINK.c) $(XPG6EXOBJS) -o $@ $(LDLIBS)
1157c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate$(XD4)/compile.o $(XD6)/compile.o: ../../expr/compile.c
1187c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ ../../expr/compile.c
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate%values-xpg4.o: ../../../lib/common/common/values-xpg4.c
1217c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg4.c
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate%values-xpg6.o: ../../../lib/common/common/values-xpg6.c
1247c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg6.c
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate$(XPG4EXOBJS): $(XD4)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate$(XPG6EXOBJS): $(XD6)
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate$(XD4)/%.o:	%.c
1317c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate$(XD6)/%.o:	%.c
1347c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gate$(XD4):
1377c478bd9Sstevel@tonic-gate	-@mkdir -p $@
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate$(XD6):
1407c478bd9Sstevel@tonic-gate	-@mkdir -p $@
1417c478bd9Sstevel@tonic-gate
1427c478bd9Sstevel@tonic-gateexrecover:	$(EXRECOVEROBJS)
1437c478bd9Sstevel@tonic-gate	$(LINK.c) $(EXRECOVEROBJS) -o $@ $(LDLIBS)
1447c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gatecatalog: $(MSGDOMAIN) $(POFILE)
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
1497c478bd9Sstevel@tonic-gate	$(RM) $@
1507c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gate
153ead1f93eSLiane Prazainstall: all $(ROOTHASBINPROG) $(ROOTLIBPROGS) $(ROOTLINKS) \
1547c478bd9Sstevel@tonic-gate	$(ROOTXPG4PROG) $(ROOTXPG4LINKS) $(ROOTXPG6PROG) $(ROOTXPG6LINKS)
1557c478bd9Sstevel@tonic-gate
156ead1f93eSLiane Praza$(ROOTLINKS): $(ROOTHASBINPROG)
1577c478bd9Sstevel@tonic-gate	-$(RM) $@
158ead1f93eSLiane Praza	-$(LN) -f $(ROOTHASBINPROG) $@
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate$(ROOTXPG4LINKS): $(ROOTXPG4PROG)
1617c478bd9Sstevel@tonic-gate	-$(RM) $@
1627c478bd9Sstevel@tonic-gate	-$(LN) -f $(ROOTXPG4PROG) $@
1637c478bd9Sstevel@tonic-gate
1647c478bd9Sstevel@tonic-gate$(ROOTXPG6LINKS): $(ROOTXPG6PROG)
1657c478bd9Sstevel@tonic-gate	-$(RM) $@
1667c478bd9Sstevel@tonic-gate	-$(LN) -f $(ROOTXPG6PROG) $@
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gateclean:
1697c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gatelint: lint_SRCS
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
174