Skip to content

Commit

Permalink
Makefile: Adds support for MQL4/MQL5 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Sep 10, 2024
1 parent 7d7d396 commit 3fc6cad
Show file tree
Hide file tree
Showing 28 changed files with 924 additions and 140 deletions.
38 changes: 33 additions & 5 deletions Exchange/Account/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Exchange/SymbolInfo/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Exchange/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Indicator/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Indicators/Bitwise/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Indicators/OHLC/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Indicators/Oscillator/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
38 changes: 33 additions & 5 deletions Indicators/Price/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
CC := g++ # C++ compiler
CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags
SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory
OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files
MTE4 := metaeditor.exe
MTE5 := metaeditor64.exe
CFLAGS := -Wall -Wextra -std=c++17 -w
SRCS_CPP := $(wildcard *.cpp)
SRCS_MQ4 := $(wildcard *.mq4)
SRCS_MQ5 := $(wildcard *.mq5)
OBJS_EX4 := $(SRCS_MQ4:.mq4=.ex4)
OBJS_EX5 := $(SRCS_MQ5:.mq5=.ex5)
OBJS_O := $(SRCS_CPP:.cpp=.o)

all: $(OBJS)
# Check if the system is Linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
WINE := wine
# Set WINEPATH to include MetaTrader directory.
export WINEPATH := $(WINEPATH);"C:\Program Files\MetaTrader 4;C:\Program Files\MetaTrader 5"
else
WINE :=
endif

.PHONY: all cpp mql mql4 mql5

all: $(OBJS_O)
cpp: $(OBJS_O)
mql4: $(OBJS_EX4)
mql5: $(OBJS_EX5)
mql: mql4 mql5

%.ex4: %.mq4
$(WINE) $(MTE4) /compile:$< /log:CON

%.ex5: %.mq5
$(WINE) $(MTE5) /compile:$< /log:CON

%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -v $(OBJS)
rm -v $(OBJS_EX4) $(OBJS_EX5) $(OBJS_O)
Loading

0 comments on commit 3fc6cad

Please sign in to comment.