-
Notifications
You must be signed in to change notification settings - Fork 549
Expand file tree
/
Copy pathpe-util.mk
More file actions
51 lines (47 loc) · 1.92 KB
/
pe-util.mk
File metadata and controls
51 lines (47 loc) · 1.92 KB
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
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := pe-util
$(PKG)_WEBSITE := https://github.com/gsauthof/pe-util
$(PKG)_DESCR := List shared object dependencies of a portable executable (PE)
$(PKG)_IGNORE :=
$(PKG)_VERSION := dc5dda5
$(PKG)_CHECKSUM := c3b926d8367154fb65a2d49f88cf1389e06a5ce0cc44c7b3526d901ecaba7e1d
$(PKG)_GH_CONF := gsauthof/pe-util/branches/master
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
$(PKG)_DEPS := $(BUILD)~$(PKG)
$(PKG)_DEPS_$(BUILD) := boost cmake pe-parse
define $(PKG)_PRE_CONFIGURE
# expects pe-parse in source tree as git submodule
$(call PREPARE_PKG_SOURCE,pe-parse,$(BUILD_DIR))
rm -rf '$(SOURCE_DIR)/pe-parse'
mv '$(BUILD_DIR)/$(pe-parse_SUBDIR)' '$(SOURCE_DIR)/pe-parse'
endef
define $(PKG)_BUILD
# install prefixed wrapper with default paths
$(if $(BUILD_SHARED),
(echo '#!/bin/sh'; \
echo 'exec "$(PREFIX)/$(BUILD)/bin/peldd" \
--clear-path \
--path "$(PREFIX)/$(TARGET)/bin" \
--path "$(PREFIX)/$(TARGET)/qt5/bin" \
--wlist uxtheme.dll \
--wlist opengl32.dll \
--wlist userenv.dll \
"$$@"') \
> '$(PREFIX)/bin/$(TARGET)-peldd'
chmod 0755 '$(PREFIX)/bin/$(TARGET)-peldd'
)
endef
define $(PKG)_BUILD_$(BUILD)
$($(PKG)_PRE_CONFIGURE)
# build and install the binary
cd '$(BUILD_DIR)' && cmake '$(SOURCE_DIR)' \
-DCMAKE_INSTALL_PREFIX='$(PREFIX)/$(TARGET)' \
-DBOOST_ROOT='$(PREFIX)/$(TARGET)' \
-DBOOST_INCLUDEDIR='$(PREFIX)/$(TARGET)/include' \
-DBOOST_LIBRARYDIR='$(PREFIX)/$(TARGET)/lib' \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBoost_NO_BOOST_CMAKE=ON \
-DCMAKE_CXX_FLAGS='-I$(PREFIX)/$(TARGET)/include'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
endef