-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (55 loc) · 2.56 KB
/
Copy pathMakefile
File metadata and controls
67 lines (55 loc) · 2.56 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.NOTPARALLEL:
# jhm itself lives in tools/ after bootstrap, and it spawns make_dep_file
# (also in tools/) as a subprocess. Put tools/ on PATH so every recipe
# can find both binaries by name -- matches how bootstrap.sh invokes them.
export PATH := $(CURDIR)/tools:$(PATH)
PREFIX ?= /usr/local
BINDIR=$(PREFIX)/bin
PACKAGE_DIR=$(PREFIX)/packages
DATA_DIR=$(PREFIX)/data
# jhm emits to ../out_orly/<config>/ (see README / docs/walkthrough.md), not ../out/.
RELEASE_OUT=../out_orly/release/
#Apps get installed on 'make install'
ORLY_APPS=orly/orlyc orly/server/orlyi orly/client/orly_client orly/indy/disk/util/orly_dm orly/core_import
ORLY_DATASET_GEN=beer complete_graph game_of_thrones money_laundering belgian_beer friends_of_friends matrix shakespeare social_graph twitter twitter_ego twitter_live
JHM_CMD=jhm $(JHM_FLAGS)
.PHONY: apps debug release bootstrap nycr test test_lang clean install version
debug: bootstrap version
$(JHM_CMD)
release: bootstrap version
$(JHM_CMD) -c release
# Generate orly/build_version.h (gitignored) from git describe so binaries can
# report the SCM version (#353). Write-if-changed via temp+rename: no spurious
# orlyc.cc rebuilds when the version is unchanged, and no torn header if two
# builds race. Direct `jhm` invocations skip this; orlyc falls back to
# "unknown" via __has_include.
version:
@v=$$(git describe --always --dirty --tags --match 'v[0-9]*' 2>/dev/null || echo unknown); \
tmp=$$(mktemp orly/.build_version.XXXXXX); \
printf '#pragma once\n\n/* Generated by `make version`; see Makefile. */\n#define ORLY_BUILD_VERSION "%s"\n' "$$v" > $$tmp; \
if cmp -s $$tmp orly/build_version.h 2>/dev/null; then rm -f $$tmp; else mv $$tmp orly/build_version.h; fi
bootstrap: tools/jhm nycr
tools/jhm:
./bootstrap.sh
nycr: tools/jhm
$(JHM_CMD) -c bootstrap
test: bootstrap
$(JHM_CMD) --test
test_lang: debug
python3 tools/lang_test.py -d orly/data tests/lang_tests
clean:
rm -rf ../out_orly/
rm -rf ../.jhm
rm -f tools/jhm
rm -f tools/make_dep_file
# jhm unions the per-job *.compdb.json into compile_commands.json at the
# repo root (not under ../out_orly/), so wipe it too or clangd keeps
# resolving against a stale, just-deleted build tree.
rm -f compile_commands.json
install: release
install -d $(BINDIR) $(PACKAGE_DIR) $(DATA_DIR)
install -m755 -t $(BINDIR) $(addprefix $(RELEASE_OUT), $(ORLY_APPS))
install -m755 -t $(BINDIR) $(addprefix $(RELEASE_OUT), $(addprefix orly/data/,$(ORLY_DATASET_GEN)))
#Mark the root of the package repository
touch $(PACKAGE_DIR)/__orly__
install -m644 -t $(PACKAGE_DIR) $(wildcard orly/data/*.orly)