SRCA  = rtAllocRequest.asm rtAllocRequestA.asm rtChangeReqAttr.asm \
        rtChangeReqAttrA.asm rtEZRequest.asm rtEZRequestA.asm \
        rtEZRequestTags.asm rtFileRequest.asm rtFileRequestA.asm \
        rtFontRequest.asm rtFontRequestA.asm rtFreeFileList.asm \
        rtFreeReqBuffer.asm rtFreeRequest.asm rtGetLong.asm \
        rtGetLongA.asm rtGetString.asm rtGetStringA.asm \
        rtCloseWindowSafely.asm rtGetVScreenSize.asm rtPaletteRequest.asm \
        rtPaletteRequestA.asm rtReqHandler.asm rtReqHandlerA.asm \
        rtScreenToFrontSafely.asm rtSetReqPosition.asm rtSetWaitPointer.asm \
        rtSpread.asm rtLockWindow.asm rtScreenModeRequest.asm \
        rtScreenModeRequestA.asm rtUnlockWindow.asm

SRCR  = rtAllocRequest.asm rtAllocRequestAR.asm rtChangeReqAttr.asm \
        rtChangeReqAttrAR.asm rtEZRequest.asm rtEZRequestAR.asm \
        rtEZRequestTags.asm rtFileRequest.asm rtFileRequestAR.asm \
        rtFontRequest.asm rtFontRequestAR.asm rtFreeFileListR.asm \
        rtFreeReqBufferR.asm rtFreeRequestR.asm rtGetLong.asm \
        rtGetLongAR.asm rtGetString.asm rtGetStringAR.asm \
        rtCloseWindowSafelyR.asm rtGetVScreenSizeR.asm rtPaletteRequest.asm \
        rtPaletteRequestAR.asm rtReqHandler.asm rtReqHandlerAR.asm \
        rtScreenToFrontSafelyR.asm rtSetReqPositionR.asm \
        rtSetWaitPointerR.asm rtSpreadR.asm rtLockWindowR.asm \
        rtScreenModeRequest.asm rtScreenModeRequestAR.asm rtUnlockWindowR.asm

OBJS   = $(SRCA:"*.asm":"*_s.o")
OBJSR  = $(SRCR:"*.asm":"*_sr.o")
OBJL   = $(SRCA:"*.asm":"*_l.o")
OBJLR  = $(SRCR:"*.asm":"*_rl.o")

ASM    = GenAm
FLAGS  = -l

all: reqtoolss.lib reqtoolssr.lib reqtoolsl.lib reqtoolsrl.lib

reqtoolss.lib : $(OBJS)
    join #?_s.o to %(left)

$(OBJS) : $(SRCA)
    $(ASM) -o%(left) %(right) $(FLAGS) -eSMALLDATA=1

reqtoolssr.lib : $(OBJSR)
    join #?_sr.o to %(left)

$(OBJSR) : $(SRCR)
    $(ASM) -o%(left) %(right) $(FLAGS) -eSMALLDATA=1

reqtoolsl.lib : $(OBJL)
    join #?_l.o to %(left)

$(OBJL) : $(SRCA)
    $(ASM) -o%(left) %(right) $(FLAGS)

reqtoolsrl.lib : $(OBJLR)
    join #?_rl.o to %(left)

$(OBJLR) : $(SRCR)
    $(ASM) -o%(left) %(right) $(FLAGS)
