
AR = ar clq
LD = ld
LN = ln -sf
RANLIB = ranlib
RM = rm -f
CC = gcc  
_NULLCMD_ = @ echo -n
CCOPTIONS = 
CXX = g++
CXXOPTIONS =
DEPEND = mkdep

TOP = ../..
PARHELIUX = $(TOP)/../..

INCLUDES  = -IInclude -I$(LNXTREE) -I$(TOP)
DEFINES = -D__NO_VERSION__

SUBDIRS = 

CFLAGS    += $(MODCFLAGS) $(DEFINES)

# **** Parse config file

include $(TOP)/config.mk

ifeq ($(CFG_DEBUG), YES)
CFLAGS += -DDEBUG -g -O
else
CFLAGS += -O3
endif

# **** Sources and rules

SRCS = MtxCpu.c MtxCs.c MtxIo.c MtxMem.c MtxMsr.c MtxPci.c MtxTimer.c MtxMap.c MtxDte.c MtxLdt.c MtxLdtr.c MtxGdt.c MtxGdtr.c MtxDbg.c
OBJS = MtxCpu.o MtxCs.o MtxIo.o MtxMem.o MtxMsr.o MtxPci.o MtxTimer.o MtxMap.o MtxDte.o MtxLdt.o MtxLdtr.o MtxGdt.o MtxGdtr.o MtxDbg.o

all: mtxvxd.a

mtxvxd.a: Makefile $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RANLIB) $@
	$(_NULLCMD_)

mtxvxd.o: Makefile $(OBJS)
	$(LD) -r $(OBJS) -o $@
	

%.o: %.c
	$(CC) $(WARNINGS) $(CFLAGS) $(INCLUDES) -c $< -o $@

%.o: %.cpp
	$(CXX) $(WARNINGS) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
        
clean::
	$(RM) *.o *.a

depend:
	$(DEPEND) $(INCLUDES) $(DEFINES) $(CPPFLAGS) $(wildcard *.cpp) $(wildcard *.c)
