# $Id: Makefile,v 1.11 1994/07/16 00:04:38 asf Exp $

#    This file is part of Addventure
#    Copyright (C) 1994  Allen S. Firstenberg
# 
#    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.

# For gcc
CC= gcc
# For ANSI compilers
#CC= cc

#For Optimization
#CFLAGS= -O2
#For debugging
CFLAGS= -g

#
# Libraries and includes:
#  - the CGI library
#
INCDIR = -I../cgi-query
LIBDIR = -L../cgi-query
LIBS   = -lcgi

#
# The UMASK is the inverse (in octal) of the file permissions to set
# in standard UNIX file permissions.  Only one of these should be uncommented.
#
# For -rw-r--r--
UMASK = 0022
#
# For -rw-rw-r--
# UMASK = 0002
#
# Any other defines can be put here
#
DEFINES = 

BINPATH     = /cgi-bin
ABSFILEPATH = /usr/www/htdocs/addventure
RELFILEPATH = /addventure

#
# Non-compiler commands
#
RM       = /bin/rm -f
TAR      = tar
COMPRESS = gzip -9

TARFILE  = addventure.tar

#--- You shouldn't have to edit anything else. ---

BINPATHDEF     = -DBINPATH=\"$(BINPATH)\"
ABSFILEPATHDEF = -DABSFILEPATH=\"$(ABSFILEPATH)\"
RELFILEPATHDEF = -DRELFILEPATH=\"$(RELFILEPATH)\"
UMASKDEF       = -DUMASK=$(UMASK)
ALLDEFINES     = $(DEFINES) \
                 $(BINPATHDEF) $(ABSFILEPATHDEF) $(RELFILEPATHDEF) \
                 $(UMASKDEF)

.SUFFIXES: .C

.C.o: 
	$(CC) $(ALLDEFINES) $(INCDIR) -c $(CFLAGS) $<

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

TARGET1 = textproc
OBJS1   = textproc.o util.o

TARGET2 = optproc
OBJS2   = makeroom.o optproc.o util.o

TARGET3 = makefirst
OBJS3   = makeroom.o makefirst.o

all: $(TARGET1) $(TARGET2) $(TARGET3)

$(TARGET1): $(OBJS1)
	$(CC) $(OBJS1) $(LIBDIR) $(LIBS) -o $(TARGET1)

$(TARGET2): $(OBJS2)
	$(CC) $(OBJS2) $(LIBDIR) $(LIBS) -o $(TARGET2)

$(TARGET3): $(OBJS3)
	$(CC) $(OBJS3) $(LIBDIR) $(LIBS) -o $(TARGET3)

#
# Standard rules
#

clean:
	-rm $(TARGET1) $(OBJS1)
	-rm $(TARGET2) $(OBJS2)
	-rm $(TARGET3) $(OBJS3)

tarfile:
	-$(TAR) -cvf $(TARFILE) *.[CHch] Makefile COPYING Version *.html

archive: tarfile
	$(COMPRESS) $(TARFILE)

#
# $Log: Makefile,v $
# Revision 1.11  1994/07/16  00:04:38  asf
# Added UMASK definition to set file permissions.
#
# Revision 1.10  1994/07/10  10:59:06  asf
# Added "Version" to the archive
#
# Revision 1.9  1994/06/05  09:24:07  asf
# Converted spaces to tabs
#
# Revision 1.8  1994/06/05  09:17:53  asf
# Added GPL
#
# Revision 1.7  1994/06/05  09:12:15  asf
# Added rules for clean, tar, and compress.
#
# Revision 1.6  1994/06/04  22:25:47  asf
# Added rules for the "makefirst" program.
# Added rules to deal with breaking out the make_room() function into
# a file of its own.
#
# Revision 1.5  1994/06/04  20:57:08  asf
# Removed the rules for post-query
#
# Revision 1.4  1994/06/04  20:35:15  asf
# Added/used defines for the file and bin paths.
#
# Revision 1.3  1994/05/28  12:38:55  asf
# Made use of the Includes and Libraries
#
# Revision 1.2  1994/05/28  12:14:04  asf
# Added headers.  (I hope)
# Added definitions for the Include and Library directories.
#
#