#
# $Id: Makefile,v 1.2 1998/05/11 18:58:24 jbourne Exp $
#   
#   See the file COPYING for more information on the Copyright
#
#   Copyright (C) 1998  James Bourne <jbourne@hardrock.org>
#
#   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.
#
#   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.
#

CC=gcc
LIBS=-lcgiupl
LDFLAGS=-L.
#DEBUG=-DDEBUG
INCLUDE=-I.
CFLAGS= -Wall ${INCLUDE} ${DEBUG}
TARGET=libcgiupl.a uplmain
INCDIR=/usr/local/include/
LIBDIR=/usr/local/lib/
CGIDIR=/home/httpd/cgi-bin

all:${TARGET}
	
uplmain: uplmain.o
	${CC} ${CFLAGS} -o $@ $^ ${LDFLAGS} ${LIBS}

uplmain.o: uplmain.c
	${CC} ${CFLAGS} -c $<

libcgiupl.a: cgiupl.o
	ar -r $@ $^

cgiupl.o: cgiupl.c cgiupl.h
	${CC} ${CFLAGS} -DCGIUPL -c $<

install: all
	install -m 511 -o root -g root uplmain ${CGIDIR}
	install -m 644 -o root -g root libcgiupl.a ${LIBDIR}
	install -m 644 -o root -g root cgiupl.h ${INCDIR}

clean:
	rm -f core *~ *.o ${TARGET}

