diff options
author | px4dev <px4@purgatory.org> | 2013-04-26 16:14:32 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-04-26 16:14:32 -0700 |
commit | 01e427b17c161d8adaa38d6bdb91aecb434451f2 (patch) | |
tree | e33f4f6b78ef133c91ad92f1a413c2b16f17a5d5 /makefiles/module.mk | |
parent | ce0e4a3afd28b97d5a540e02bef86c52a335f243 (diff) | |
download | px4-firmware-01e427b17c161d8adaa38d6bdb91aecb434451f2.tar.gz px4-firmware-01e427b17c161d8adaa38d6bdb91aecb434451f2.tar.bz2 px4-firmware-01e427b17c161d8adaa38d6bdb91aecb434451f2.zip |
Merge working changes into export-build branch.
Diffstat (limited to 'makefiles/module.mk')
-rw-r--r-- | makefiles/module.mk | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/makefiles/module.mk b/makefiles/module.mk index 8b01d0a12..538f6d318 100644 --- a/makefiles/module.mk +++ b/makefiles/module.mk @@ -75,6 +75,18 @@ # the list should be formatted as: # <command>.<priority>.<stacksize>.<entrypoint> # +# INCLUDE_DIRS (optional, must be appended) +# +# The list of directories searched for include files. If non-standard +# includes (e.g. those from another module) are required, paths to search +# can be added here. +# +# 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. # # @@ -96,12 +108,7 @@ ifeq ($(MODULE_MK),) $(error No module makefile specified) endif -$(info % MODULE_MK = $(MODULE_MK)) - -# -# Get path and tool config -# -include $(PX4_BASE)/makefiles/setup.mk +$(info %% MODULE_MK = $(MODULE_MK)) # # Get the board/toolchain config @@ -144,13 +151,26 @@ MODULE_COMMAND_FILES := $(addprefix $(WORK_DIR)/builtin_commands/COMMAND.,$(MODU $(MODULE_COMMAND_FILES): command = $(word 2,$(subst ., ,$(notdir $(@)))) $(MODULE_COMMAND_FILES): exclude = $(dir $@)COMMAND.$(command).* $(MODULE_COMMAND_FILES): $(GLOBAL_DEPS) - @$(ECHO) COMMAND: $(command) @$(REMOVE) -f $(exclude) @$(MKDIR) -p $(dir $@) + @echo "CMD: $(command)" $(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 ################################################################################ |