OILS / build / oil.mk View on Github | oilshell.org

61 lines, 50 significant
1# oil.mk: Build rules for oil.ovm.
2
3# C module dependencies
4-include _build/oil/ovm.d
5
6_build/oil/main_name.c:
7 $(ACTIONS_SH) main-name bin.oil oil.ovm > $@
8
9OIL_PYPATH := $(REPO_ROOT):$(REPO_ROOT)/vendor
10
11# Dependencies calculated by importing main.
12# NOTE: The list of files is used both to compile and to make a tarball.
13# - For compiling, we should respect _HAVE_READLINE in detected_config
14# - For the tarball, we should ALWAYS include readline.
15#
16# BUG: Running 'make' the first time files because it can't find the '_build'
17# package. build/doc.sh currently makes _build/__init__.py.
18_build/oil/app-deps-%.txt: _build/detected-config.sh build/dynamic_deps.py
19 test -d _build/oil && \
20 $(ACTIONS_SH) app-deps oil $(OIL_PYPATH) bin.oil
21
22_build/oil/py-to-compile.txt: _build/detected-config.sh build/dynamic_deps.py
23 test -d _build/oil && \
24 $(ACTIONS_SH) py-to-compile $(OIL_PYPATH) bin.oil > $@
25
26# NOTE: I should really depend on every file in build/oil-manifest.txt!
27OIL_BYTECODE_DEPS := \
28 _build/release-date.txt \
29 build/oil-manifest.txt \
30 _devbuild/gen/help_meta.py
31
32# NOTES:
33# - _devbuild/gen/osh_help.py is a minor hack to depend on the entire
34# _devbuild/osh-quick-ref dir, since they both get generated by the same
35# build action. (Hidden targets are known to cause problems with GNU Make.)
36# - release-date.txt is in different location on purpose, so we don't show it
37# in dev mode.
38# - Do we need $(OIL_SRCS) as dependencies?
39
40_build/oil/bytecode-cpython-manifest.txt: $(OIL_BYTECODE_DEPS) \
41 _build/oil/app-deps-cpython.txt
42 { echo '_build/release-date.txt release-date.txt'; \
43 cat build/oil-manifest.txt \
44 _build/oil/app-deps-cpython.txt \
45 $(ACTIONS_SH) help-manifest _devbuild/help; \
46 $(ACTIONS_SH) pyc-version-manifest $@; \
47 } > $@
48
49_build/oil/bytecode-opy-manifest.txt: $(OIL_BYTECODE_DEPS) \
50 _build/oil/opy-app-deps.txt
51 { echo '_build/release-date.txt release-date.txt'; \
52 cat build/oil-manifest.txt \
53 _build/oil/opy-app-deps.txt; \
54 $(ACTIONS_SH) help-manifest _devbuild/help; \
55 $(ACTIONS_SH) ysh-stdlib-manifest; \
56 $(ACTIONS_SH) pyc-version-manifest $@; \
57 } > $@
58
59_build/oil/bytecode-%.zip: _build/oil/bytecode-%-manifest.txt
60 build/make_zip.py $@ < $^
61