#
# Makefile for the linux HFS filesystem module
#
# Copyright 1995 by Paul H. Hargrove
# This file may be distributed under the terms of the GPL.
#

CC	= gcc -D__KERNEL__ -DMODULE 

# Comment out the following line to compile under Linux 1.3.x
COMPAT	= -DLINUX_1_2

#CFLAGS	= -Wall -Wstrict-prototypes -O2 -m386 $(COMPAT) $(DEBUG_FLAGS)
CFLAGS	= -Wall -Wstrict-prototypes -O2 -m486 $(COMPAT) $(DEBUG_FLAGS)

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

OBJS	= btree.o catalog.o dir.o extent.o file.o inode.o meta.o string.o \
	  super.o trans.o

SRCS	= $(OBJS:.o=.c)

ifeq (.depend,$(wildcard .depend))
default: hfs.o
include .depend
else
default:
	@echo ==== Making dependency file... ====
	@$(MAKE) depend
	@echo ==== You should ignore the error that follows, and restart your make. ====
	@false
endif

hfs.o: $(OBJS)
	$(LD) -r -o $@ $(OBJS)
	size $@

depend dep:
	$(CPP) -M $(SRCS) > .depend

clean:
	rm -f $(OBJS) hfs.o a.out core
