# Makefile for edefrag, the Linux file system defragmenter
#
# Copyright (C) Stephen Tweedie, 1992
# This file may be distributed under the terms of the GNU
# General Public License. 
# Modified for ST/Minxfs by S N Henson. 1993.

CC = gcc

#Recommended compiler options
CFLAGS = -Wall -I.
LDFLAGS =

PROGS = defrag.ttp defrag2.ttp

all:	$(PROGS)

defrag.ttp:	defrag.o minix.o misc.o buffers.o portst.o hdio.o tinyxhdi.o
	gcc $(LDFLAGS) -o $@ $^

defrag2.ttp:	defrag2.o minix2.o buffers2.o misc.o portst.o hdio.o tinyxhdi.o
	gcc $(LDFLAGS) -o $@ $^

defrag.o:	defrag.c
	gcc $(CFLAGS) -DMINIXFS -c -o $@ $<

buffers.o:	buffers.c
	gcc $(CFLAGS) -DMINIXFS -c -o $@ $<

minix.o:	minix.c
	gcc $(CFLAGS) -DMINIXFS -c -o $@ $<

defrag2.o:	defrag.c
	gcc $(CFLAGS) -DMINIXFS -DMINIX_V2 -c -o $@ $<

buffers2.o:	buffers.c
	gcc $(CFLAGS) -DMINIXFS -DMINIX_V2 -c -o $@ $<

minix2.o:	minix.c
	gcc $(CFLAGS) -DMINIXFS -DMINIX_V2 -c -o $@ $<

hdio.o:		hdio.c hdio.h
	gcc $(CFLAGS) -DSUPER_CALL -c -o hdio.o hdio.c

tinyxhdi.o:	tinyxhdi.c
	gcc $(CFLAGS) -DTINY_XHDI -DSUPER_CALL -c -o tinyxhdi.o tinyxhdi.c

clean:
	rm -f *.o

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

