2022-12-23 17:48:15 +00:00
|
|
|
BUILD_ARCH := $(shell uname -m)
|
|
|
|
RELEASE_NAME := "dragonfly-${BUILD_ARCH}"
|
2023-12-27 15:48:29 +00:00
|
|
|
HELIO_RELEASE_FLAGS = -DHELIO_RELEASE_FLAGS="-g"
|
2022-12-23 17:48:15 +00:00
|
|
|
HELIO_USE_STATIC_LIBS = ON
|
|
|
|
HELIO_OPENSSL_USE_STATIC_LIBS = ON
|
|
|
|
HELIO_ENABLE_GIT_VERSION = ON
|
|
|
|
HELIO_WITH_UNWIND = OFF
|
|
|
|
|
2023-09-12 07:42:06 +00:00
|
|
|
# Some distributions (old fedora) have incorrect dependencies for crypto
|
|
|
|
# so we add -lz for them.
|
|
|
|
LINKER_FLAGS=-lz
|
|
|
|
|
2023-08-29 15:24:29 +00:00
|
|
|
# equivalent to: if $(uname_m) == x86_64 || $(uname_m) == amd64
|
|
|
|
ifneq (, $(filter $(BUILD_ARCH),x86_64 amd64))
|
|
|
|
HELIO_MARCH_OPT := -march=core2 -msse4.1 -mpopcnt -mtune=skylake
|
|
|
|
endif
|
|
|
|
|
2023-09-12 07:42:06 +00:00
|
|
|
# For release builds we link statically libstdc++ and libgcc. Currently,
|
|
|
|
# all the release builds are performed by gcc.
|
2024-01-11 04:35:57 +00:00
|
|
|
LINKER_FLAGS += -static-libstdc++ -static-libgcc
|
2023-09-12 07:42:06 +00:00
|
|
|
|
2024-01-11 04:35:57 +00:00
|
|
|
HELIO_FLAGS = -DHELIO_RELEASE_FLAGS="-g" \
|
2023-09-12 07:42:06 +00:00
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="$(LINKER_FLAGS)" \
|
2022-12-23 17:48:15 +00:00
|
|
|
-DBoost_USE_STATIC_LIBS=$(HELIO_USE_STATIC_LIBS) \
|
|
|
|
-DOPENSSL_USE_STATIC_LIBS=$(HELIO_OPENSSL_USE_STATIC_LIBS) \
|
|
|
|
-DENABLE_GIT_VERSION=$(HELIO_ENABLE_GIT_VERSION) \
|
2023-08-29 15:24:29 +00:00
|
|
|
-DWITH_UNWIND=$(HELIO_WITH_UNWIND) -DMARCH_OPT="$(HELIO_MARCH_OPT)"
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
|
|
|
|
configure:
|
2024-01-11 04:35:57 +00:00
|
|
|
cmake -L -B build-release -DCMAKE_BUILD_TYPE=Release -GNinja $(HELIO_FLAGS)
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
build:
|
2024-01-11 04:35:57 +00:00
|
|
|
cd build-release; \
|
2023-09-12 07:42:06 +00:00
|
|
|
ninja dragonfly && ldd dragonfly
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
package:
|
2024-01-11 04:35:57 +00:00
|
|
|
cd build-release; \
|
2023-12-27 15:48:29 +00:00
|
|
|
objcopy \
|
|
|
|
--remove-section=".debug_*" \
|
|
|
|
--remove-section="!.debug_line" \
|
|
|
|
--compress-debug-sections \
|
|
|
|
dragonfly \
|
|
|
|
$(RELEASE_NAME); \
|
2022-12-23 17:48:15 +00:00
|
|
|
tar cvfz $(RELEASE_NAME).tar.gz $(RELEASE_NAME) ../LICENSE.md
|
|
|
|
|
|
|
|
release: configure build
|
|
|
|
|
|
|
|
default: release
|