Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ endif
CFLAGS += ${INCDIR_PREFIX}"$(APPDIR)$(DELIM)include"
CXXFLAGS += ${INCDIR_PREFIX}"$(APPDIR)$(DELIM)include"

# EXPORTED_INCLUDES lists include directories that must be available to
# applications built out of tree from the NuttX export package. Each
# entry is prefixed with ${INCDIR_PREFIX} (i.e. -I<dir>) and is added
# to CFLAGS/CXXFLAGS so that it takes effect in the in-tree build as
# well. The content of the listed directories is copied to the include
# directory of the export package by the export target in apps/Makefile.
# Components should append their public include directories in their
# Make.defs.

CFLAGS += $(EXPORTED_INCLUDES)
CXXFLAGS += $(EXPORTED_INCLUDES)

NUTTXLIB ?= $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging)

# SPLITVARIABLE - Split long variables into specified batches
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ ifneq ($(BUILTIN_REGISTRY),)
done
endif
endif
$(Q) for inc in $(EXPORTED_INCLUDES) ; do \
inc=$${inc#"$(INCDIR_PREFIX)"}; \
if [ -d "$${inc}" ]; then \
mkdir -p "${EXPORTDIR}"$(DELIM)include || exit 1; \
cp -Rf "$${inc}"$(DELIM). "${EXPORTDIR}"$(DELIM)include || exit 1; \
fi \
done
endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is right srat, but it seems that there needs to be some more work because

CFLAGS += -DMWCONFIG_FILE='"mwconfig.nuttx"'

from apps/graphics/microwindows/Make.defs is not propagated some CFLAGS or similar into nuttx-export/scripts/Make.defs.

But this correction can go to another pull round by you or us (I would discuss with @michallenc ).


.depdirs: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_depend)
Expand Down
28 changes: 28 additions & 0 deletions examples/nanoxcalc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
config EXAMPLES_NANOXCALC
tristate "Nano-X calculator example"
default n
depends on MICROWINDOWS_NANOX && LIBC_FLOATINGPOINT
---help---
Enable the Nano-X calculator example application. It is a
port of the nxcalc demo from Microwindows which connects to
the Nano-X server started by examples/nanoxterm and shows
a calculator keypad operated by the mouse or keyboard.

if EXAMPLES_NANOXCALC

config EXAMPLES_NANOXCALC_PROGNAME
string "Program name"
default "nanoxcalc"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

config EXAMPLES_NANOXCALC_PRIORITY
int "Nano-X calculator task priority"
default 100

config EXAMPLES_NANOXCALC_STACKSIZE
int "Nano-X calculator stack size"
default 16384

endif
25 changes: 25 additions & 0 deletions examples/nanoxcalc/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/examples/nanoxcalc/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# 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_EXAMPLES_NANOXCALC),)
CONFIGURED_APPS += $(APPDIR)/examples/nanoxcalc
endif
35 changes: 35 additions & 0 deletions examples/nanoxcalc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
############################################################################
# apps/examples/nanoxcalc/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# 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

PROGNAME = $(CONFIG_EXAMPLES_NANOXCALC_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_NANOXCALC_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_NANOXCALC_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_NANOXCALC)

# Port of the upstream nxcalc demo (src/demos/nanox/nxcalc.c)
MAINSRC = nxcalc.c
CFLAGS += -Wno-undef


include $(APPDIR)/Application.mk
Loading
Loading