You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7 KiB

.PHONY: build run interactive clean test trace demo info
# Build Docker image
build:
docker build -t lab9-task2-prolog .
# Run Prolog with predicates (show basic info and exit)
run: build
docker run --rm -v $(PWD):/app lab9-task2-prolog swipl -g "consult('predicates.pl'), write('=== LAB9 TASK2 PREDICATES ==='), nl, task_info, halt"
# Interactive Prolog session
interactive: build
docker run -it --rm -v $(PWD):/app lab9-task2-prolog swipl predicates.pl
# Run test queries
test: build
docker run --rm -v $(PWD):/app lab9-task2-prolog swipl -g "consult('predicates.pl'), consult('tests.pl'), run_tests, halt"
# Run with tracing enabled
trace: build
docker run --rm -v $(PWD):/app lab9-task2-prolog swipl -g "consult('predicates.pl'), trace, test_all_predicates, notrace, halt"
# Show basic info about task2
info: build
docker run --rm -v $(PWD):/app lab9-task2-prolog swipl -g "consult('predicates.pl'), write('=== TASK2 INFO ==='), nl, task_info, show_examples, halt"
# Run demo
demo: build
docker run --rm -v $(PWD):/app lab9-task2-prolog swipl -g "consult('predicates.pl'), consult('demo.pl'), demo, halt"
# Clean Docker images
clean:
docker rmi lab9-task2-prolog || true
# Help
help:
@echo "Available commands for lab9 task2:"
@echo " make build - Build Docker image"
@echo " make run - Run and show basic predicates info"
@echo " make info - Show detailed task2 information"
@echo " make demo - Run demonstration queries"
@echo " make test - Run test queries"
@echo " make interactive - Start interactive Prolog session"
@echo " make trace - Run with tracing enabled"
@echo " make clean - Clean Docker images"