aboutsummaryrefslogtreecommitdiff
path: root/makefiles
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-04-06 00:51:59 -0700
committerpx4dev <px4@purgatory.org>2013-04-06 00:51:59 -0700
commit8b9b41fd507b9d2a62e2b0e3c5df398a489f7606 (patch)
tree7d741711dce24aea4d6d5a6f198dbe9001c877ea /makefiles
parent2e5809d051121cbb73d92bf98be0a2952f1dbd2e (diff)
downloadpx4-firmware-8b9b41fd507b9d2a62e2b0e3c5df398a489f7606.tar.gz
px4-firmware-8b9b41fd507b9d2a62e2b0e3c5df398a489f7606.tar.bz2
px4-firmware-8b9b41fd507b9d2a62e2b0e3c5df398a489f7606.zip
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.
Diffstat (limited to 'makefiles')
-rw-r--r--makefiles/module.mk24
-rw-r--r--makefiles/nuttx.mk2
-rw-r--r--makefiles/setup.mk32
3 files changed, 41 insertions, 17 deletions
diff --git a/makefiles/module.mk b/makefiles/module.mk
index 8b01d0a12..154d37cc2 100644
--- a/makefiles/module.mk
+++ b/makefiles/module.mk
@@ -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.
#
#
@@ -99,11 +105,6 @@ endif
$(info % MODULE_MK = $(MODULE_MK))
#
-# Get path and tool config
-#
-include $(PX4_BASE)/makefiles/setup.mk
-
-#
# Get the board/toolchain config
#
include $(PX4_MK_DIR)/board_$(BOARD).mk
@@ -151,6 +152,19 @@ $(MODULE_COMMAND_FILES): $(GLOBAL_DEPS)
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
################################################################################
diff --git a/makefiles/nuttx.mk b/makefiles/nuttx.mk
index c6e2c86d1..e86f1370b 100644
--- a/makefiles/nuttx.mk
+++ b/makefiles/nuttx.mk
@@ -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) $@
diff --git a/makefiles/setup.mk b/makefiles/setup.mk
index 8e7a00ef4..7655872e5 100644
--- a/makefiles/setup.mk
+++ b/makefiles/setup.mk
@@ -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)/
@@ -52,23 +53,32 @@ 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.