-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
69 lines (42 loc) · 1.75 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# To see a list of available make targets from bash, type:
# make <space> <tab> <tab>
include makefile-generic.mk
# Set compiler to mingw (can still override from command line)
config := mingw
CXXFLAGS := -std=c++17 -O2 -g -Wall -Wextra -Wpedantic -Wno-unknown-pragmas
LDFLAGS := -static-libgcc -static-libstdc++
LDLIBS := -lstdc++fs -lws2_32
op2extDll_DEFINES := -DOP2EXT_INTERNAL_BUILD
# By default, compile and link both static library and dynamic link library
all: op2extLib op2extDll
$(eval $(call DefineCppProject,op2extLib,op2ext.lib,srcStatic/))
$(eval $(call DefineCppProject,op2extDll,op2ext.dll,srcDLL/,op2extLib))
$(eval $(call DefineCppProject,testModule,testModule.dll,TestModule/,op2extDll))
$(eval $(call DefineUnitTestProject,testLib,test/,op2extLib))
$(eval $(call DefineUnitTestProject,testDll,testDll/,op2extDll))
# Docker and CircleCI commands
$(eval $(call DefineDockerImage,.circleci/,outpostuniverse/gcc-mingw-wine-googletest-circleci,1.2))
$(eval $(call DefineCircleCi))
ifdef Outpost2Path
.PHONY: install run install-testModule run-testModule
install: $(Outpost2Path)op2ext.dll
$(Outpost2Path)op2ext.dll: op2ext.dll
cp op2ext.dll "$(Outpost2Path)"
run: install
wine "$(Outpost2Path)Outpost2.exe"
testModuleName := testModule
testModulePath := $(Outpost2Path)$(testModuleName)/
testModulePathFilename := $(testModulePath)op2mod.dll
install-testModule: $(testModulePathFilename)
$(testModulePathFilename): testModule.dll
mkdir -p "$(testModulePath)"
cp testModule.dll "$(testModulePathFilename)"
run-testModule: install-testModule
wine "$(Outpost2Path)Outpost2.exe" /loadmod "$(testModuleName)"
.PHONY: viewLog cleanLog
LogFilename := $(Outpost2Path)Outpost2Log.txt
viewLog:
cat "$(LogFilename)"
cleanLog:
rm "$(LogFilename)"
endif