#
# makefile for libutil, part of W
# (C) 94-10/96 by Torsten Scherer (TeSche)
# itschere@techfak.uni-bielefeld.de
#

include ../../.config

CPPFLAGS = -I.
CFLAGS = $(ADDCFLAGS)

.SUFFIXES: .ob

.c.ob:
	$(CC) $(CFLAGS) -mbaserel -mpcrel -c $< -o $@


#
# targets, system dependent
#

ifeq ($(ARCH),SunOS)
TARGETS = libutil.a
OBJS += memcpy_sparc.o
endif

ifeq ($(ARCH),MiNT)
TARGETS = libutil.a blibutil.a
OBJS = getopt.o getopt1.o
BOBJS = getopt.ob getopt1.ob
endif

all: $(TARGETS)

memcpy_sparc.o: memcpy_sparc.S

libutil.a: $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
ifdef RANLIB
	$(RANLIB) $@
endif

blibutil.a: $(BOBJS)
	$(RM) $@
	$(AR) $@ $(BOBJS)
ifdef RANLIB
	$(RANLIB) $@	
endif

clean:
	$(RM) *~ *.o *.ob

veryclean: clean
	$(RM) *.a
