#IMPORTANT: # This Makefile does not work with /bin/make, only with # /usr/local/gnu/bin/make. # Change your path if needed. # # Compiler and options: CC = gcc BINARY = simulator CPPFLAGS = -g -Wall CFLAGS = # Sources: CFILES := $(wildcard *.c) OFILES := $(patsubst %.c,%.o,$(CFILES)) # Make automatic dependency files (*.d): %.d: %.c $(SHELL) -ec 'gcc -MM $(CPPFLAGS) $< | sed '\''s/$*\.o/& $@/'\'' > $@' $(BINARY): $(OFILES) gcc -o $(BINARY) $(OFILES) include $(CFILES:.c=.d) all: $(BINARY) run: all ./$(BINARY) < ./rfac.i clean: -rm -f *.o $(BINARY) dist-clean: clean -rm -f *.d help: @echo "Usage:" @echo "make clean = remove binary files" @echo "make dist-clean = remove build files as well" @echo "make run = build, run simulator" report: @rm -f opdr2b.ps* @a2ps --footer="Rick van der Zwet - CA assigment2b - 0433373" -P \ file --highlight-level=normal --toc --output=opdr2b.ps --sides=1 \ Makefile README.txt alu.h constant.h control.h datapath.h imm.h \ memory.h sim.h alu.c constant.c control.c datapath.c imm.c memory.c \ sim.c rfac.i rfac.s