# Makefile for Cipher

CC		= cc
DEPEND = -depend !Depend

#-zM compile for module
#-Ff don't put function names in code for backtrace
# CCFlags	= -c -throwback -IC: -zM
# CCFlags		= $(DEPEND) -c -throwback -IC: -Ff -zM
# CCFlags		= $(DEPEND) -c -throwback -IC:
CCFlags		= $(DEPEND) -c -throwback -IC: -apcs 3/32 -memaccess -L22-S22-L41

#-rmf make a module
LinkFlags	= -rmf -o $@

SqueezeFlags	= -f -v
OBJASMFlags	= $(DEPEND) -throwback -quit -closeexec
AASMFlags	= $(DEPEND) -throwback -quit -closeexec -module

Files		= o.cipher o.md5 o.idea o.ciphermod o.md5bits o.ideabits o.os_utils
Libs		= C:o.Stubs

Cipher:		$(Files)
		link $(LinkFlags) $(Files) $(Libs)
	-	RMKill cipher
		RMLoad cipher
	@	RMRun cipher

## Rule Patterns ##

.SUFFIXES:	.c .o .s .asm .cmhg

.c.o:;		$(CC) $(CCflags) $< -o $@

.s.o:;		objasm $< $@ $(OBJASMflags)

.cmhg.o:;	cmhg $< $@

# Dynamic dependencies:
o.md5:	c.md5
o.md5:	h.md5
o.idea:	c.idea
o.idea:	h.idea
o.idea:	h.usuals
o.md5bits: s.md5bits
o.md5bits: hdr.Regs
o.md5bits: hdr.CMacros
o.os_utils:	c.os_utils
o.os_utils:	C:h.kernel
o.os_utils:	C:h.swis
o.os_utils:	h.os_utils
o.os_utils:	h.cipher
o.cipher:	c.cipher
o.cipher:	C:h.kernel
o.cipher:	C:h.swis
o.cipher:	h.os_utils
o.cipher:	h.cipher
o.cipher:	h.md5
o.cipher:	h.idea
o.cipher:	h.usuals
o.ideabits: s.ideabits
o.ideabits: hdr.Regs
o.ideabits: hdr.CMacros
