#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# (C) 1993 Peter Thompson
# DMakefile for 32 bit int to string/string to int conversion routines.
# KNOWN BUGS
# - Untested with anything except DICE.
# - intconv32_protos.h will need to be modified for any compiler other than
# DICE. See notes in that file for details.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Definitions of "interesting" files.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

#=# Utility routines. Consult the dependancies at the end of the DMakefile
#=# to see which needs what.

USOURCES = \
to32lib.asm

UOBJECTS = $(USOURCES:*.asm:%1.o)

UHDRS = $(USOURCES:*.asm:%1.i)

#=# Sources for conversion routines. Some of these depend on some of the
#=# util group of routines; Consult the dependancies at the end of the
#=# DMakefile to see which needs what.

SOURCES = \
itoa32.asm \
atoi32.asm \
strto32.asm \
tostr32.asm

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Definitions for the assembler library.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

ASOURCES = $(SOURCES)

AOBJECTS = $(ASOURCES:*.asm:%1.o)

ASMLIBNAME = intconv32.lib

ASMOPTS = -hcfg_asm.i

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Definitions for the C library.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

CSOURCES = $(SOURCES)

COBJECTS = $(CSOURCES:*.asm:"T:%1.cobj")

CLIBNAME = intconv32.clib

#=# You could put cfg_c.i here instead

COPTS = -hcfg_dice.i

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Convenience targets; for my system only. Left in as (bad?) examples.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

default:
	echo "Make up your mind! Targets include: backup, clib, asmlib."

backup:
	copy (DMakefile|#?.(asm|i|c|h)) WORK:IntConv32 quick clone

clean:
	delete #?.o
	delete T:#?.cobj

test :	$(ASMLIBNAME) test.asm
	a68k test.asm
	blink test.o LIB $(ASMLIBNAME) to test
	delete test.o quiet

ctestr : $(CLIBNAME) test.c intconv32_protos.h
	dcc -2.0 -proto -o ctestr -mRR test.c -l$(CLIBNAME)

ctests : $(CLIBNAME) test.c intconv32_protos.h
	dcc -1.3 -proto -o ctests test.c -l$(CLIBNAME)

objects: $(AOBJECTS)

cobjects: $(COBJECTS)

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Utility module generation rules.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

$(UOBJECTS): $(USOURCES)
	a68k %(right)

#=# All depend on intdefs.i
$(UOBJECTS): intdefs.i

#=# All depend on their own header
$(UOBJECTS): $(UHDRS)

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Assembler library targets.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

#=# Library creation.

asmlib:	$(ASMLIBNAME)

$(ASMLIBNAME) : $(UOBJECTS) $(AOBJECTS)
	join $(UOBJECTS) $(AOBJECTS) as $(ASMLIBNAME)

#=# Rule for generating assembler objects from sources

$(AOBJECTS) : $(ASOURCES)
	a68k $(ASMOPTS) %(right)

$(AOBJECTS) : intdefs.i

$(AOBJECTS) : intconv32.i

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# C library targets.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

#=# Library creation

clib: $(CLIBNAME)

$(CLIBNAME) : $(UOBJECTS) $(COBJECTS)
	join $(UOBJECTS) $(COBJECTS) as $(CLIBNAME)

#=# Rule to create C stubs.

$(COBJECTS) : $(CSOURCES)
	a68k $(COPTS) -o%(left) %(right)

$(COBJECTS) : intdefs.i

#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Misc. dependencies.
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

#=# Misc. dependencies.

atoi32.o : to32lib.i

strto32.o : to32lib.i

# End Of File #
