#   Fixperms - set and get permissions on lists of files
#   Copyright (C) 1993  Anthony Edward Hall (aehall@seattleu.edu)
#
#   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.
#
# Makefile for fixperms

CC		=	g++
CCFLAGS		=	-O6 -Wall -m486
LDFLAGS		=	-s
OBJS		=	fixperms.o getperms.o setperms.o file.o

fixperms:	Makefile ${OBJS}
		${CC} ${CCFLAGS} ${LDFLAGS} -o fixperms ${OBJS}

fixperms.o:	fixperms.cc fixperms.h version.h Makefile
		${CC} ${CCFLAGS} ${LDFLAGS} -c fixperms.cc

setperms.o:	setperms.cc fixperms.h Makefile
		${CC} ${CCFLAGS} ${LDFLAGS} -c setperms.cc

getperms.o:	getperms.cc fixperms.h Makefile
		${CC} ${CCFLAGS} ${LDFLAGS} -c getperms.cc

file.o:		file.cc file.h Makefile
		${CC} ${CCFLAGS} ${LDFLAGS} -c file.cc

clean:
		@rm -f fixperms *.o core

install:	fixperms Makefile ${OBJS} fixperms.8 fixperms.perm
		@echo "Making /usr/lib/perms"
		@mkdir -p /usr/lib/perms
		@echo "Copying fixperms to /etc/"
		@cp -f ./fixperms /etc
		@echo "Copying *.perm /usr/lib/perms"
		@cp -f ./*.perm /usr/lib/perms
		@echo "Creating /usr/man/cat8/fixperms.8"
		@rm -f /usr/man/cat8/fixperms.8* /usr/man/man8/fixperms.8*
		@groff -man fixperms.8 > /usr/man/cat8/fixperms.8
		@compress /usr/man/cat8/fixperms.8
		@/etc/fixperms fixperms -v

