#
# makefile for misc functions
#

PROGS=hostname
CFLAGS=$(DEFS) -O6 -fomit-frame-pointer -I../../include -L../../lib/aout

all: $(PROGS)

clean:
	rm -f $(PROGS) *.o

hostname: hostname.c
	$(CC) $(CFLAGS) -o hostname hostname.c -lbasis

install: hostname
	install -d $(DESTDIR)/bin
	install -d $(DESTDIR)/usr/man/man1
	install -o man -g man -m 444 -c hostname.1 $(DESTDIR)/usr/man/man1
	echo ".so man1/hostname.1" > $(DESTDIR)/usr/man/man1/domainname.1
	echo ".so man1/hostname.1" > $(DESTDIR)/usr/man/man1/ypdomainname.1
	install -o 0 -g 0 -m 511 -c -s hostname $(DESTDIR)/bin
	ln -f $(DESTDIR)/bin/hostname $(DESTDIR)/bin/domainname
	ln -f $(DESTDIR)/bin/hostname $(DESTDIR)/bin/ypdomainname
