#
# Makefile for in.gate
#
#  John Pochmara (pochmara@cse.ogi.edu)
#  Oregon Grauate Inistitute of Science & Technology
#
#
# Copyright (c) 1991, John Pochmara, pochmara@cse.ogi.edu
#
# Permission is granted to copy and distribute this file in modified
# or unmodified form, for noncommercial use, provided (a) this copyright
# notice is preserved, (b) no attempt is made to restrict redistribution
# of this file, and (c) this file is not distributed as part of any
# collection whose redistribution is restricted by a compilation copyright.
#


#
# CONFIG_FILE
#
#   Set to where in.gate's config file will live.  If not defined here defaults
#   to /etc/in.gate.conf .
#
CONFIG_FILE = /etc/in.gate.conf

#
# DEBUG flag
#
#  If DEBUG is defined then in.gate logs debugging info to syslog
#  at LOG_DEBUG level.
#
#DEBUG = -DDEBUG

#
# XTR_FLAGS
#
# Place any other flags you want to pass to CC here.
#
XTR_FLAGS = -O

#
# INSTALL_DIR
#
#  Set to directory where in.gate will live.
#
INSTALL_DIR = /usr/local

#
# MAN_DIR
#
# Set to top of man directory tree where you want
# in.gate man-page to live.
#
MAN_DIR = /usr/local/man


#####################################
#                                   #
#    End of config parameters       #
#                                   #
#####################################


CFLAGS = $(XTR_FLAGS) $(DEBUG) -DCONFIG_FILE=\"$(CONFIG_FILE)\"

SRC = in.gate.c
OBJ = in.gate.o

MAN_SRC = in.gate.raw

CC = cc

PROG = in.gate

all: $(PROG) $(PROG).8


$(PROG): $(OBJ) Makefile
	$(CC) $(CFLAGS) -o $(PROG) $(OBJ)

$(PROG).8: $(MAN_SRC) Makefile
	rm -f $(PROG).8
	sed -e "s,_CONFIG_,$(CONFIG_FILE)," -e "s,_PROG_,$(PROG)," \
	    -e "s,_PATH_,$(INSTALL_DIR)/$(PROG)," $(MAN_SRC) > $(PROG).8

clean:
	rm -f $(OBJ) $(PROG) $(PROG).8

install: all
	install -c -o root -m 755 $(PROG) $(INSTALL_DIR)/$(PROG)
	install -c -m 444 $(PROG).8 $(MAN_DIR)/man8/$(PROG).8


