###########################################################################
#
# Makefile for the Lomac LKM.
#  
###########################################################################

###########################################################################
# User-configurable variables
###########################################################################

# This variable will determine which arch-specific interface the Makefile
# will build.  We need to find a good way of setting this appropriately.
ARCH_DIR	= Arch/Linux2.2/

# some useful programs, should be OK as is.
#
LD 	= ld
RM	= rm -f

# linker flags, should be OK as is.
#
LDFLAGS	= -r


###########################################################################
# Rules that shouldn't need user-configuration.
###########################################################################

CORE_DIR	= Core/
CORE_FILE	= core.o
CORE		= $(CORE_DIR)$(CORE_FILE)

ARCH_FILE	= arch.o
ARCH		= $(ARCH_DIR)$(ARCH_FILE)

TARGET	= lomac_mod.o
OBJS	= $(CORE) $(ARCH) 

all : $(TARGET)

$(CORE) :
	cd $(CORE_DIR) ; make

$(ARCH) :
	cd $(ARCH_DIR) ; make

$(TARGET) : $(OBJS)
	$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS)



#
# Make clean rule, for convenience...
#

clean :
	cd $(CORE_DIR) ; make clean
	cd $(ARCH_DIR) ; make clean
	$(RM) $(TARGET)


