#
#    Proteus Parallel Architecture Simulator
#    Eric A. Brewer  and  Chris N. Dellarocas
#    Laboratory for Computer Science
#    Massachusetts Institute of Technology
#
#    Module:  build renamed printf.o files
#	The resulting .o files provide the various printf functions
#	WITHOUT using any stack space.  This eliminates a common cause
#	of (often silent) stack overflow errors due to the ~3k of stack
#       space used by printf variants.
#	(3k is often too much for small threads.)
#
#    Originally written:  11-25-92
#

CLIB = $(INIT_LIBDIR)/libc.a

print: wrappers.o print_objs

print_objs: rename print_.o
	@echo '*** Built renamed printf modules'

print_.o:   # also builds fprint_.o sprint_.o vfprint_.o
	./printf-extract $(CLIB)

rename: rename.c
	$(CC) -O rename.c -o rename

wrappers.o: wrappers.S
	cp wrappers.S wrappers.s
	$(CC) -c wrappers.s

clean:
	/bin/rm -f *~ *.s

reset:
	/bin/rm -f *.o *.s

superreset: reset clean
	/bin/rm -f rename
