# Endianness of the native system (BIGENDIAN, LITTLEENDIAN)
ENDIAN=-DLITTLEENDIAN

CC=gcc

CFLAGS= -g -Wall -O2 $(CONFIG)
LIBRARIES= -lm
OBJS = readelf.o mem.o main.o run.o syscalls.o print.o cache.o memcache.o
BUILTINS=

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

simulate: 	$(OBJS)
	$(CC) -g -o simulate $(OBJS) $(LIBRARIES)

run.o:		run.c main.h
readelf.o:	readelf.c main.h
main.o:		main.c main.h
mem.o:		mem.c main.h
syscalls.o:	syscalls.c main.h
print.o:	print.c main.h
cache.o:	cache.c main.h
memcache.o:	memcache.c main.h

clean:
	rm -f *.o *~ core

clobber:	clean
	rm -f simulate
