# 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 makefile builds krnlc32.lib on Windows.
# And kernel32.lib from a definition file too

VPATH=../pdpclib

CC=gccwin
CFLAGS=-O2 -ansi
COPTS=$(CFLAGS) -S -D__WIN32__ -I ../pdpclib -I . -DNOLIBALLOC
AS=as86
###AS=sasm
LD=pdld
#AR=arwin
AR=xar

OBJS=krnlc32.obj

all: clean krnlc32.lib kernel32.lib

krnlc32.lib: $(OBJS)
  $(AR) r krnlc32.lib $(OBJS)
  $(AR) s krnlc32.lib

kernel32.lib: kernel32.wat
  genimp kernel32.wat kernel32.lib i386

.asm.obj:
#  wasm -q -zcm $<
#  ml -nologo -c -coff $<
  $(AS) -f coff -o $@ $<

clean:
  rm -f *.o
  rm -f krnlc32.a
