# $VER: fpl.library makefile v2.0 93-03-25

########################################################################
#                                                                      #
# fpl.library - A run time library interpreting script langauge.       #
# Copyright (C) 1992, 1993 FrexxWare                                   #
# Author: Daniel Stenberg                                              #
#                                                                      #
# 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, 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.            #
#                                                                      #
# Daniel Stenberg                                                      #
# Birger Jarlsgatan 93b 3tr                                            #
# 113 56 Stockholm                                                     #
# Sweden                                                               #
#                                                                      #
# FidoNet 2:201/328                                                    #
#                                                                      #
########################################################################

.SUFFIXES: .o .c .c~ .h .h~ .a .i

################################################
# Below follows all UNIX macros/actions/lines: #
################################################
LIB     = libfpl.a
TARGET  = FPL
EXPORT  = fpl.exp
OBJS    = script.o numexpr.o caller.o hash.o statement.o memory.o frontend.o
LIBOBJS = script.o numexpr.o hash.o statement.o memory.o frontend.o
LIBDEP  = $(LIBOBJS) $(EXPORT)
TEMP    = templib.o

# if using the `xlc' compiler:
CFLAGS  = -DUNIX -DSHARED -DDEBUG -DHIJACK -g
CC      = xlc
#CC     = cc
LD      = ld

AR      = ar
ARFLAGS = rv

# if using the GNU `gcc' compiler:
# CFLAGS = -DUNIX -DSHARED -DDEBUG -ansi
# CC     = gcc

all:	$(LIB) SFPL

$(LIB) : $(LIBDEP)
	$(LD) $(LIBOBJS) -o $(TEMP) -bE:$(EXPORT) -bM:SRE -T512 -H512 -lc
	rm -f $(LIB)
	$(AR) $(ARFLAGS) $(LIB) $(TEMP)
	rm $(TEMP)
	cp -p FPL.h ../include/libraries

$(TARGET) : $(OBJS)
	$(CC) $(OBJS) -o $(TARGET)

.c.o:
	$(CC) $(CFLAGS) -c $<

# This compiling is using -DSFPL to make the MALLOC() macro not to use the
# global `mem' variable!
SFPL: caller.c FPL.h script.h Makefile
	$(CC) $(CFLAGS) -DSFPL -o SFPL caller.c -L. -lfpl

$(OBJS): script.h FPL.h Makefile

script.o:script.c
numexpr.o:numexpr.c
caller.o:caller.c
statement.o:statement.c
hash.o:hash.c
memory.o:memory.c memory.h
frontend.o:frontend.c