#
# Filter Manager make file
#
# To make for a particular platform do a "make <platform>".
#
# Current supported platforms are: solaris, sunos, and aix.
#
# This makefile will attempt to build for Solaris by default.
# The settings under Solaris may be applicable to other 
# platforms so try just "make" if your platform is not explicitly
# supported.
#
# Change the following line to set the destination directory for fm.
#
# If you port this package to another platform not listed and 
# made modifications to source code or this makefile then please
# send them to drawbridge@net.tamu.edu so they can be incorporated
# into the general release. Thanks.
#
INSTALLDIR=/usr/local/bin

#
# You shouldn't need to change anything below here.
#
HEADERS=fm.h struct.h const.h proto.h global.h
OBJS=fm.o lex.o comm.o util.o potp.o
SRCS=$(OBJS:%.o=%.c)

solaris:
	make CC=gcc CFLAGS="-DSYSV -Wall" ARCHLIBS="-lsocket -lnsl" fm

sunos:
	make CC=gcc fm

aix:
	make CC=cc CFLAGS="-DSYSV -gx" fm

fm: $(OBJS)
	$(CC) $(CFLAGS) -o fm $(OBJS) $(ARCHLIBS)

lex.o: lex.c
	$(CC) -c -o lex.o lex.c

$(OBJS): $(HEADERS)

install: fm
	install -o root -g other -m 755 -s fm $(INSTALLDIR)

clean:
	rm -f $(OBJS) lex.c fm
