Skip to content

Commit 8f77dad

Browse files
authored
Feature/mingw support (#344)
* Mingw support Signed-off-by: Cervenka Dusan <cervenka@acrios.com> * mkdirc Signed-off-by: Cervenka Dusan <cervenka@acrios.com> * Added circleci build for mingw Signed-off-by: Cervenka Dusan <cervenka@acrios.com> --------- Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
1 parent 6756f38 commit 8f77dad

File tree

17 files changed

+144
-55
lines changed

17 files changed

+144
-55
lines changed

.circleci/config.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
version: 2.1
22

3+
orbs:
4+
win: circleci/windows@5.0 # The Windows orb gives you everything you need to start using the
5+
36
jobs:
47
build-linux-gcc:
58
machine:
@@ -39,7 +42,16 @@ jobs:
3942
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
4043
- store_artifacts:
4144
path: ./Release/Darwin/erpcgen/erpcgen
42-
45+
build-windows-mingw:
46+
executor:
47+
name: win/default
48+
size: large
49+
steps:
50+
- checkout
51+
- run: powershell.exe .\install_dependencies.ps1
52+
- run: powershell.exe .\mingw64\bin\mingw32-make erpcgen
53+
- store_artifacts:
54+
path: ./Release/MINGW64/erpcgen/erpcgen.exe
4355

4456
workflows:
4557
build-workflow:
@@ -48,3 +60,4 @@ workflows:
4860
- build-linux-clang
4961
- build-mac-gcc
5062
- build-mac-clang
63+
- build-windows-mingw

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,7 @@ format-files-to-commit.rb
107107
language\.settings\.xml
108108
*.vsix
109109
null.d
110+
boost.7z
111+
boost*/
112+
mingw.7z
113+
mingw64/

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,21 @@ test-serial: $(TESTDIR)
7171
.PHONY: fresh
7272
fresh: clean all
7373

74+
# define clean_fun
75+
# $(warning "$(at)$(POWERSHELL) "if (Test-Path $(1)) { $(rmc) $(1) }"")
76+
# $(at)$(POWERSHELL) 'if (Test-Path $(1)) { $(rmc) $(1) }'
77+
# endef
78+
7479
# Target to clean everything.
7580
.PHONY: clean
7681
clean::
7782
@echo "Deleting output directories..."
78-
@rm -rf Debug Release
79-
@rm -rf out*.*
80-
@rm -rf erpc_outputs
83+
@$(rmc) Debug Release
84+
@$(rmc) out*.*
85+
@$(rmc) erpc_outputs
86+
# @$(call clean_fun,Debug,)
87+
# @$(call clean_fun,Release,)
88+
# @$(call clean_fun,erpc_outputs,)
8189
@echo "done."
8290

8391
# Process subdirs

erpc_c/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ endif
121121

122122
$(TARGET_LIB)(%): %
123123
@$(call printmessage,ar,Archiving, $(?F) in $(@F))
124-
$(at)mkdir -p $(dir $(@))
124+
$(at)$(mkdirc) -p $(dir $(@))
125125
$(AR) $(ARFLAGS) $@ $?
126126

127127
.PHONY: install
@@ -130,17 +130,17 @@ install: install_headers install_lib
130130
.PHONY: install_headers
131131
install_headers: $(HEADERS) | $(INC_INSTALL_DIR)
132132
@$(call printmessage,c,Installing, headers in $(INC_INSTALL_DIR))
133-
$(at)mkdir -p $(INC_INSTALL_DIR)
133+
$(at)$(mkdirc) -p $(INC_INSTALL_DIR)
134134
$(at)install $(?) $(INC_INSTALL_DIR)
135135

136136
$(INC_INSTALL_DIR):
137-
$(at)mkdir -p $(INC_INSTALL_DIR)
137+
$(at)$(mkdirc) -p $(INC_INSTALL_DIR)
138138

139139
.PHONY: install_lib
140140
install_lib: $(TARGET_LIB)
141141
@$(call printmessage,c,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(LIB_INSTALL_DIR))
142-
$(at)mkdir -p $(LIB_INSTALL_DIR)
142+
$(at)$(mkdirc) -p $(LIB_INSTALL_DIR)
143143
$(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR)
144144

145145
clean::
146-
$(at)rm -rf $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c
146+
$(at)$(rmc) $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c

erpcgen/Makefile

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ INCLUDES += $(ERPC_ROOT) \
4040
$(OBJS_ROOT)
4141

4242
ifeq "$(is_mingw)" "1"
43-
INCLUDES += $(ERPC_ROOT)/windows
43+
INCLUDES += $(VISUAL_STUDIO_ROOT)
4444
endif
4545

4646
SOURCES += $(OBJS_ROOT)/erpcgen_parser.tab.cpp \
@@ -85,15 +85,6 @@ SOURCES += $(OBJS_ROOT)/erpcgen_parser.tab.cpp \
8585
$(OBJS_ROOT)/erpcgen/src/templates/py_coders.c \
8686
$(OBJS_ROOT)/erpcgen/src/templates/py_global_init.c
8787

88-
ifeq "$(is_mingw)" "1"
89-
SOURCES += $(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_common_header.cpp \
90-
$(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_client_source.cpp \
91-
$(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_server_header.cpp \
92-
$(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_server_source.cpp \
93-
$(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_coders.cpp \
94-
$(ERPC_ROOT)/erpcgen/VisualStudio_v14/c_common_functions.cpp \
95-
$(OBJS_ROOT)/erpcgen/src/templates/c_crc.cpp
96-
else
9788
SOURCES += $(OBJS_ROOT)/erpcgen/src/templates/c_common_header.c \
9889
$(OBJS_ROOT)/erpcgen/src/templates/c_client_source.c \
9990
$(OBJS_ROOT)/erpcgen/src/templates/c_server_header.c \
@@ -108,7 +99,6 @@ SOURCES += $(OBJS_ROOT)/erpcgen/src/templates/c_common_header.c \
10899
$(OBJS_ROOT)/erpcgen/src/templates/py_interface.c \
109100
$(OBJS_ROOT)/erpcgen/src/templates/py_coders.c \
110101
$(OBJS_ROOT)/erpcgen/src/templates/py_global_init.c
111-
endif
112102

113103
OBJECT_DEP := $(OBJS_ROOT)/erpcgen_lexer.cpp
114104

@@ -122,6 +112,10 @@ ifeq "$(build)" "release"
122112
endif
123113
endif
124114

115+
ifeq "$(is_mingw)" "1"
116+
CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=4
117+
endif
118+
125119
# Run flex
126120
$(OBJS_ROOT)/erpcgen_lexer.cpp: $(ERPC_ROOT)/erpcgen/src/erpcgen_lexer.l $(OBJS_ROOT)/erpcgen_parser.tab.hpp | $(OBJECTS_DIRS)
127121
@$(call printmessage,orange,Generating, $(subst $(ERPC_ROOT)/,,$<))
@@ -142,8 +136,8 @@ $(OBJS_ROOT)/%.c: $(ERPC_ROOT)/%.template
142136
.PHONY: install
143137
install: $(MAKE_TARGET)
144138
@$(call printmessage,c,Installing, erpcgen in $(BIN_INSTALL_DIR))
145-
$(at)mkdir -p $(BIN_INSTALL_DIR)
139+
$(at)$(mkdirc) -p $(BIN_INSTALL_DIR)
146140
$(at)install $(MAKE_TARGET) $(BIN_INSTALL_DIR)
147141

148142
clean::
149-
$(at)rm -rf $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c
143+
$(at)$(rmc) $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c

erpcgen/VisualStudio_v14/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ win_bison.exe
2929
win_flex.exe
3030
README.txt
3131
.vs
32+
changelog.md
33+
README.md
3234

3335
#boost libraries
3436
boost_*

erpcgen/VisualStudio_v14/erpcgen.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">

erpcgen/VisualStudio_v14/readme_erpcgen.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Requirements
1212
2. Win flex-bison
1313

1414
Direct link to the latests win flex-bison release download:
15-
[https://sourceforge.net/projects/winflexbison]
15+
[https://sourceforge.net/projects/winflexbison/files/win_flex_bison3-latest.zip/download]
16+
1617

1718
Extract win flex-bison zip contents directly into the erpc/erpcgen/VisualStudio_v14 directory
1819
(not into a subdirectory).

erpcgen/src/cpptemplate/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ all: cpptempl_test
4141
.PHONY: clean
4242
clean:
4343
@echo "Cleaning output..."
44-
@rm -rf *.o
45-
@rm -rf *.d
44+
@$(rmc) *.o
45+
@$(rmc) *.d
4646
@rm -f $(TARGET)
4747

4848
.PHONY: test testv

erpcsniffer/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ INCLUDES += $(ERPC_ROOT) \
4545
$(OBJS_ROOT)
4646

4747
ifeq "$(is_mingw)" "1"
48-
INCLUDES += $(ERPC_ROOT)/windows
48+
INCLUDES += $(VISUAL_STUDIO_ROOT)
4949
endif
5050

5151
SOURCES += $(OBJS_ROOT)/erpcgen_parser.tab.cpp \
@@ -103,8 +103,8 @@ $(OBJS_ROOT)/erpcgen_parser.tab.hpp: $(ERPC_ROOT)/erpcgen/src/erpcgen_parser.y |
103103
.PHONY: install
104104
install: $(MAKE_TARGET)
105105
@$(call printmessage,c,Installing, erpcsniffer in $(BIN_INSTALL_DIR))
106-
$(at)mkdir -p $(BIN_INSTALL_DIR)
106+
$(at)$(mkdirc) -p $(BIN_INSTALL_DIR)
107107
$(at)install $(MAKE_TARGET) $(BIN_INSTALL_DIR)
108108

109109
clean::
110-
$(at)rm -rf $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c
110+
$(at)$(rmc) $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c

0 commit comments

Comments
 (0)