# This makefile was written by Paul Edwards and is released to the public domain

# This builds a Win64 ARM64 executable using Visual Studio
# You need to have run makefile.var in PDPCLIB first

CC=cl
AR=lib
#LD=link
LD=pdld --emit-relocs
AS=ml64
COPTS=-c -O2 -Oi- -nologo -GS- -Za -Zl -u -X -D__MSC__ -D__64BIT__ \
    -D__WIN32__ -I. -I../pdos/pdpclib -D__ARM__ \
    -DC90

TARGET=uemacs.exe
OBJS=		ansi.obj basic.obj bind.obj buffer.obj display.obj file.obj \
		fileio.obj line.obj lock.obj main.obj random.obj region.obj \
		search.obj spawn.obj termio.obj window.obj word.obj

$(TARGET): clean $(OBJS)
#  $(LD) -nologo -fixed:no -nodefaultlib -out:$(TARGET) ../pdos/pdpclib/w32start.obj $(OBJS) ../pdos/pdpclib/msvcrt.lib ../pdos/pdpclib/a64supb.obj
  $(LD) -s -nostdlib --no-insert-timestamp -o $(TARGET) ../pdos/pdpclib/w32start.obj $(OBJS) ../pdos/pdpclib/msvcrt.lib ../pdos/pdpclib/a64supb.obj

.c.obj:
  $(CC) $(COPTS) -Fo$*.obj $<

.asm.obj:
  $(AS) -c -nologo -Fo$@ $<

clean:
  rm -f *.obj
  rm -f $(TARGET)
