Makefile 2.86 KB
#!gmake

ifndef SIMTOOLS
SIMTOOLS = .
endif

include makedefs

.PHONY:	simos simos64 simos-x86 apps solo soloclean clean headers

default: simos

exports: simos
	echo exports
	(cd cpus/simbb; ${MAKE} $${RULE:=$@})

simos-x86:
	@echo "Building simos-x86"
	(cd caches && $(MAKE) simos-x86)
	(cd memsystems && $(MAKE) simos-x86)
	(cd common && $(MAKE) simos-x86)
	(cd devices && $(MAKE) simos-x86)
	(cd cpus-x86 && $(MAKE) simos-x86)

simos:
	(cd caches && $(MAKE) )
	(cd memsystems/ && $(MAKE))
	(cd common/ && $(MAKE))
	(cd devices/ && $(MAKE))
	(cd cpus && $(MAKE))
	[ -L src ] || ln -sf . src

simos64:
	@echo "Building simos64"
	(cd caches && $(MAKE) simos64)
	(cd memsystems && $(MAKE) simos64)
	(cd common && $(MAKE) simos64)
	(cd devices && $(MAKE) simos64)
	(cd cpus && $(MAKE) simos64)

apps:
	(cd apps/simos && $(MAKE) all)
	(cd apps/unix && $(MAKE) all)

solo:
	@echo "Building solo: USE_FLASHLITE = $(USE_FLASHLITE)"
	(cd caches && $(MAKE) solo)
	(cd common && $(MAKE) solo)
	(cd memsystems && $(MAKE) solo)
	(cd cpus && $(MAKE) solo-mipsy)

simos-aa:
	@echo "Building simos-aa (alpha on alpha)"
	(cd caches && $(MAKE) simos-aa )
	(cd memsystems && $(MAKE) simos-aa)
	(cd common && $(MAKE) simos-aa)   
	(cd devices && $(MAKE) simos-aa)
	(cd cpus-alpha/gamma && $(MAKE) simos-aa)
	(cd cpus-alpha/delta && $(MAKE) simos-aa)
	(cd cpus-alpha/alpha-shared && $(MAKE) simos-aa)
	(cd cpus-alpha/simos && $(MAKE) simos-aa)

solo-aint:
	@echo "Building solo-aint. Only on alpha"
	(cd common && $(MAKE) solo-aint)
	(cd cpus-alpha/gamma && $(MAKE) solo-aint)
	(cd cpus-alpha/solo-aint && $(MAKE) solo-aint)

solo-aintclean:
	@echo "Cleaning. Only on alpha"
	(cd common && $(MAKE) clean)
	(cd cpus-alpha/gamma && $(MAKE) clean)
	(cd cpus-alpha/solo-aint && $(MAKE) clean)

soloclean:
	(cd cpus/mipsy && $(MAKE) clean)
	(cd caches && $(MAKE) clean)
	(cd common && $(MAKE) clean)
	(cd memsystems && $(MAKE) clean)

dist: clobber
	@echo "Building a SimOS distribution - simos-`date +%m-%d-%y`.tar.gz"
	(cd ..; tar cvf simos-`date +%m-%d-%y`.tar simulation)

clean:
	-(cd cpus && $(MAKE) clean)
	(cd cpus-alpha && $(MAKE) clean)
	-(cd cpus-x86  && $(MAKE) clean)
	(cd caches && $(MAKE) clean)
	(cd memsystems && $(MAKE) clean)
	(cd common && $(MAKE) clean)
	(cd devices && $(MAKE) clean)
	@if [ -d cpus/solo ]; then (cd cpus/solo && $(MAKE) clean); fi

clobber:
	(cd cpus && $(MAKE) clobber)
	(cd cpus-alpha && $(MAKE) clobber)
#	(cd cpus-x86  && $(MAKE) clobber)
	(cd caches && $(MAKE) clobber)
	(cd memsystems && $(MAKE) clobber)
	(cd common && $(MAKE) clobber)
	(cd devices && $(MAKE) clobber)
	@if [ -d cpus/solo ]; then (cd cpus/solo && $(MAKE) clobber); fi

###
### fast paths for SimOS
###
mipsy: 
	(cd cpus/mipsy && $(MAKE))
	(cd simos && $(MAKE) CPUSIM=$(CPUSIM))

symbols: 
	(cd common/symbols && $(MAKE))
	(cd simos && $(MAKE) CPUSIM=$(CPUSIM))

embra:
	(cd cpus/embra && $(MAKE) )
	(cd simos && $(MAKE) CPUSIM=$(CPUSIM))