-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from JacobBarthelmeh/qnx
Add QNX IDE, Makefile, and remove source code exec bit
- Loading branch information
Showing
7 changed files
with
720 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
WOLFSSL_DIR is used to point to the directory where wolfSSL was built. By default it looks for an adjacent 'wolfssl' directory. i.e. | ||
|
||
``` | ||
mkdir test | ||
cd test | ||
git clone https://github.com/wolfssl/wolfssl | ||
git clone https://github.com/wolfssl/wolfmqtt | ||
``` | ||
|
||
Then both projects can be imported as a Momentics IDE project. To first build wolfSSL view the README located at wolfssl/IDE/QNX/README.md. Then to build wolfMQTT start momentics with the workspace located at wolfmqtt/IDE/QNX/. Import the wolfmqtt project (File->Import->General->Existing Projects into Workspace, in "Select root directory" browse to the directory wolfmqtt/IDE/QNX/ and select the wolfmqtt project then click "Finish". | ||
|
||
To alter the location that the wolfSSL directory is set WOLFSSL_DIR as an env. variable. | ||
|
||
``` | ||
export WOLFSSL_DIR=/my/wolfssl/directory/ | ||
``` | ||
|
||
To build from the command line using the Makefile do the following: | ||
|
||
``` | ||
source ~/qnx710/qnxsdp-env.sh | ||
cd wolfmqtt/IDE/QNX/wolfmqtt | ||
make | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# vim:ft=automake | ||
# included from Top Level Makefile.am | ||
# All paths should be given relative to the root | ||
|
||
EXTRA_DIST+= IDE/QNX/README.md | ||
EXTRA_DIST+= IDE/QNX/wolfmqtt/.cproject | ||
EXTRA_DIST+= IDE/QNX/wolfmqtt/.project | ||
EXTRA_DIST+= IDE/QNX/wolfmqtt/Makefile |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>wolfmqtt</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
<linkedResources> | ||
<link> | ||
<name>src</name> | ||
<type>2</type> | ||
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/src</locationURI> | ||
</link> | ||
</linkedResources> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
ARTIFACT = libwolfmqtt.so | ||
|
||
#Build architecture/variant string, possible values: x86, armv7le, etc... | ||
PLATFORM ?= armv7le | ||
|
||
#Build profile, possible values: release, debug, profile, coverage | ||
BUILD_PROFILE ?= debug | ||
|
||
#Point to the location where wolfSSL was built | ||
WOLFSSL_DIR ?= ../../../../wolfssl | ||
|
||
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE) | ||
OUTPUT_DIR = build/$(CONFIG_NAME) | ||
TARGET = $(OUTPUT_DIR)/$(ARTIFACT) | ||
|
||
#Compiler definitions | ||
|
||
CC = qcc -Vgcc_nto$(PLATFORM) | ||
CXX = q++ -Vgcc_nto$(PLATFORM)_cxx | ||
LD = $(CC) | ||
|
||
#User defined include/preprocessor flags and libraries | ||
|
||
INCLUDES += -I../../../ | ||
INCLUDES += -I$(WOLFSSL_DIR) | ||
|
||
#Location for user_settings.h | ||
INCLUDES += -I$(WOLFSSL_DIR)/IDE/QNX/wolfssl | ||
|
||
LIBS += -L$(WOLFSSL_DIR)/IDE/QNX/wolfssl/$(OUTPUT_DIR) -lwolfssl | ||
|
||
#Compiler flags for build profiles | ||
CCFLAGS_release += -O2 | ||
CCFLAGS_debug += -g -O0 -fno-builtin | ||
CCFLAGS_coverage += -g -O0 -ftest-coverage -fprofile-arcs -nopipe -Wc,-auxbase-strip,$@ | ||
LDFLAGS_coverage += -ftest-coverage -fprofile-arcs | ||
CCFLAGS_profile += -g -O0 -finstrument-functions | ||
LIBS_profile += -lprofilingS | ||
|
||
#Generic compiler flags (which include build type flags) | ||
CCFLAGS_all += -DWOLFSSL_USER_SETTINGS -Wall -fmessage-length=0 | ||
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE)) | ||
#Shared library has to be compiled with -fPIC | ||
CCFLAGS_all += -fPIC | ||
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE)) | ||
LIBS_all += $(LIBS_$(BUILD_PROFILE)) | ||
DEPS = -Wp,-MMD,$(OUTPUT_DIR)/$(notdir $(@:%.o=%.d)),-MT,$(OUTPUT_DIR)/$(notdir $@) | ||
|
||
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp | ||
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2)) | ||
|
||
#Source list | ||
SRCS = $(call rwildcard, ../../../src, c) | ||
|
||
#Object files list | ||
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS)))) | ||
|
||
#Compiling rule | ||
$(OUTPUT_DIR)/%.o: %.c | ||
@mkdir -p $(dir $(OUTPUT_DIR)/$(notdir $@)) | ||
$(CC) -c $(DEPS) -o $(OUTPUT_DIR)/$(notdir $@) $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $< | ||
|
||
#Linking rule | ||
$(TARGET):$(OBJS) | ||
$(LD) -shared -o $(TARGET) $(LDFLAGS_all) $(LDFLAGS) $(foreach f, $(OBJS), $(OUTPUT_DIR)/$(notdir $(f))) $(LIBS_all) $(LIBS) | ||
|
||
#Rules section for default compilation and linking | ||
all: $(TARGET) | ||
|
||
clean: | ||
rm -fr $(OUTPUT_DIR) | ||
|
||
rebuild: clean all | ||
|
||
#Inclusion of dependencies (object files to source and includes) | ||
-include $(OBJS:%.o=%.d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.