From 5bc861e4991a34f56120d2b512f585837480efa4 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 23 Feb 2023 08:41:39 -0800 Subject: [PATCH 1/5] remove exec bit on source file --- src/mqtt_packet.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/mqtt_packet.c diff --git a/src/mqtt_packet.c b/src/mqtt_packet.c old mode 100755 new mode 100644 From 5c279b89da458e36af2ddba2c142c4e207bb9f26 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 23 Feb 2023 09:53:02 -0800 Subject: [PATCH 2/5] add QNX makefile --- IDE/QNX/include.am | 8 + IDE/QNX/wolfmqtt/.cproject | 578 +++++++++++++++++++++++++++++++++++++ IDE/QNX/wolfmqtt/.project | 33 +++ IDE/QNX/wolfmqtt/Makefile | 76 +++++ IDE/QNX/wolfmqtt/README.md | 24 ++ IDE/include.am | 1 + 6 files changed, 720 insertions(+) create mode 100644 IDE/QNX/include.am create mode 100644 IDE/QNX/wolfmqtt/.cproject create mode 100644 IDE/QNX/wolfmqtt/.project create mode 100644 IDE/QNX/wolfmqtt/Makefile create mode 100644 IDE/QNX/wolfmqtt/README.md diff --git a/IDE/QNX/include.am b/IDE/QNX/include.am new file mode 100644 index 000000000..37fe69ad5 --- /dev/null +++ b/IDE/QNX/include.am @@ -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/wolfssl/.cproject +EXTRA_DIST+= IDE/QNX/wolfssl/.project +EXTRA_DIST+= IDE/QNX/wolfssl/Makefile diff --git a/IDE/QNX/wolfmqtt/.cproject b/IDE/QNX/wolfmqtt/.cproject new file mode 100644 index 000000000..5c2fa9d5d --- /dev/null +++ b/IDE/QNX/wolfmqtt/.cproject @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IDE/QNX/wolfmqtt/.project b/IDE/QNX/wolfmqtt/.project new file mode 100644 index 000000000..fcdfb87c4 --- /dev/null +++ b/IDE/QNX/wolfmqtt/.project @@ -0,0 +1,33 @@ + + + wolfmqtt + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + src + 2 + $%7BPARENT-3-PROJECT_LOC%7D/src + + + diff --git a/IDE/QNX/wolfmqtt/Makefile b/IDE/QNX/wolfmqtt/Makefile new file mode 100644 index 000000000..bfc45e656 --- /dev/null +++ b/IDE/QNX/wolfmqtt/Makefile @@ -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) \ No newline at end of file diff --git a/IDE/QNX/wolfmqtt/README.md b/IDE/QNX/wolfmqtt/README.md new file mode 100644 index 000000000..6f93ce4dc --- /dev/null +++ b/IDE/QNX/wolfmqtt/README.md @@ -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 an 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 +``` diff --git a/IDE/include.am b/IDE/include.am index 4dede2829..b09722395 100644 --- a/IDE/include.am +++ b/IDE/include.am @@ -6,3 +6,4 @@ include IDE/ARDUINO/include.am include IDE/F767ZI-TOPPERS/include.am include IDE/Microchip-Harmony/include.am include IDE/STM32CUBE/include.am +include IDE/QNX/include.am From d8cc26e1afb7c82334533a83507abfc1d0336461 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 23 Feb 2023 14:01:13 -0800 Subject: [PATCH 3/5] move README to top of QNX directory --- IDE/QNX/{wolfmqtt => }/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename IDE/QNX/{wolfmqtt => }/README.md (100%) diff --git a/IDE/QNX/wolfmqtt/README.md b/IDE/QNX/README.md similarity index 100% rename from IDE/QNX/wolfmqtt/README.md rename to IDE/QNX/README.md From f9b6d3e7f0404b2a234a8fb6916b40251602ed97 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 1 Mar 2023 16:04:48 -0800 Subject: [PATCH 4/5] fix include.am for QNX IDE --- IDE/QNX/include.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IDE/QNX/include.am b/IDE/QNX/include.am index 37fe69ad5..c4eb40487 100644 --- a/IDE/QNX/include.am +++ b/IDE/QNX/include.am @@ -3,6 +3,6 @@ # All paths should be given relative to the root EXTRA_DIST+= IDE/QNX/README.md -EXTRA_DIST+= IDE/QNX/wolfssl/.cproject -EXTRA_DIST+= IDE/QNX/wolfssl/.project -EXTRA_DIST+= IDE/QNX/wolfssl/Makefile +EXTRA_DIST+= IDE/QNX/wolfmqtt/.cproject +EXTRA_DIST+= IDE/QNX/wolfmqtt/.project +EXTRA_DIST+= IDE/QNX/wolfmqtt/Makefile From 2e79aaf943bf7de0c5a1c66a9a896f57c39f1ecd Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 18 Jul 2023 12:53:53 -0700 Subject: [PATCH 5/5] fix README grammer issue --- IDE/QNX/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDE/QNX/README.md b/IDE/QNX/README.md index 6f93ce4dc..95deb48a0 100644 --- a/IDE/QNX/README.md +++ b/IDE/QNX/README.md @@ -7,7 +7,7 @@ git clone https://github.com/wolfssl/wolfssl git clone https://github.com/wolfssl/wolfmqtt ``` -Then both projects can be imported as an 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". +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.