diff --git a/pkg/ubasic/Makefile b/pkg/ubasic/Makefile new file mode 100644 index 0000000000..089d6d36da --- /dev/null +++ b/pkg/ubasic/Makefile @@ -0,0 +1,21 @@ +PKG_NAME=ubasic +PKG_URL=https://github.com/adamdunkels/ubasic +PKG_VERSION=cc07193c231e21ecb418335aba5b199a08d4685c +PKG_LICENSE=BSD-3-Clause + +UBASIC_MODULES = ubasic_tests +UBASIC_USEMODULE = $(filter $(UBASIC_MODULES),$(USEMODULE)) + +.PHONY: all ubasic ubasic% + +all: git-download ubasic + +make_module = "$(MAKE)" -f $(RIOTPKG)/ubasic/$(1).mk -C $(2) + +ubasic: $(UBASIC_USEMODULE) + $(call make_module,$@,$(PKG_BUILDDIR)) + +ubasic%: + $(call make_module,$@,$(PKG_BUILDDIR)) + +include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/ubasic/Makefile.include b/pkg/ubasic/Makefile.include new file mode 100644 index 0000000000..57eac2bbb2 --- /dev/null +++ b/pkg/ubasic/Makefile.include @@ -0,0 +1 @@ +INCLUDES += -I$(PKGDIRBASE)/ubasic diff --git a/pkg/ubasic/doc.txt b/pkg/ubasic/doc.txt new file mode 100644 index 0000000000..ed156eb0d7 --- /dev/null +++ b/pkg/ubasic/doc.txt @@ -0,0 +1,6 @@ +/** + * @defgroup pkg_ubasic uBASIC interpreter + * @ingroup pkg + * @brief A really tiny BASIC interpreter + * @see http://dunkels.com/adam/ubasic/ + */ diff --git a/pkg/ubasic/ubasic.mk b/pkg/ubasic/ubasic.mk new file mode 100644 index 0000000000..aeb9dd0dc3 --- /dev/null +++ b/pkg/ubasic/ubasic.mk @@ -0,0 +1,10 @@ +MODULE = ubasic + +# some toolchains complain about the usage of isdigit with a pointer in the +# tokenizer +CFLAGS += -Wno-char-subscripts + +SRC := tokenizer.c ubasic.c +NO_AUTO_SRC := 1 + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/ubasic/ubasic_tests.mk b/pkg/ubasic/ubasic_tests.mk new file mode 100644 index 0000000000..5c4d19d4d1 --- /dev/null +++ b/pkg/ubasic/ubasic_tests.mk @@ -0,0 +1,13 @@ +MODULE = ubasic_tests + +# tests.c has constants that may overflow on <32 bit platforms +CFLAGS += -Wno-overflow +# ubasic_init_peek_poke used in those tests is not exposed +CFLAGS += -Wno-implicit-function-declaration +# LLVM doesn't like ubasic_init_peek_poke due to strict prototyping either +CFLAGS += -Wno-strict-prototypes + +SRC := tests.c +NO_AUTO_SRC := 1 + +include $(RIOTBASE)/Makefile.base