OpenSolaris_b135/cmd/vi/port/port.mk.usg

#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#ident	"%Z%%M%	%I%	%E% SMI"

#	Makefile for vi

ROOT =

DIR = $(ROOT)/usr/bin
DIRS = $(ROOT)/var/preserve

LIBDIR	= $(ROOT)/usr/lib
EX	= ex

INC = $(ROOT)/usr/include

LDFLAGS = -s -lcurses -lcrypt_i -lgen -lw $(PERFLIBS)

OPTIONS = -DUSG -DSTDIO 

DEBUGFLAGS = -DTRACE -g
NONDEBUGFLAGS = -O
DEB = $(NONDEBUGFLAGS)

CFLAGS = $(DEB) -I$(INC) $(OPTIONS) -DTABS=8 -DSINGLE

INS = install

STRIP = strip

SIZE = size

FOLD = ../misc/fold
CTAGS = ../misc/ctags
CXREF = ../misc/cxref


MAKEFILE = makefile.usg


MAINS = ex expreserve exrecover 

OBJECTS =  bcopy.o ex.o ex_addr.o ex_cmds.o ex_cmds2.o \
	ex_cmdsub.o ex_data.o ex_extern.o ex_get.o \
	ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o \
	ex_temp.o ex_tty.o ex_unix.o ex_v.o ex_vadj.o \
	ex_vget.o ex_vmain.o ex_voper.o ex_vops.o \
	ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
	printf.o expreserve.o exrecover.o

SOURCES =  bcopy.c ex.c ex_addr.c ex_cmds.c ex_cmds2.c \
	ex_cmdsub.c ex_data.c ex_extern.c ex_get.c \
	ex_io.c ex_put.c ex_re.c ex_set.c ex_subr.c \
	ex_temp.c ex_tty.c ex_unix.c ex_v.c ex_vadj.c \
	ex_vget.c ex_vmain.c ex_voper.c ex_vops.c \
	ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c \
	printf.c exrecover.c expreserve.c

MISC = READ_ME makeoptions asfix.c70 ex.news makefile.370 makefile.c70 \
	makefile.70 ovdoprnt.s ovprintf.c rofix

ALL:		$(MAINS)

ex:		bcopy.o ex.o ex_addr.o ex_cmds.o ex_cmds2.o \
		ex_cmdsub.o ex_data.o ex_extern.o ex_get.o \
		ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o \
		ex_temp.o ex_tty.o ex_unix.o ex_v.o ex_vadj.o \
		ex_vget.o ex_vmain.o ex_voper.o ex_vops.o \
		ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
		printf.o 
	$(CC) $(CFLAGS)  -o ex  bcopy.o ex.o ex_addr.o ex_cmds.o ex_cmds2.o \
	ex_cmdsub.o ex_data.o ex_extern.o ex_get.o \
	ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o \
	ex_temp.o ex_tty.o ex_unix.o ex_v.o ex_vadj.o \
	ex_vget.o ex_vmain.o ex_voper.o ex_vops.o \
	ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
	printf.o $(LDFLAGS)

expreserve:	expreserve.o 
	$(CC) -s expreserve.o  -o expreserve 

exrecover:	exrecover.o 
	$(CC) $(CFLAGS) -s  -o exrecover  exrecover.o ex_extern.o $(LDFLAGS)


ex.o:		 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h $(INC)/setjmp.h \
		 $(INC)/sys/stat.h $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_temp.h ex_tty.h 

ex_addr.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_re.h 

ex_cmds.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_temp.h ex_tty.h ex_vis.h 

ex_cmds2.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_temp.h ex_tty.h ex_vis.h 

ex_cmdsub.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_temp.h ex_tty.h ex_vis.h $(INC)/stdio.h 

ex_data.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h 

ex_extern.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_vis.h 

ex_get.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
	 	 ex_vars.h ex_tty.h 

ex_io.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h ex_vars.h \
		 ex_argv.h ex_temp.h ex_tty.h ex_vis.h 

ex_put.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_re.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_re.h 

ex_set.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_temp.h ex_tty.h 

ex_subr.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_re.h ex_tty.h ex_vis.h 

ex_temp.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_temp.h ex_vis.h ex_tty.h 

ex_tty.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h 

ex_unix.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_temp.h ex_tty.h ex_vis.h 

ex_v.o:		 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_re.h ex_tty.h ex_vis.h 

ex_vadj.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vget.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vmain.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_voper.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vops.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vops2.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vops3.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vput.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

ex_vwind.o:	 ex.h $(INC)/sys/types.h $(INC)/ctype.h \
		 $(INC)/errno.h $(INC)/signal.h \
		 $(INC)/setjmp.h $(INC)/sys/stat.h \
		 $(INC)/termio.h $(INC)/sys/termio.h \
		 $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_tty.h ex_vis.h 

expreserve.o:	 $(INC)/stdio.h $(INC)/ctype.h \
		 $(INC)/sys/types.h $(INC)/sys/stat.h \
		 $(INC)/sys/dir.h $(INC)/pwd.h 
	$(CC) $(CFLAGS) -c -O expreserve.c

exrecover.o:	 $(INC)/stdio.h ex.h $(INC)/sys/types.h \
		 $(INC)/ctype.h $(INC)/errno.h \
		 $(INC)/signal.h $(INC)/setjmp.h \
		 $(INC)/sys/stat.h $(INC)/termio.h \
		 $(INC)/sys/termio.h $(INC)/term.h ex_tune.h \
		 ex_vars.h ex_temp.h ex_tty.h \
		 $(INC)/sys/dir.h 
	$(CC) $(CFLAGS) -c -O exrecover.c

printf.o:	 $(INC)/varargs.h	

GLOBALINCS = $(INC)/ctype.h $(INC)/errno.h \
	$(INC)/pwd.h $(INC)/setjmp.h $(INC)/signal.h \
	$(INC)/stdio.h $(INC)/sys/dir.h $(INC)/sys/stat.h \
	$(INC)/sys/termio.h $(INC)/sys/types.h \
	$(INC)/term.h $(INC)/termio.h $(INC)/varargs.h 

LOCALINCS = ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h \
	ex_vis.h

clean:
	rm -f $(OBJECTS)

clobber:
	rm -f $(OBJECTS) $(MAINS)

all : ALL

install: ALL $(DIRS)
	rm -f $(DIR)/vi ; \
	rm -f $(DIR)/view ; \
	rm -f $(DIR)/edit ; \
	rm -f $(DIR)/vedit ; \
	$(INS) -f $(DIR) -m 555 -u bin -g bin -o $(EX);
	ln -f $(DIR)/$(EX) $(DIR)/vi
	ln -f $(DIR)/$(EX) $(DIR)/view
	ln -f $(DIR)/$(EX) $(DIR)/edit
	ln -f $(DIR)/$(EX) $(DIR)/vedit
	$(INS) -f $(LIBDIR) -m 555 -u bin -g bin exrecover
	$(INS) -f $(LIBDIR) -m 555 -u bin -g bin expreserve

$(DIRS):
	mkdir $@

size: ALL
	$(SIZE) $(MAINS)

strip: ALL
	$(STRIP) $(MAINS)

#	These targets are useful but optional

partslist:
	@echo $(MAKEFILE) $(SOURCES) $(LOCALINCS)  |  tr ' ' '\012'  |  sort

productdir:
	@echo $(DIR) | tr ' ' '\012' | sort

product:
	@echo $(MAINS)  |  tr ' ' '\012'  | \
	sed 's;^;$(DIR)/;'

srcaudit:
	@fileaudit $(MAKEFILE) $(LOCALINCS) $(SOURCES) $(MISC) -o $(OBJECTS) $(MAINS)