# Released to the public domain.
#
# Anyone and anything may copy, edit, publish,
# use, compile, sell and distribute this work
# and all its parts in any form for any purpose,
# commercial and non-commercial, without any restrictions,
# without complying with any conditions
# and by any means.

# This is standalone.
# See makebios.shm for more documentation

# This is designed to execute the PDOS-generic OS
# created by makefile.w32

VPATH=../pdpclib

CC=gccwin
CFLAGS=-O2 -ansi
COPTS=$(CFLAGS) -S -D__WIN32__ -I ../pdpclib -I ../src -I . \
    -DNOLIBALLOC -fno-builtin -D__NOBIVA__
AS=pdas
LD=pdld --no-insert-timestamp

OBJS=helper32.obj hlp32st.obj


all: clean helper32.exe

helper32.exe: $(OBJS)
  $(LD) --emit-relocs --image-base 0x400000 -nostdlib -s -o helper32.exe $(OBJS)
#  link -nologo -entry:__intstart -fixed:no -base:0x400000 -nodefaultlib -subsystem:EFI_APPLICATION -out:helper32.exe $(OBJS)

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

.asm.obj:
  as86 -o $@ -f coff $<
#  wasm $<
#  ml -nologo -c -coff $<

clean:
  rm -f *.obj
  rm -f helper32.exe
