head	1.10;
access;
symbols
	version_0_20:1.6;
locks; strict;
comment	@# @;


1.10
date	2000.09.07.07.10.06;	author keithp;	state Exp;
branches;
next	1.9;

1.9
date	2000.09.07.06.33.59;	author keithp;	state Exp;
branches;
next	1.8;

1.8
date	2000.09.07.05.30.03;	author keithp;	state Exp;
branches;
next	1.7;

1.7
date	2000.09.07.04.51.53;	author keithp;	state Exp;
branches;
next	1.6;

1.6
date	97.07.01.06.07.01;	author keithp;	state Exp;
branches;
next	1.5;

1.5
date	97.06.13.11.30.55;	author keithp;	state Exp;
branches;
next	1.4;

1.4
date	97.05.31.08.16.37;	author keithp;	state Exp;
branches;
next	1.3;

1.3
date	97.05.31.08.15.34;	author keithp;	state Exp;
branches;
next	1.2;

1.2
date	97.05.31.08.14.48;	author keithp;	state Exp;
branches;
next	1.1;

1.1
date	97.05.30.06.32.02;	author keithp;	state Exp;
branches;
next	;


desc
@Formula for PalmPilot
@


1.10
log
@Add copyright
@
text
@# $Id$
# 
# Copyright  2000 Keith Packard
# 
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Keith Packard not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission.  Keith Packard makes no
# representations about the suitability of this software for any purpose.  It
# is provided "as is" without express or implied warranty.
# 
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#

PROG = formula
TARGET = $(PROG).prc
MATHLIB=MathLib.prc
ZIP = $(PROG).zip
OBJS = gram.o lex.o node.o execute.o builtin.o formula.o compile.o prim.o load.o mlib.o
HDRS = formula.h
RES = formula.rcp
ICON = formula.pbitm
RLOC= rloc0000.$(PROG).grc
GRCS = code0000.$(PROG).grc code0001.$(PROG).grc data0000.$(PROG).grc $(RLOC)
PREF= pref0000.$(PROG).grc


PREFIX = /local/PalmOS
TOOLS= $(PREFIX)/bin
CC = $(TOOLS)/m68k-palmos-coff-gcc

#uncomment this if you want to build a gdb debuggable version
#DEFINES = -DDEBUG
INCLUDES=-I../mathlib/src

CSFLAGS = -O2 -S $(DEFINES) $(INCLUDES)
CFLAGS = -O2 $(DEFINES) $(INCLUDES) -Wall -Wstrict-prototypes -fno-builtin

LIBS = $(LDIR) -lgdb -lc -lgcc

PILRC = $(TOOLS)/pilrc
TXT2BITM = $(TOOLS)/txt2bitm
OBJRES = $(TOOLS)/obj-res -reloc
#OBJRES = $(TOOLS)/obj-res
BUILDPRC = $(TOOLS)/build-prc

ICONTEXT = "Formula"
APPID = frml

.S.o:
	$(CC) $(TARGETFLAGS) -c $<

.c.s:
	$(CC) $(CSFLAGS) $<

all: $(TARGET)

$(TARGET): $(GRCS) bin.res
	$(BUILDPRC) $(TARGET) $(ICONTEXT) $(APPID) $(GRCS) \
		*.bin $(PREF)
$(ZIP): $(TARGET) $(MATHLIB) readme.txt
	zip $@@ $(TARGET) $(MATHLIB) readme.txt

$(GRCS): $(PROG)
	$(OBJRES) $(PROG)

$(MATHLIB): ../mathlib/MathLib.prc
	ln -s ../mathlib/MathLib.prc $@@

bin.res: $(RES) $(ICON) formulares.h
	rm -f *.bin
	$(PILRC) $(RES) .
	$(TXT2BITM) $(ICON)
	touch $@@

$(PROG): $(OBJS)
	$(CC) -Wl,-M -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)

$(OBJS): $(HDRS)
gram.o lex.o: gram.h
formula.o: formulares.h

gram.c gram.h: gram.y
	bison -d -o gram.c gram.y
	
clean:
	rm -rf gram.c gram.h $(OBJS) $(TARGET) $(PROG) *.bin bin.res $(GRCS)\
	$(PREF) $(MATHLIB)
@


1.9
log
@Build with newer math library
@
text
@d1 23
@


1.8
log
@Remove last vestige of multi-segment
@
text
@d3 1
d5 1
a5 1
OBJS = gram.o lex.o node.o execute.o builtin.o formula.o compile.o prim.o load.o
d20 1
a20 1
INCLUDES=-I../mathlib
d25 1
a25 1
LIBS = $(LDIR) -lgdb -lc ../mathlib/libm.a -lgcc
d47 2
a48 2
$(ZIP): $(TARGET) readme.txt
	zip $@@ $(TARGET) readme.txt
d53 3
a67 1
builtin.o: ../mathlib/math.h
d73 2
a74 1
	rm -rf gram.c gram.h $(OBJS) $(TARGET) $(PROG) *.bin bin.res $(GRCS) $(PREF)
@


1.7
log
@Switch to MathLib, update version to 0.30
@
text
@d9 1
a9 1
GRCS = code0000.$(PROG).grc code0001.$(PROG).grc code0002.$(PROG).grc data0000.$(PROG).grc $(RLOC)
d58 1
a58 2
$(PROG): $(OBJS) formula.ld
#	$(CC) -T formula.ld -Wl,-M -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
@


1.6
log
@Add .zip target
@
text
@d19 1
d21 2
a22 2
CSFLAGS = -O2 -S $(DEFINES)
CFLAGS = -O2 $(DEFINES) -Wall -Wstrict-prototypes -fno-builtin
d24 1
a24 1
LIBS = $(LDIR) -lgdb -lc -lmf -lgcc
d59 2
a60 1
	$(CC) -T formula.ld -Wl,-M -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
d65 1
@


1.5
log
@Multiple code segments
@
text
@a0 1
TARGET = formula.prc
d2 2
d45 2
d58 1
a58 1
	$(CC) -T formula.ld -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
@


1.4
log
@Remove pref .grc
@
text
@d7 2
a8 2
RLOC=rloc0000.$(PROG).grc
GRCS = code0000.$(PROG).grc code0001.$(PROG).grc data0000.$(PROG).grc $(RLOC)
d13 2
a14 2
TOOLS=$(PREFIX)/bin
CC = $(PREFIX)/bin/m68k-palmos-coff-gcc
d22 1
a22 1
LIBS = -lgdb -lc -lmf
d54 2
a55 3
$(PROG): $(OBJS)
	$(CC) -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
#	$(CC) $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
@


1.3
log
@Remove bison diag output
@
text
@d9 1
d43 1
a43 1
		*.bin pref0000.$(PROG).grc
d66 1
a66 1
	rm -rf gram.c gram.h $(OBJS) $(TARGET) $(PROG) *.bin bin.res $(GRCS) pref000.$(PROG).grc
@


1.2
log
@Add builtins, always relocate
@
text
@d62 1
a62 1
	bison -d -v -o gram.c gram.y
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
OBJS = gram.o lex.o node.o execute.o formula.o compile.o prim.o load.o
d7 1
a7 2
#RLOC=rloc0000.$(PROG).grc
RLOC=
a9 1
	
d19 1
a19 1
CFLAGS = -O2 $(DEFINES) -Wall -Wstrict-prototypes
d21 1
a21 1
LIBS = -lgdb -lc
d25 2
a26 2
#OBJRES = $(TOOLS)/obj-res -reloc
OBJRES = $(TOOLS)/obj-res
d54 2
a55 2
#	$(CC) -Wl,-r -Wl,-dc $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
	$(CC) $(CFLAGS) $(OBJS) -o $(PROG) $(LIBS)
@
