Repository navigation
Expand file tree
/
Copy pathGNUmakefile.include
More file actions
36 lines (33 loc) · 1.59 KB
/
Copy pathGNUmakefile.include
File metadata and controls
36 lines (33 loc) · 1.59 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
# SmallStepLib/GNUmakefile.include - shared SmallStep integration for all apps.
#
# Include from any app or Tests GNUmakefile (right after common.make):
# -include ../SmallStepLib/GNUmakefile.include (from an app dir)
# -include ../../SmallStepLib/GNUmakefile.include (from a Tests dir)
#
# The block is location-independent: it resolves its own directory, so the
# same file works from anywhere in the tree (no ../ depth guessing).
#
# Provided variables:
# SMALLSTEP_FRAMEWORK path to SmallStep.framework (empty if not found)
# SMALLSTEP_LIB_DIR framework library dir (Versions/0)
# SMALLSTEP_LIB_PATH -L<lib dir> (empty if not found)
# SMALLSTEP_LDFLAGS -Wl,-rpath,<lib dir> (empty if not found)
# SMALLSTEP_INCLUDE_DIRS -I flags for SmallStep headers (Core + Platform/Linux)
#
# Apps still add -lSmallStep to their TOOL_LIBS / ADDITIONAL_LDFLAGS
# themselves, and compose $(SMALLSTEP_LIB_PATH) $(SMALLSTEP_LDFLAGS) into
# their LDFLAGS exactly as before.
SMALLSTEP_TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SMALLSTEP_FRAMEWORK := $(shell find $(SMALLSTEP_TOP) -maxdepth 4 -name "SmallStep.framework" -type d 2>/dev/null | head -1)
ifneq ($(SMALLSTEP_FRAMEWORK),)
SMALLSTEP_LIB_DIR := $(shell cd $(SMALLSTEP_FRAMEWORK)/Versions/0 2>/dev/null && pwd)
SMALLSTEP_LIB_PATH := -L$(SMALLSTEP_LIB_DIR)
SMALLSTEP_LDFLAGS := -Wl,-rpath,$(SMALLSTEP_LIB_DIR)
else
SMALLSTEP_LIB_DIR :=
SMALLSTEP_LIB_PATH :=
SMALLSTEP_LDFLAGS :=
endif
SMALLSTEP_INCLUDE_DIRS = \
-I$(SMALLSTEP_TOP)/SmallStep/Headers/Core \
-I$(SMALLSTEP_TOP)/SmallStep/Headers/Platform/Linux