#!gmake

ADDCFLAGS = -g
CC = cc
AR = ar slrcu
RANLIB = echo > /dev/null
CFLAGS = $(ADDCFLAGS) -I../h
ARCHIVE = text.a
LIBS = ../low/text.a
OBJS = wnmem.o wnmemn.o wnmemg.o wnmlc.o wnmemb.o wnmcpy.o wnmeq.o wnmcmp.o

compile: $(ARCHIVE) examples selftest

$(ARCHIVE): $(OBJS)
	rm -f $(ARCHIVE)
#	ar slrcu $(ARCHIVE) $(OBJS)
	$(AR) $(ARCHIVE) $(OBJS)
	$(RANLIB) $(ARCHIVE) 

selftest: selftest.o $(ARCHIVE) 
	$(CC) -o selftest selftest.o $(ARCHIVE) $(LIBS) -lm

examples: examples.o $(ARCHIVE) 
	$(CC) -o examples examples.o $(ARCHIVE) $(LIBS) -lm

clean:
	set nonomatch; rm -f *.o
	rm -f $(ARCHIVE)
	rm -f examples selftest
	rm -f core errors.txt tmp

man:
	manscript.csh
	
hfiles:
	hscript.csh
	
all: clean compile hfiles man

