# Produce 64-bit EFI executables
# links with PDPCLIB created by makefile.es6

CC=x86_64-w64-mingw32-gcc 
LD=pdld
LDFLAGS=--no-insert-timestamp
AS=pdas --64 --oformat coff
AR=ar

COPTS=-S -O2 -mno-red-zone -D__64BIT__ -D__EFI__ -U__WIN32__ -I. -I../../pdos/pdpclib -fno-builtin -fno-common -ansi -Wno-builtin-declaration-mismatch

all: clean scc.efi

scc.efi: cg.obj decl.obj error.obj expr.obj gen.obj main.obj misc.obj \
    opt.obj prep.obj scan.obj stmt.obj sym.obj tree.obj \
    lib/strdup.obj
  $(AR) s temp.lib
  $(LD) $(LDFLAGS) -s -subsystem 10 -e efimain -o scc.efi ../../pdos/pdpclib/efistart.obj main.obj temp.lib ../../pdos/pdpclib/pdpefi.lib

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

clean:
  rm -f *.obj
  rm -f scc.efi
  rm -f temp.lib
