# jax4th makefile ... 32-bit ANS Forth for Windows NT
# copyright (c) 1993 by jack j. woehr
# p.o. box 51, golden, co 80402-0051
# jax@well.sf.ca.us | JAX on GEnie | 72203.1320@compuserve.com
# sysop, rcfb (303) 278-0364

# 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. (copying.txt)
#
# 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.  */

!include <ntwin32.mak>
.SUFFIXES: .a
#since GNU RCS for MS-DOS only allows one-character suffixes
#MASM=e:\mstools\bin\masm386
MASM=e:\masm611\bin\masm.exe
SOURCES = jax4th.a jax4th.i jx4files.a windows.i makefile uniblock.c uniascii.c
RESOURCES = jax4th.ico jax4th.rc
DOCS = doc\jax4th.doc
EXES = jax4th.exe uniblock.exe uniascii.exe
EXAMPLES = example\jx4examp.blk example\paste.blk example\shortest.f
LICENSE = doc\copying.txt
PROJ = jax4th
MISC = doc\read_1st.txt
UTILS = uniblock.exe uniascii.exe
REV = 106

# Make all executables
all: $(EXES)
utils: $(UTILS)

# Make Jax4th
$(PROJ).exe: $(PROJ).obj $(PROJ).i windows.i
	$(rc) $(rcvars) -r -fo $(PROJ).res $(cvars) $(PROJ).rc
    	cvtres -$(CPU) $(PROJ).res -o $(PROJ).rbj
	$(link) -subsystem:console -stack:0x8000,0x8000 -section:.text,w -out:$*.exe $(PROJ).obj $(PROJ).rbj $(baselibs) user32.lib

# Make the Unicode <> ASCII utilities
uniblock.exe: uniblock.obj
	$(link) $(conflags) -out:$*.exe $** $(conlibs) user32.lib

uniascii.exe: uniascii.obj
	$(link) $(conflags) -out:$*.exe $** $(conlibs) user32.lib

# Rules
.c.obj:
  $(cc) $(cflags) $(cvars) $*.c

.a.obj:
	$(MASM) /ML $*.a ,;
#,,,
# Back the line up (removing the comment character first, of course) over the semicolon above if you want listings.

noobjs:
	-erase *.obj

nolistings:
	-erase *.lst *.crf

clean:
	-erase *.obj
	-erase *.exe

# Distribution archive

distribution: full srczip

full:
	-pkzip -a    distrib\jx4nt$(REV).zip $(LICENSE) $(MISC)
	-pkzip -a -P distrib\jx4nt$(REV).zip $(EXES)
	-pkzip -a -P distrib\jx4nt$(REV).zip $(SOURCES)
	-pkzip -a -P distrib\jx4nt$(REV).zip $(RESOURCES)
	-pkzip -a -P distrib\jx4nt$(REV).zip $(DOCS)
	-pkzip -a -P distrib\jx4nt$(REV).zip $(EXAMPLES)

srczip:
	-pkzip -a    distrib\jx4src.zip $(LICENSE) $(MISC)
	-pkzip -a -P distrib\jx4src.zip $(SOURCES)
	-pkzip -a -P distrib\jx4src.zip $(RESOURCES)
	-pkzip -a -P distrib\jx4src.zip $(EXAMPLES) example\jx4examp.scr
