# This builds the Linux 32-bit ELF executable

AS=pdas --oformat coff
CC=gccwin
LD=pdld

COPTS=-S -O2 -fno-common -ansi -I. -I../pdos/pdpclib \
    -U__WIN32__ -D__NOBIVA__ \
    -D__gnu_linux__
LDFLAGS=-s --no-insert-timestamp -nostdlib --oformat elf --emit-relocs

COBJ=append.obj ar.obj conv.obj delete.obj display.obj extract.obj \
    lib.obj ranlib.obj replace.obj report.obj

all: clean xar.exe

xar.exe: $(COBJ)
  $(LD) $(LDFLAGS) -o xar.exe ../pdos/pdpclib/linstart.o $(COBJ) ../pdos/pdpclib/pdplinux.a

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

clean:
  rm -f *.obj xar.exe
