# Makefile for usermount and userumount and userfdformat

CC = gcc
CFLAGS = -Wall -O2
MANDIR = /usr/man/man1
CATDIR = /usr/man/cat1
INSTDIR = /usr/bin
INSTALL = install -c
NROFF = nroff

mountobj = usermount.o
umountobj = userumount.o
formatobj = userfdformat.o

all:	usermount userumount userfdformat

mount: $(mountobj)
	$(CC) -o usermount $(mountobj)

umount:	$(umountobj)
	$(CC) -o userumount $(umountobj)

userfdformat: $(formatobj)
	$(CC) -o userfdformat $(formatobj)

clean:  ALWAYS
	rm -f *.o core

real-clean: clean
	rm -f a.out usermount userumount userfdformat

install-man:
	$(INSTALL) usermount.1 $(MANDIR)/usermount.1
	$(INSTALL) userumount.1 $(MANDIR)/userumount.1
	$(INSTALL) userfdformat.1 $(MANDIR)/userfdformat.1

install: usermount userumount userfdformat
	$(INSTALL) usermount $(INSTDIR)/usermount
	$(INSTALL) userumount $(INSTDIR)/userumount
	$(INSTALL) userfdformat $(INSTDIR)/userfdformat
	chown root $(INSTDIR)/usermount $(INSTDIR)/userumount $(INSTDIR)/userfdformat 
	chmod u+s  $(INSTDIR)/usermount $(INSTDIR)/userumount $(INSTDIR)/userfdformat

ALWAYS:
