From ba19e5b92b99b08732cc1dcc5c675db6cdac4f36 Mon Sep 17 00:00:00 2001 From: zhangchao53 Date: Mon, 31 Jul 2023 18:45:10 +0800 Subject: [PATCH] porting superPi to vela,add makefile Signed-off-by: zhangchao53 --- testing/superpi/Kconfig | 21 +++++++++++++++ testing/superpi/Make.defs | 23 +++++++++++++++++ testing/superpi/Makefile | 54 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 testing/superpi/Kconfig create mode 100644 testing/superpi/Make.defs create mode 100644 testing/superpi/Makefile diff --git a/testing/superpi/Kconfig b/testing/superpi/Kconfig new file mode 100644 index 0000000000..56c848eb13 --- /dev/null +++ b/testing/superpi/Kconfig @@ -0,0 +1,21 @@ +config SUPERPI + tristate "SuperPI test" + default n + +if SUPERPI + +config SUPERPI_PROGNAME + string "Program Name" + default "pi_css5" + +config SUPERPI_STACKSIZE + int "SuperPI stack size" + default DEFAULT_TASK_STACKSIZE + +config SUPERPI_PRIORITY + int "Task PRIORITY" + default 100 + ---help--- + The higher the priority value, the lower the priority. + +endif diff --git a/testing/superpi/Make.defs b/testing/superpi/Make.defs new file mode 100644 index 0000000000..7e91f33a0c --- /dev/null +++ b/testing/superpi/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/superpi/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_SUPERPI),) +CONFIGURED_APPS += $(APPDIR)/testing/superpi +endif diff --git a/testing/superpi/Makefile b/testing/superpi/Makefile new file mode 100644 index 0000000000..a91c147243 --- /dev/null +++ b/testing/superpi/Makefile @@ -0,0 +1,54 @@ +############################################################################ +# apps/testing/superpi/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +SUPERPI_UNPACK = superpi +SUPERPI_URL = https://github.com/Fibonacci43/SuperPI/archive +SUPERPI_VERSION = main +SUPERPI_ZIP = $(SUPERPI_VERSION).zip +UNPACK ?= unzip -q -o + +CSRCS += superpi/fftsg_h.c +PROGNAME = $(CONFIG_SUPERPI_PROGNAME) +PRIORITY = $(CONFIG_SUPERPI_PRIORITY) +STACKSIZE = $(CONFIG_SUPERPI_STACKSIZE) +MODULE = $(CONFIG_SUPERPI) +MAINSRC = superpi/pi_fftcs.c + +$(SUPERPI_ZIP): + @echo "Downloading: $(SUPERPI_URL)/$(SUPERPI_ZIP)" + $(Q) curl -O -L $(SUPERPI_URL)/$(SUPERPI_ZIP) + +$(SUPERPI_UNPACK): $(SUPERPI_ZIP) + @echo "Unpacking: $(SUPERPI_ZIP) -> $(SUPERPI_UNPACK)" + $(Q) $(UNPACK) $(SUPERPI_ZIP) + $(Q) mv SuperPI-$(SUPERPI_VERSION) $(SUPERPI_UNPACK) + $(Q) touch $(SUPERPI_UNPACK) + +ifeq ($(wildcard $(SUPERPI_UNPACK)/.git),) +context:: $(SUPERPI_UNPACK) + +distclean:: + $(call DELDIR, $(SUPERPI_UNPACK)) + $(call DELFILE, $(SUPERPI_ZIP)) +endif + +include $(APPDIR)/Application.mk