mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 04:13:33 +08:00
Populate INCLUDE_DIRS with some likely candidates.
Implement __EXPORT and such for modules, as well as symbol visibility. Don't use UNZIP to point to unzip, as it looks there for arguments.
This commit is contained in:
+19
-5
@@ -75,6 +75,12 @@
|
||||
# the list should be formatted as:
|
||||
# <command>.<priority>.<stacksize>.<entrypoint>
|
||||
#
|
||||
# DEFAULT_VISIBILITY (optional)
|
||||
#
|
||||
# If not set, global symbols defined in a module will not be visible
|
||||
# outside the module. Symbols that should be globally visible must be
|
||||
# marked __EXPORT.
|
||||
# If set, global symbols defined in a module will be globally visible.
|
||||
#
|
||||
|
||||
#
|
||||
@@ -98,11 +104,6 @@ $(error No module makefile specified)
|
||||
endif
|
||||
$(info % MODULE_MK = $(MODULE_MK))
|
||||
|
||||
#
|
||||
# Get path and tool config
|
||||
#
|
||||
include $(PX4_BASE)/makefiles/setup.mk
|
||||
|
||||
#
|
||||
# Get the board/toolchain config
|
||||
#
|
||||
@@ -150,6 +151,19 @@ $(MODULE_COMMAND_FILES): $(GLOBAL_DEPS)
|
||||
$(Q) $(TOUCH) $@
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Adjust compilation flags to implement EXPORT
|
||||
################################################################################
|
||||
|
||||
ifeq ($(DEFAULT_VISIBILITY),)
|
||||
DEFAULT_VISIBILITY = hidden
|
||||
else
|
||||
DEFAULT_VISIBILITY = default
|
||||
endif
|
||||
|
||||
CFLAGS += -fvisibility=$(DEFAULT_VISIBILITY) -include $(PX4_INCLUDE_DIR)visibility.h
|
||||
CXXFLAGS += -fvisibility=$(DEFAULT_VISIBILITY) -include $(PX4_INCLUDE_DIR)visibility.h
|
||||
|
||||
################################################################################
|
||||
# Build rules
|
||||
################################################################################
|
||||
|
||||
+1
-1
@@ -71,5 +71,5 @@ LINK_DEPS += $(NUTTX_EXPORT_DIR)libs/libapps.a \
|
||||
|
||||
$(NUTTX_CONFIG_HEADER): $(NUTTX_ARCHIVE)
|
||||
@$(ECHO) %% Unpacking $(NUTTX_ARCHIVE)
|
||||
$(Q) $(UNZIP) -q -o -d $(WORK_DIR) $(NUTTX_ARCHIVE)
|
||||
$(Q) $(UNZIP_CMD) -q -o -d $(WORK_DIR) $(NUTTX_ARCHIVE)
|
||||
$(Q) $(TOUCH) $@
|
||||
|
||||
+21
-11
@@ -41,6 +41,7 @@
|
||||
# the number of duplicate slashes we have lying around in paths,
|
||||
# and is consistent with joining the results of $(dir) and $(notdir).
|
||||
#
|
||||
export PX4_INCLUDE_DIR = $(abspath $(PX4_BASE)/src/include)/
|
||||
export PX4_MODULE_SRC = $(abspath $(PX4_BASE)/src/modules)/
|
||||
export PX4_MK_DIR = $(abspath $(PX4_BASE)/makefiles)/
|
||||
export NUTTX_SRC = $(abspath $(PX4_BASE)/nuttx)/
|
||||
@@ -51,24 +52,33 @@ export IMAGE_DIR = $(abspath $(PX4_BASE)/Images)/
|
||||
export BUILD_DIR = $(abspath $(PX4_BASE)/Build)/
|
||||
export ARCHIVE_DIR = $(abspath $(PX4_BASE)/Archives)/
|
||||
|
||||
#
|
||||
# Default include paths
|
||||
#
|
||||
export INCLUDE_DIRS := $(PX4_MODULE_SRC) \
|
||||
$(PX4_INCLUDE_DIR)
|
||||
|
||||
# Include from legacy app/library path
|
||||
export INCLUDE_DIRS += $(NUTTX_APP_SRC)
|
||||
|
||||
#
|
||||
# Tools
|
||||
#
|
||||
MKFW = $(PX4_BASE)/Tools/px_mkfw.py
|
||||
UPLOADER = $(PX4_BASE)/Tools/px_uploader.py
|
||||
COPY = cp
|
||||
REMOVE = rm -f
|
||||
RMDIR = rm -rf
|
||||
GENROMFS = genromfs
|
||||
TOUCH = touch
|
||||
MKDIR = mkdir
|
||||
ECHO = echo
|
||||
UNZIP = unzip
|
||||
export MKFW = $(PX4_BASE)/Tools/px_mkfw.py
|
||||
export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py
|
||||
export COPY = cp
|
||||
export REMOVE = rm -f
|
||||
export RMDIR = rm -rf
|
||||
export GENROMFS = genromfs
|
||||
export TOUCH = touch
|
||||
export MKDIR = mkdir
|
||||
export ECHO = echo
|
||||
export UNZIP_CMD = unzip
|
||||
|
||||
#
|
||||
# Host-specific paths, hacks and fixups
|
||||
#
|
||||
SYSTYPE := $(shell uname -s)
|
||||
export SYSTYPE := $(shell uname -s)
|
||||
|
||||
ifeq ($(SYSTYPE),Darwin)
|
||||
# Eclipse may not have the toolchain on its path.
|
||||
|
||||
Reference in New Issue
Block a user