-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (42 loc) · 1.3 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
CP=cp -u -r -p
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CP=rsync -au
endif
CMAKE_PREFIX=
ifeq "${MAKECMDGOALS}" "windows"
CMAKE_PREFIX=-DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32/sys-root/mingw
endif
ifeq "${MAKECMDGOALS}" "windows64"
CMAKE_PREFIX=-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/sys-root/mingw
endif
ifneq "${PREFIX}" ""
CMAKE_PREFIX=-DCMAKE_INSTALL_PREFIX=${PREFIX}
endif
ifeq "${TARGET_GLIB}" ""
TARGET_GLIB=2.32
endif
CMAKE_VALA_OPTS=--target-glib=${TARGET_GLIB}
CMAKE_OPTS=${CMAKE_PREFIX} -DCMAKE_VALA_OPTS=${CMAKE_VALA_OPTS} -DVAPIDIRS=${VAPIDIRS} -DTARGET_GLIB=${TARGET_GLIB} -DCMAKE_INSTALL_RPATH=\$$ORIGIN/../lib
all: linux
copy_files:
${CP} cmake build/
${CP} doc build/
${CP} src build/
${CP} CMakeLists.txt build/
find build/ -name CMakeCache.txt -delete
linux: build copy_files
cd build && cmake . ${CMAKE_OPTS} && make
windows: build copy_files
cd build && cmake . -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake ${CMAKE_OPTS} && make
windows64: build copy_files
cd build && cmake . -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake ${CMAKE_OPTS} && make
webassembly: build copy_files
cd build && emcmake cmake . ${CMAKE_OPTS} && make
install: build
cd build && make install
clean: build
rm -rf build
build:
mkdir build
mkdir build/log