Files
Toy/makefile
Kayne Ruse be7e4ddd18 Reworked the tests, read more
I've brought the tests up to scratch, except for compounds im the
parser, because I'm too damn tired to do that over SSH. It looks like
collections are right-recursive, whixh was unintended but still works
just fine.

I've also added the '--verbose' flag to the repl to control the
debugging output.

Several obscure bugs have been fixed, and comments have been tweaked.

Mustfail tests are still needed, but that's a low priority. See #142.

Fixed #151
2024-11-12 22:04:07 +11:00

93 lines
2.0 KiB
Makefile

#compiler settings reference
#CC=gcc
#CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2
#LIBS+=-lm
#LDFLAGS+=
#directories
export TOY_SOURCEDIR=source
export TOY_REPLDIR=repl
export TOY_CASESDIR=tests/cases
export TOY_INTEGRATIONSDIR=tests/integrations
export TOY_OUTDIR=out
export TOY_OBJDIR=obj
#targets
#all:
.PHONY: source
source:
$(MAKE) -C source -k
.PHONY: repl
repl: source
$(MAKE) -C repl -k
#various kinds of available tests
.PHONY: tests
tests: clean test-cases test-integrations
#.PHONY: test-all
#test-all: clean test-cases test-integrations
.PHONY: test-cases
test-cases:
$(MAKE) -C $(TOY_CASESDIR) -k
.PHONY: test-integrations
test-integrations:
$(MAKE) -C $(TOY_INTEGRATIONSDIR) -k
#same as above, but with GDB
.PHONY: tests-gdb
tests-gdb: clean test-cases-gdb test-integrations-gdb
.PHONY: test-cases-gdb
test-cases-gdb:
$(MAKE) -C $(TOY_CASESDIR) gdb -k
.PHONY: test-integrations-gdb
test-integrations-gdb:
$(MAKE) -C $(TOY_INTEGRATIONSDIR) gdb -k
#TODO: mustfail tests
#util targets
$(TOY_OUTDIR):
mkdir $(TOY_OUTDIR)
$(TOY_OBJDIR):
mkdir $(TOY_OBJDIR)
#util commands
.PHONY: clean
clean:
ifeq ($(shell uname),Linux)
find . -type f -name '*.o' -delete
find . -type f -name '*.a' -delete
find . -type f -name '*.exe' -delete
find . -type f -name '*.dll' -delete
find . -type f -name '*.lib' -delete
find . -type f -name '*.so' -delete
find . -type f -name '*.dylib' -delete
find . -type d -name 'out' -delete
find . -type d -name 'obj' -delete
else ifeq ($(OS),Windows_NT)
$(RM) *.o *.a *.exe *.dll *.lib *.so *.dylib
$(RM) out
$(RM) obj
else ifeq ($(shell uname),Darwin)
find . -type f -name '*.o' -delete
find . -type f -name '*.a' -delete
find . -type f -name '*.exe' -delete
find . -type f -name '*.dll' -delete
find . -type f -name '*.lib' -delete
find . -type f -name '*.so' -delete
find . -type f -name '*.dylib' -delete
find . -type d -name 'out' -delete
find . -type d -name 'obj' -delete
else
@echo "Deletion failed - what platform is this?"
endif