# This is the makefile for the UNIX/QDOS-version of the LTOOLS

# This is the compiler to use, only GCC is supported
CC=gcc

# This is the operating system, only LINUX and SOLARIS (x86) are supported
OS=LINUX


# No need to change anything beyond this line ##########################################
LKFLAGS=
CCFLAGS= -DUNIX -D$(OS) -DSANITY_CHECKS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNEWOUT

INCLUDES=ldir.h  proto.h  ext2.h  UNIXdisk.h DOSdisk.h makefile.unx

OBJS= main.o readdisk.o dir.o super.o inode.o group.o util.o rfs.o

ldir:	$(OBJS) $(INCLUDES)
		$(CC) $(LKFLAGS) -o ldir $(OBJS)
	        mv -f ldir      ../bin.unx
	        cp -f lchange   ../bin.unx
	        cp -f lread     ../bin.unx
	        cp -f lwrite    ../bin.unx
	        cp -f ldel      ../bin.unx
	        cp -f lren      ../bin.unx
		cp -f lmkdir    ../bin.unx
		cp -f lln       ../bin.unx
		cp -f ldrive    ../bin.unx
		cp -f lcd       ../bin.unx
		cp -f rfstool/rfstool   ../bin.unx
		chmod 755       ../bin.unx/l*

readdisk.o:	UNIXdisk.h
	$(CC) $(CCFLAGS) -c readdisk.c

.c.o:
	$(CC) $(CCFLAGS) -c $<

clean:
	rm -f *.o
	rm -f ldir
	rm -f *~

save:
	zip -9 lxr *.c *.h makefile.*
	cp lxr.zip ..

