# produce pdos.exe as an Amiga hunk PDOS-generic app
# Links against pdosgeno.a built with makefile.amg

# Define ATARICLONE if you want a mini Atari clone
# This is expected to run under the pseudobios produced
# by makefile.l6g

# By default this also runs theoretical Win32 68000
# applications built by pdpclib/makefile.s68

CC=gccami
CFLAGS=-O2
LD=ldami
LDFLAGS=
AS=asami
AR=arami
COPTS=-S $(CFLAGS) -ansi -I. -I../bios -I../pdpclib -I../src \
    -U__WIN32__ -D__PDOS386__ -DNOLIBALLOC -D__NOBIVA__ -DNEED_AMIGA \
    -DNEED_ATARI -DXATARICLONE \
    -DUSE_MEMMGR -DDONT_MM \
    -U__AMIGA__ -D__M68K__ \
    -DNEED_MZ -DNO_DLLENTRY -DNEEDCBIG -DWINNEWMOD \
    -D__NODECLSPEC__ -D__W32EMUL__

all: clean pdos.exe

pdos.exe: genstart.o pdos.o ../bios/exeload.o ../src/fat.o atrextra.o
    $(LD) $(LDFLAGS) -s -N -e ___crt0 -o pdos.exe genstart.o pdos.o ../bios/exeload.o ../src/fat.o atrextra.o ../pdpclib/pdosgeno.a

.c.o:
    $(CC) $(COPTS) -o $*.s $<
    $(AS) -o $@ $*.s
    rm -f $*.s

.asm.o:
    $(AS) -o $@ $<

clean:
    rm -f *.o pdos.exe
