# 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.

VPATH=src
CC=gccwin
CFLAGS=-O2
LD=pdld
LDFLAGS=-s -nostdlib --no-insert-timestamp --subsystem 2
AS=pdas --oformat coff
COPTS=-S $(CFLAGS) -Wall -ansi -fno-common -I./src -I../pdpclib -I../src -D__WIN32__ -D__NOBIVA__

OBJS=terminal.obj

TARGET=terminal.exe

all: clean $(TARGET)

$(TARGET): $(OBJS)
  $(LD) $(LDFLAGS) -o $(TARGET) ../pdpclib/w32start.obj $(OBJS) ../pdpclib/msvcrt.lib ../src/kernel32.lib ../windows/gdi32.lib ../windows/user32.lib

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

clean:
  rm -f $(OBJS) $(TARGET)
