##
## Copyright (c) 2000, 2001, Amnon BARAK (amnon@cs.huji.ac.il).
## All rights reserved.
##
## THIS SOFTWARE IS PROVIDED IN ITS "AS IS" CONDITION, WITH NO WARRANTY
## WHATSOEVER. NO LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING
## FROM THE USE OF THIS SOFTWARE WILL BE ACCEPTED.
##
##
## Author(s): Ariel Eizenberg
##

include ../../Rules.make

CFLAGS  += -O
LDFLAGS += -s

all: tune mtune tunepass tune_kernel prep_tune tune.1

tune: tune.o testloop.o
	$(CC) $(LDFLAGS) -o tune tune.o testloop.o

mtune: mtune.o testloop.o
	$(CC) $(LDFLAGS) -o mtune mtune.o testloop.o

tunepass: tunepass.o
	$(CC) -o tunepass tunepass.o

testloop.o: testloop.s

tune_kernel: tune_kernel.sh
	cp -f tune_kernel.sh tune_kernel
	chmod 550 tune_kernel

prep_tune: prep_tune.sh
	cp -f prep_tune.sh prep_tune
	chmod 550 prep_tune

tune.1: tune.man
	cp tune.man tune.1
#	groff -mtty-char -Tascii -man tune.man > tune.1

install: all
	$(INSTALL) -m 755 -d $(ROOT)/sbin
	$(INSTALL) -s tune $(ROOT)/sbin
	$(INSTALL) -s mtune $(ROOT)/sbin
	$(INSTALL) -s tunepass $(ROOT)/sbin
	$(INSTALL) tune_kernel $(ROOT)/sbin
	$(INSTALL) prep_tune $(ROOT)/sbin
	$(INSTALL) -d -m 0755 $(PREFIX)/man/man1
	$(INSTALL) -c -m 444 tune.1 $(PREFIX)/man/man1

clean:
	$(CLEANALL)
	rm -f tune mtune tunepass tune_kernel prep_tune tune.1

