forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (21 loc) · 823 Bytes
/
Makefile
File metadata and controls
30 lines (21 loc) · 823 Bytes
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
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
.DEFAULT_GOAL := test
.PHONY: build test
FORCE:
ICU_CAPI := $(shell cargo metadata --format-version 1 | jq '.packages[] | select(.name == "icu_capi").manifest_path' | xargs dirname)
HEADERS := ${ICU_CAPI}/bindings/cpp
ALL_HEADERS := $(wildcard ${HEADERS}/*)
CXX?=g++
TEST_FILES := $(wildcard *.cpp)
OUT_FILES = $(subst .cpp,,$(TEST_FILES))
$(ALL_HEADERS):
target/debug/libicu_capi.a: FORCE
cargo rustc -p icu_capi --crate-type staticlib
%: %.cpp target/debug/libicu_capi.a $(ALL_HEADERS)
$(CXX) -std=c++17 -L target/debug -I ${HEADERS} $@.cpp -licu_capi -lm -o $@
./$@
test: $(OUT_FILES)
clean:
rm $(OUT_FILES)