#~!makefile for molib
# 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.9 1995/05/08 17:41:37 jbev Exp $"

# $Log: makefile,v $
# Revision 1.9  1995/05/08  17:41:37  jbev
# Change header to molib from nblib.
#
# Revision 1.8  1995/03/28  18:21:00  root
# Fix typo.
#
# Revision 1.7  1995/03/21  17:03:49  jbev
# Only archive c.srte.o, not c.srt.o.
#
# Revision 1.6  1995/03/17  18:56:13  jbev
# Fix some typos.
#
# Revision 1.5  1995/03/17  17:42:26  jbev
# Remove cassg for awhile.
#
# Revision 1.4  1995/03/16  23:55:56  jbev
# Add unixio.h and unixio.c.
#
# Revision 1.6  1995/03/10  18:07:44  jbev
# Added last of files.
#
# Revision 1.5  1995/03/08  00:18:16  jbev
# Add more files.
#
# Revision 1.4  1995/03/08  00:04:49  jbev
# Fix dependencies for molib/modir.
#
# Revision 1.3  1995/03/07  23:58:14  jbev
# Add dependencies for prefile.
#
# Revision 1.2  1995/03/07  23:42:15  jbev
# Correct some typos.
#
# Revision 1.1  1995/03/07  23:10:40  jbev
# Initial revision
#
#

# Make parameters when running on MPX

ROOT = /system/system
TARGET = /system/bin
SOURCE = .
PREFIX = nb
INCLUDE = /system/$(PREFIX)include
SINCLUDE = $(INCLUDE)
SBIN = /system/system
BIN = /system/bin
UBIN = /system/bin
LIB = /system/bin
YBIN = /system/bin
CPP = $(LIB)/$(PREFIX)cpp
CPFLAGS = -M
CC = $(UBIN)/$(PREFIX)cc
CFLAGS = -DMPX -Ui386
LD = $(UBIN)/$(PREFIX)nbcat
LDFLAGS = -YXXXXmap
YACC = $(YBIN)/$(PREFIX)yacc
YFLAGS =
CLIBPREFIX = mo
MAKEFILE = makefile

# Fill in with correct information

HDRS = unixio.h

OBJ_A = c.srt.o c.srte.o pnpars.o

OBJ_B = c.srte.o pnpars.o

SRC_A = c.srt.s c.srte.s pnpars.s

OBJ_C = ctscan.o getcwvd.o exec.o mpxini.o getpid.o unixio.o #cassg.o

SRC_C = ctscan.c getcwvd.c exec.c mpxini.c getpid.c unixio.c #cassg.c

SRCS = $(SRC_A) $(SRC_C)

MAIN = $(OBJ_A) $(OBJ_C)

ALL:	all

all:	prefile $(CLIBPREFIX)lib $(CLIBPREFIX)dir $(MAIN)
	$(BIN)/ar -rc $(CLIBPREFIX) $(OBJ_B)
	$(BIN)/ar -rv $(CLIBPREFIX) $(OBJ_C)
	$(BIN)/echo $(CLIBPREFIX)lib/$(CLIBPREFIX)dir are up to date.

$(CLIBPREFIX)lib:
	$(BIN)/touch $(CLIBPREFIX)lib

$(CLIBPREFIX)dir:
	$(BIN)/touch $(CLIBPREFIX)dir

CLEAN:  clean

clean:
	$(BIN)/rm -f $(OBJ_A)
	$(BIN)/rm -f $(OBJ_C)

CLOBBER: clobber

clobber: clean
	$(BIN)/rm -f $(CLIBPREFIX)lib
	$(BIN)/rm -f $(CLIBPREFIX)dir

REALCLEAN: realclean

realclean: clobber
	$(BIN)/rm -f $(SRCS)
	$(BIN)/rm -f $(MAKEFILE)

DEPEND: depend

#depend: $(SRCS) $(HDRS) $(MAKEFILE)
#	$(BIN)/dodep $(CPFLAGS) $(MAKEFILE) $(SRCS) >dep.out
#	$(BIN)/mv dep.out $(MAKEFILE)

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

INSTALL: install

install: all
	$(BIN)/cp $(CLIBPREFIX)lib $(BIN)/$(CLIBPREFIX)lib
	$(BIN)/cp $(CLIBPREFIX)dir $(BIN)/$(CLIBPREFIX)dir

# Source file 'c.srt.s'
c.srt.o: prefile c.srt.s
	$(CC) -Pprefile -c c.srt.s -o c.srt.o

# Source file 'c.srte.s'
c.srte.o: prefile c.srte.s
	$(CC) -Pprefile -c c.srte.s -o c.srte.o

# Source file 'pnpars.s'
pnpars.o: prefile pnpars.s
	$(CC) -Pprefile -c pnpars.s -o pnpars.o

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