# This builds a PDOS-generic executable for an ARM system

CC=gccarm
COPTS=-msoft-float -fno-builtin -fno-common -mapcs-32 -S -O0 \
    -D__UNOPT__ -D__PDOS386__ -D__PDOSGEN__ -D__ARMGEN__ \
    -D__NOBIVA__ -I . -I../generic -I../src
LD=ldarm
AS=asarm

all: clean pdptest.exe

pdptest.exe: pgastart.o pdptest.o string.o armsupa.o fpfuncsa.o
  rm -f pdptest.exe
  $(LD) -N -s -e ___crt0 -o pdptest.exe pgastart.o pdptest.o string.o armsupa.o fpfuncsa.o

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

.asm.o:
  $(AS) --defsym LINUX=0 --defsym ELF=0 --defsym STACKPARM=1 -o $@ $<

clean:
  rm -f pdptest.exe
