-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile.linux
62 lines (43 loc) · 2.03 KB
/
Makefile.linux
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
MYPRJ=.
# pass 'M32=1' on the make commandline for the 32-bit build with decompression support.
LDFLAGS+=-g $(if $(M32),-m32)
CFLAGS+=-g $(if $(M32),-m32) -Wall -D_NO_RAPI
CXXFLAGS+=-std=c++1z
# osx10.15 no longer supports 32 bit code -> can't use dll's anymore.
CFLAGS+=$(if $(M32),,-D_NO_COMPRESS)
CFLAGS+=$(if $(D),-O0,-O3)
itslib=$(MYPRJ)/itslib
CFLAGS+=-I $(itslib)/include
dllload=$(MYPRJ)/dllloader
CFLAGS+=-I $(dllload)
# find a suitable openssl dir.
sslv=$(firstword $(wildcard $(addsuffix /include/openssl/opensslv.h,/usr/local /opt/local $(wildcard /usr/local/opt/openssl*) /usr)))
dirname=$(dir $(patsubst %/,%,$1))
openssl=$(call dirname,$(call dirname,$(call dirname,$(sslv))))
CFLAGS+=-I $(openssl)/include
LDFLAGS+=-L$(openssl)/lib -lcrypto
CFLAGS+=-I/usr/local/include
PLATFORM := $(shell uname -s)
computil=$(MYPRJ)/CompressUtils
CFLAGS+=-I $(computil)
eimgfs: eimgfs.o stringutils.o debug.o $(if $(M32),dllloader.o)
$(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(CXX) -c -o $@ $^ $(CFLAGS)
%.o: $(itslib)/src/%.cpp
$(CXX) -c -o $@ $^ $(CFLAGS)
%.o: $(dllload)/%.cpp
$(CXX) -c -o $@ $^ $(CFLAGS)
clean:
$(RM) eimgfs $(wildcard *.o)
$(RM) -r build CMakeFiles CMakeCache.txt CMakeOutput.log
cmake:
cmake -B build . $(if $(D),-DCMAKE_BUILD_TYPE=Debug,-DCMAKE_BUILD_TYPE=Release) $(CMAKEARGS)
$(MAKE) -C build $(if $(V),VERBOSE=1)
BOOST_LIBRARYDIR=$(if $(M32),$(BOOST_ROOT)/lib32-msvc-14.2,$(BOOST_ROOT)/lib64-msvc-14.2)
vc:
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -G"Visual Studio 16 2019" -B build . $(if $(M32),-A Win32 -DOPT_M32=1)
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" build/eimgfs.sln -t:Rebuild
nmake:
. /c/local/msvcenv.sh ; "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -G"NMake Makefiles" -B build . $(if $(M32),-DOPT_M32=1)
. /c/local/msvcenv.sh ; cd build ; nmake $(if $(V),VERBOSE=1)