# # Toplevel makefile for the mipsi simulator for use with CSE 451. # # # Running "make" will compile mipsi-orig, mipsi, and the sample # user level applications. You can also selectively make each target # as described below. # # To make the default version of mipsi (the one that doesn't have VM), # use "make mipsi-orig". # # To make the version of mipsi that you have to implement, # use "make mipsi". # # To make the default applications, use "make apps". # # To remove all object files and executables so that you can rebuild # from scratch, use "make clean" # CC = gcc LFLAGS = -g LIBS = -lm LIB = lib MINITHREAD = minithread MT-OS-DIR = mt-os MIPSI-ORIG = mipsi-orig-src/mipsi-orig MIPSI = mipsi-src/mipsi # Object files and libraries shared by mipsi-orig and mipsi. SHARED_OBJS = $(MT-OS-DIR)/mt_os.o $(MT-OS-DIR)/handle.o \ $(LIB)/sys.o $(MT-OS-DIR)/mt_thread.o $(LIB)/switch.o \ $(LIB)/minithread_public.o \ $(LIB)/libmt.a $(LIB)/clock.o # Object files and libraries needed to build mipsi-orig. MIPSI-ORIG-OBJS = $(SHARED_OBJS) $(LIB)/libmipsi-orig.a # Object files and libraries needed to build mipsi MIPSI-OBJS = $(SHARED_OBJS) $(MT-OS-DIR)/mt_vm.o $(LIB)/libmipsi.a # By default, build everything. all: mipsi-orig mipsi apps # How to build mipsi-orig. mipsi-orig: $(MIPSI-ORIG-OBJS) $(CC) $(LFLAGS) -o $(MIPSI-ORIG) $(MIPSI-ORIG-OBJS) $(LIBS) # How to build mipsi. mipsi: $(MIPSI-OBJS) $(CC) $(LFLAGS) -o $(MIPSI) $(MIPSI-OBJS) $(LIBS) # How to build the user-level applications. apps: cd USER; pwd; make; # Clean up all object files and executables in preparation for rebuilding # from scratch. clean: rm -f *~ $(MIPSI-ORIG) $(MIPSI) cd USER; pwd; make clean cd minithread; pwd; make clean cd mipsi-orig-src; pwd; make clean cd mipsi-src; pwd; make clean cd mt-os; pwd; make clean