#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or 
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Makefile for noise.sys
# written for bcc 4, tasm 3.2, exe2bin

CC = bcc
COPT = -3 -mt -O2 -Z
CINC = d:\prog\bc4\include
CLIB = d:\prog\bc4\lib

DEMO = demo

ASM = tasm
AOPT =

LINK = tlink
LOPT = /k

MBIN = exe2bin

.c.obj:
  $(CC) $(COPT) $(CINC) $&.c

.asm.obj:
  $(ASM) $(AOPT) $&.asm

.obj.exe:
  $(LINK) $(LOPT) $&.obj

.exe.sys:
  $(MBIN) $&.exe $&.sys
#  if exist $&.exe erase $&.exe

# (Will the above line work for execom also?)

noise.sys: noise.obj

noise.obj: noise.asm noise.mac \
           polynom.inc sha.inc multiplex.inc \
           initnoise.inc printf.inc cpuid.inc

sample.com: $(DEMO)\sample.c
  $(CC) $(COPT) -I$(CINC) -L$(CLIB) $(DEMO)\$&.c
#  $(LINK) $(LOPT) /L$(CLIB) 
  $(MBIN) $&.exe $&.com
  if exist sample.exe erase sample.exe

clean:
  if exist noise.exe erase noise.exe
  if exist noise.obj erase noise.obj
  if exist noise.map erase noise.map
  if exist sample.obj erase sample.obj
  if exist sample.map erase sample.map
