# Makefile for mount and umount

CC = gcc
CFLAGS = -Wall -ansi -O
MANDIR = /usr/man/man8
CATDIR = /usr/man/cat8
INSTDIR = /etc
INSTALL = install -c
NROFF = nroff

mountobj = mount.o
umountobj = umount.o

all:	mount umount

mount: $(mountobj)
	$(CC) -o mount -s -static $(mountobj)

umount:	$(umountobj)
	$(CC) -o umount -s -static $(umountobj)

clean:  ALWAYS
	rm -f *.o core

real-clean: clean
	rm -f a.out mount umount

install-man:
	$(INSTALL) mount.8 $(MANDIR)
	$(NROFF) -man mount.8 > $(CATDIR)/mount.8
	$(INSTALL) umount.8 $(MANDIR)
	$(NROFF) -man umount.8 > $(CATDIR)/umount.8

install: mount umount
	$(INSTALL) mount $(INSTDIR)/mount
	$(INSTALL) umount $(INSTDIR)/umount
	chown root $(INSTDIR)/mount $(INSTDIR)/umount 
	chmod u+s  $(INSTDIR)/mount $(INSTDIR)/umount 

ALWAYS:
