# Programe su tarea en el archivo disco.c
# Para revisar las opciones de compilacion y ejecucion,
# ingrese en el terminal el comando: make
# Este directorio ya incluye psystem64-alfa4

NSYSTEM=nsystem64-beta3
LIBNSYS= $(NSYSTEM)/lib/libnSys.a

# Con opciones de debugging
DEF=
OPT=-g
INCLUDE=-I$(NSYSTEM)/include -I$(NSYSTEM)/src
CFLAGS=$(OPT) $(DEF) -Wall -pedantic -std=c99 $(INCLUDE)
LDFLAGS=-g
LDLIBS=$(LIBNSYS)

VGFLAGS= --leak-check=full --show-leak-kinds=all --track-origins=yes

MOPT=--no-print-directory

all:
	@cat README.txt

test-disco: test-disco.o $(LIBNSYS)

$(LIBNSYS):
	cd $(NSYSTEM)/src ; make OPT=$(OPT)

test-disco.o: $(NSYSTEM)/include/nSystem.h $(NSYSTEM)/include/fifoqueues.h

run-O:
	@./check.sh O
	@make $(MOPT) OPT=-O "LDFLAGS=" test-disco
	./test-disco

run-g:
	@./check.sh g
	@make $(MOPT) test-disco
	./test-disco

ddd:
	@./check.sh g
	@make $(MOPT) test-disco
	@( sleep 1; cat .ddd.txt ) &
	ddd test-disco

clean:
	rm -f *.o test-disco .last.txt
	@( cd $(NSYSTEM)/src ; make clean )
