# $Id: makefile.dj2,v 1.00 1997/09/15 11:02:00 Zastai Exp $
#
#   Michael Seibel
#   Networks and Distributed Computing
#   Computing and Communications
#   University of Washington
#   Administration Builiding, AG-44
#   Seattle, Washington, 98195, USA
#   Internet: mikes@cac.washington.edu
#
#   Please address all bugs and comments to "pine-bugs@cac.washington.edu"
#
#
#   Pine and Pico are registered trademarks of the University of Washington.
#   No commercial use of these trademarks may be made without prior written
#   permission of the University of Washington.
#
#   Pine, Pico, and Pilot software and its included text are Copyright
#   1989-1996 by the University of Washington.
#
#   The full text of our legal notices is contained in the file called
#   CPYRIGHT, included with this distribution.
#

#
#
# Makefile for MS-DOS version of the PINE composer library and 
# stand-alone editor pico.
#
# DJGPP v2 version of makefile
#
CC=gcc
RM=rm -f
CP=cp

#includes mouse support
MOUSE=-DMOUSE
# We have job control (well, we can shell out of PICO, but that's enough)
JOBS=-DJOB_CONTROL
#includes symbol info for debugging (or not)
#DEBUG= -gstabs+3
DEBUG= -O6
LDFLAGS= -s

# Maybe -DPOSIX instead of -DANSI?
STDCFLAGS  = -DDOS -DANSI $(MOUSE) $(JOBS)

# Uncomment this to exclude RCS ID strings from the objects
# EXTRACFLAGS += -Dlint

# This makes file writes be in text mode. Default is binary (Unix Text) mode.
ifdef DosText
EXTRACFLAGS += -DUSE_CRLF
endif

CFLAGS=	$(EXTRACFLAGS) $(DEBUG) $(STDCFLAGS)

# switches for library building
LIBCMD=		ar
LIBARGS=	ru
RANLIB=		ranlib

HFILES=		estruct.h edef.h efunc.h ebind.h pico.h

CFILES=		ansi.c attach.c basic.c bind.c browse.c \
		buffer.c composer.c display.c file.c fileio.c \
		line.c ibmpc.c osdep.c pico.c random.c region.c \
		search.c spell.c window.c word.c

OFILES=		ansi.o attach.o basic.o bind.o browse.o \
		buffer.o composer.o display.o file.o fileio.o \
		line.o ibmpc.o osdep.o pico.o random.o region.o \
		search.o spell.o window.o word.o

all:		pico.exe pilot.exe

osdep.c:	os_dos.c
		$(RM) osdep.c
		$(CP) os_dos.c osdep.c

osdep.o:        osdep.c dos_gen.c

osdep.h:	os_dos.h
		$(RM) osdep.h
		$(CP) os_dos.h osdep.h

libpico.a:	osdep.c osdep.h $(OFILES)
		$(LIBCMD) $(LIBARGS) libpico.a $(OFILES)
		$(RANLIB) libpico.a

sinclude depend

blddate.exe: blddate.o
	$(CC) $(LDFLAGS) blddate.o $(LDLIBS) -o $@

pico.exe: libpico.a main.o
	$(CC) $(LDFLAGS) main.o libpico.a $(LDLIBS) -o $@

pilot.exe: libpico.a pilot.o
	$(CC) $(LDFLAGS) pilot.o libpico.a $(LDLIBS) -o $@

clean:
	rm -f *.a *.o *~ osdep.c osdep.h pico.exe pilot.exe
