#~!makefile for RCS
# Name:  makefile Part No.: _______-____r
#
# Copyright 1995 - J B Systems, Morrison, CO
#
# The recipient of this product specifically agrees not to distribute,
# disclose, or disseminate in any way, to any one, nor use for its own
# benefit, or the benefit of others, any information contained  herein
# without the expressed written consent of J B Systems.
#
#                     RESTRICTED RIGHTS LEGEND
#
# Use, duplication, or disclosure by the Government is  subject  to
# restriction  as  set forth in paragraph (b) (3) (B) of the Rights
# in Technical Data and Computer Software  Clause  in  DAR  7-104.9
# (a).
#

#ident	"$Id: makefile,v 1.13 1995/10/13 23:28:36 jbev Exp $"

# $Log $
#

# Make parameters when using NBC on MPX
# Modified by J. Bevier, J B Systems for NASA port to operation
# on MPX operating systems with a non based C compiler.
#

ROOT = /
TARGET = /system/bin
SRCDIR = .
PREFIX = nb
INCLUDE = /system/nbinclude
SINCLUDE = $(INCLUDE)/sys
BIN = /system/bin
SBIN = /system/bin
UBIN = /system/bin
LIB = /system/bin
YBIN = /system/bin
CC = $(UBIN)/$(PREFIX)cc
CFLAGS = -DMPX# -G -L
CPP = $(LIB)/$(PREFIX)cpp
CPFLAGS = -M $(CFLAGS)
LD = $(UBIN)/$(PREFIX)cat
LDFLAGS = -Yrcsmap
LIBS = #-Kmy
LDLIBS = $(LIBS)#-Tbigfile
YACC = $(YBIN)/$(PREFIX)yacc
YFLAGS =
OWN = system
GRP = system
MAKEFILE = makefile

 COMPAT2 = 0
#COMPAT2 = 1
 RCSDIR = /system/bin
#RCSDIR = /usr/bin
 REMOVE = $(BIN)/rm -f
 LINK = $(CC)

# The herader files
HDRS = conf.h rcsbase.h

# The source files for all of the programs.
SRCS =	ci.c co.c ident.c maketime.c merge.c merger.c partime.c rcs.c \
	rcsclean.c rcsdiff.c rcsedit.c rcsfcmp.c rcsfnms.c rcsgen.c \
	rcskeep.c rcskeys.c rcslex.c rcsmap.c rcsmerge.c rcsrev.c rcssyn.c \
	rcsutil.c rlog.c

# Object files
OBJS =	ci.o co.o ident.o maketime.o merge.o merger.o partime.o rcs.o \
	rcsclean.o rcsdiff.o rcsedit.o rcsfcmp.o rcsfnms.o rcsgen.o \
	rcskeep.o rcskeys.o rcslex.o rcsmap.o rcsmerge.o rcsrev.o rcssyn.o \
	rcsutil.o rlog.o

# all commands
MAIN = ci co ident merge rcs rcsdiff rcsmerge rlog rcsclean

# default targets
ALL:	all
all:	$(MAIN)
	$(BIN)/echo $(MAIN) is up to date.

#$(MAIN):	$(MAKEFILE) $(OBJS)
#	$(CC) $(LDFLAGS) $(OBJS) -o $(MAIN)
#	$(BIN)/chmod 775 $@
#	$(BIN)/chgrp $(GRP) $@
#	$(BIN)/chown $(OWN) $@

CLEAN:  clean
clean:
	$(BIN)/rm -f $(OBJS)

CLOBBER: clobber
clobber: clean
	$(BIN)/rm -f $(MAIN)
	$(BIN)/rm -f *map

NEWLIB: newlib
newlib:
	$(BIN)/rm -f $(MAIN)
	$(BIN)/rm -f *map

DEPEND: depend
depend: $(SRCS) $(HDRS) $(MAKEFILE)
	$(BIN)/mkdep $(MAKEFILE) >dep.out;
	@for i in $(SRCS); do \
	$(BIN)/echo "# Source file '$$i'" >> dep.out; \
	$(CPP) -I$(SRCDIR) $(CPFLAGS) $$i >> dep.out; \
	done;
	$(BIN)/echo "# End of dependencies" >> dep.out;
	$(BIN)/mv dep.out $(MAKEFILE);

COMPILE = $(CC) -c -I$(SRCDIR) $(CFLAGS)

.c.o:
	$(COMPILE) $<

INSTALL: install
install : all
	$(BIN)/cp $(MAIN) $(SBIN)
	$(BIN)/cp $(MAIN) /system/system

ci = ci.o rcslex.o rcssyn.o rcsgen.o rcsedit.o rcskeys.o rcsmap.o \
	rcsrev.o rcsutil.o rcsfnms.o partime.o maketime.o rcskeep.o \
	rcsfcmp.o
ci : $(ci)
	$(LINK) $(ci) $(LDLIBS) -Ycimap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

co = co.o rcslex.o rcssyn.o rcsgen.o rcsedit.o rcskeys.o rcsmap.o \
	rcsrev.o rcsutil.o rcsfnms.o partime.o maketime.o rcskeep.o
co : $(co)
	$(LINK) $(co) $(LDLIBS) -Ycomap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

ident = ident.o rcsmap.o
ident : $(ident)
	$(LINK) $(ident) $(LDLIBS) -Yidentmap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

merge = merge.o merger.o rcsfnms.o rcslex.o \
	rcsmap.o rcsrev.o rcssyn.o rcsutil.o \
	rcskeep.o rcskeys.o
merge : $(merge)
	$(LINK) $(merge) $(LDLIBS) -Ymergemap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

rlog = rlog.o rcslex.o rcsmap.o rcssyn.o rcsrev.o rcsutil.o partime.o \
	maketime.o rcsfnms.o rcskeep.o rcskeys.o
rlog : $(rlog)
	$(LINK) $(rlog) $(LDLIBS) -Yrlogmap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

rcs = rcs.o rcslex.o rcssyn.o rcsrev.o rcsutil.o rcsgen.o rcsedit.o rcskeys.o \
	rcsmap.o rcsfnms.o rcskeep.o
rcs : $(rcs)
	$(LINK) $(rcs) $(LDLIBS) -Yrcsmap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

rcsclean = rcsclean.o rcsedit.o rcsfcmp.o rcsfnms.o rcsgen.o rcskeys.o \
	rcslex.o rcsmap.o rcsrev.o rcssyn.o rcsutil.o rcskeep.o
rcsclean : $(rcsclean)
	$(LINK) $(rcsclean) $(LDLIBS) -Yrcscleanmap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

rcsdiff = rcsdiff.o rcsutil.o rcsfnms.o rcsmap.o rcsrev.o rcssyn.o rcslex.o \
	maketime.o partime.o rcskeep.o rcskeys.o
rcsdiff : $(rcsdiff)
	$(LINK) $(rcsdiff) $(LDLIBS) -Yrcsdiffmap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

rcsmerge = rcsmerge.o merger.o rcsutil.o rcsfnms.o rcsmap.o rcsrev.o rcssyn.o \
	rcslex.o rcskeep.o rcskeys.o
rcsmerge : $(rcsmerge)
	$(LINK) $(rcsmerge) $(LDLIBS) -Yrcsmergemap -o $@
	$(BIN)/chmod 775 $@
	$(BIN)/chgrp $(GRP) $@
	$(BIN)/chown $(OWN) $@

conf_h = conf.h

$(OBJS) : $(conf_h) rcsbase.h

# DO NOT DELETE THIS LINE -- the dependencies begin here
