CFLAGS= -g -Wall -pedantic -std=c99
LDFLAGS= -g

all: test-stack.rom

test-stack: test-stack.o stack.o asm.o
test-stack.o stack.o: asm.h inst.h
test-stack.rom: test-stack
	./test-stack test-stack.rom

sizemem.o fact.o hello2.o hello.o term.o count-hex.o asm.o: asm.h inst.h

ucode.rom map.rom inst.h: ctlsigen
	./ctlsigen

count-hex: count-hex.o asm.o

count-hex.rom: count-hex
	./count-hex count-hex.rom

term: term.o asm.o

term.rom: term
	./term term.rom

rev: rev.o asm.o

rev.rom: rev
	./rev rev.rom

hello: hello.o asm.o

hello.rom: hello
	./hello hello.rom

hello2: hello2.o asm.o

hello2.rom: hello2
	./hello2 hello2.rom

fact: fact.o asm.o

fact.rom: fact
	./fact fact.rom

sizemem: sizemem.o asm.o

sizemem.rom: sizemem
	./sizemem sizemem.rom

test-ldwpp: test-ldwpp.o asm.o

test-ldwpp.rom: test-ldwpp
	./test-ldwpp test-ldwpp.rom

fib: fib.o asm.o

fib.rom: fib
	./fib fib.rom

juego: juego.o asm.o

juego.rom: juego
	./juego juego.rom

test-swap: test-swap.o asm.o

test-swap.rom: test-swap
	./test-swap test-swap.rom

clean:
	rm -f *.o *.rom ctlsigen count-hex term rev hello hello2 fact sizemem test-ldwpp fib juego test-swap test-stack
