#
# Palmtop News Reader (PNR)
#
# Copyright (C) 2000       David Becher
# Copyright (C) 1997-1998  Rod Whitby
# Copyright (C) 1995-1997  Michael J. Leaver
#
# SEE 'PNRSRC.TXT' FOR MORE INFORMATION
#
# DOS Makefile
#
# $Source: A:/SRC/PNR/RCS/makefile $
# $Id: makefile 1.18 2000/04/07 19:51:36 rwhitby Exp $
#
# !!! EDIT THIS FILE FOR YOUR CONFIGURATION !!!
# Note: I dont really use this make file as I prefer using the IDE
# but it should work!
#
NAME = pnr
VERMAJOR = 4
VERMINOR = 0
RELEASE = 0
SUFFIX  = 40
#-----------------------------------------------------------------------------
# PAL v1.6 Library location
#
PALINC = a:\tc\pal16\src\inc
PALXLIB = a:\tc\lib\tcspal.lib
PALELIB = a:\tc\lib\tclpal.lib

#-----------------------------------------------------------------------------
# Compiler
#

# Borland C++ V2 & Turbo Assembler
CC      = tcc
AS      = tasm
AR      = tlib
E2M     = tce2m
COPTS   = -w -1 -d -f- -O -X -Z- -I$(PALINC) -I. \
          -DVERMAJOR=$(VERMAJOR) -DVERMINOR=$(VERMINOR) -DRELEASE=$(RELEASE)
DEBUG   = -v -O-

#-----------------------------------------------------------------------------
#
# DO NOT MODIFY BELOW THIS POINT
#

#
# PNR Common Object files
#
OBJS    = hm.obj folder.obj dlgres.obj pnrlib.obj disp.obj funcs.obj   \
		  post.obj news.obj int.obj encode.obj

#
# Compilation rules
#
all:    pnr.exm pnr.exe pnrti.exe 

#test.exe

install : all
		copy pnr.exe a:\lxtcp
		copy pnrti.exe a:\lxtcp
		copy pnr.exm a:\lxtcp

pnr.exm: $(OBJS) libasm.obj
    $(CC) -ms -ls -epnrs.exe libasm.obj pnrexm.lib $(PALXLIB)
    $(E2M) pnrs
    ren pnrs.exm pnr.exm
    dir *.ex*

pnr.exe: $(OBJS)
    $(CC) -ml -ls -epnrl.exe pnrexe.lib $(PALELIB)
    ren pnrl.exe pnr.exe
    dir *.ex*

pnrti.exe: pnrti.obj pnrlib.obj
    $(CC) -ml -epnrti.exe pnrti.obj pnrlib.obj $(PALELIB)
    dir *.ex*

test.exe: test.c
    $(CC) -ms -etest.exe $(COPTS) test.c
    dir *.ex*

#
# Specific object rules
#

pnrti.obj : pnrti.c
    $(CC) -c -ml -DMSDOS -DPAL $(COPTS) $*.c

#
# Generic object rules
#

.c.obj:
    $(CC) -c -ms -DSYSMGR $(COPTS) $*.c
    $(AR) pnrexm.lib /C -+$*
    $(CC) -c -ml $(COPTS) $*.c
    $(AR) pnrexe.lib /C -+$*

.asm.obj:
    $(AS) /t $* /mx;

#
# Make a fresh program. Forces recompile of everything.
#
fresh: clean all

#
# Delete everything but the source
#
clean:
    del *.obj
    del *.bak
    del *.map
    del *.exe
    del *.exm
    del *.lib
    del *.zip

#
# Distribution
#
zip:
    pkzip $(NAME)$(SUFFIX)b.zip \
        readme pnr.doc pnrfaq.txt pnrmime.txt \
        pnr.exm pnr.exe pnrti.exe \
        pnr.cfg pnr.icn pnrti.icn
    pkzip $(NAME)$(SUFFIX)s.zip \
        readme pnr.doc pnrfaq.txt pnrsrc.txt \
        pnr.cfg pnr.icn pnrti.icn \
        makefile *.c *.h *.asm

dbzip:
    copy outs\pnrs.exm pnr.exm
    copy outl\pnrl.exe pnr.exe
    copy outl\pnrti.exe pnrti.exe
    pkzip $(NAME)$(SUFFIX)b.zip \
        readme.txt pnr.doc pnrfaq.txt pnrmime.txt \
        pnr.exm pnr.exe pnrti.exe \
        pnr.cfg *.icn
    pkzip $(NAME)$(SUFFIX)s.zip \
	*.txt pnr.doc pnr.cfg *.icn \
	makefile *.c *.h *.asm
    del *.ex*

