TOP	= ../..
HDRS	= $(TOP)/crash.h $(TOP)/def.h
CSRCS	= table.c dis.c pte.c dis.c trace.c

include	$(TOP)/Rules.make

OBJS	= $(CSRCS:.c=.o)
CFLAGS	= $(CDEBUG) -I$(TOP) -I$(INCDIR)
TARGET	= libarch.a
DEPFILE	= Makefile.dep

all:	$(CSRCS) $(TARGET)

asm.h:
	/bin/ln -s ../i386/asm.h .

dis.c:	asm.h
	/bin/ln -s ../i386/dis.c .

trace.c:
	/bin/ln -s ../i386/trace.c .

$(TARGET): $(OBJS)
	$(AR) cr $(TARGET) $(OBJS)

$(OBJS): $(HDRS)

clean:
	/bin/rm -f $(OBJS) $(TARGET) $(DEPFILE) *~ *.swp asm.h dis.c trace.c

depend: $(CSRCS)
	makedepend -f- -I$(TOP) -I$(INCDIR) $(CSRCS) > $(DEPFILE)

ifeq ($(wildcard $(DEPFILE)),$(DEPFILE))
include $(DEPFILE)
endif
