# SCCS_ID - "@(#)Makefile (TWG)       1.9     89/09/08 "
#
#   @(#) Copyright (c) 1988  The Wollongong Group, Inc.  All Rights Reserved
#
LIB	= twgmisc.a

# if a 386 machine, use cksum386.s and priv386.s.
# Otherwise use in_cksum.c, hton.c and bcmp.c 

SOURCES = bp_copy.c \
	endflush.c \
	iocreply.c \
	que.c \
	up.c \
	bcmp.c hton.c in_cksum.c sum_block.c sum_longs.s

#	cksum386.s priv386.s 

OBJECTS = $(LIB)(bp_copy.o) \
	$(LIB)(endflush.o) \
	$(LIB)(iocreply.o) \
	$(LIB)(que.o) \
	$(LIB)(up.o) \
	$(LIB)(bcmp.o) $(LIB)(hton.o) \
	$(LIB)(in_cksum.o) $(LIB)(sum_block.o) $(LIB)(sum_longs.o) 

#	$(LIB)(cksum386.o) $(LIB)(priv386.o)

SHELL	= /bin/sh
BINDIST	= ../../../bindist
SRCDIST	= ../../../srcdist
OPTS	= -O
DEFINES =
INCLUDE = -I../../../include 

include	../../../make.pre

DEFS	= $(DEFINES) -DNO_SCCS_ID -DKERNEL -DINKERNEL
CFLAGS	= $(INCLUDE) $(OPTS) $(DEFS)

$(LIB) all: $(OBJECTS)
	@echo $(LIB) is up to date.

.c.a: $*.c
	$(CC) $(CFLAGS) -c $*.c
	ar rv $(LIB) $*.o
	-rm -f $*.o

.s.a: $*.s
	$(CC) -c $*.s
	ar rv $(LIB) $*.o
	-rm -f $*.o

.c.s: $*.c
	$(CC) $(CFLAGS) -S $*.c

.PRECIOUS: $(LIB)

srcdist : $(SOURCES) Makefile
	cp $(SOURCES) Makefile $(SRCDIST)/user/kernel/src/twgmisc

bindist : $(LIB)
	cp $(LIB) $(BINDIST)/user/usr/sys/lib

install : $(LIB)
	cp $(LIB) $(INSTALL)/usr/sys/lib

clean	:
	rm -f *.o core a.out

clobber	: clean
	rm -f $(LIB)
