-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (100 loc) · 3.27 KB
/
Makefile
File metadata and controls
113 lines (100 loc) · 3.27 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
SUBMODULES := src curry
ifeq ("$(wildcard Make.config)","")
$(error "Make.config not found. Please run ./configure")
endif
DIRS_TO_CLEAN += $(OBJECT_ROOT)
include Make.include
.DEFAULT_GOAL := default-goal
.PHONY: MANIFEST
MANIFEST:
cd $(PREFIX) && tree -anps -o $(ROOT_DIR)/MANIFEST
# Usage
# =====
.PHONY: help
help:
@echo "Usage: make [target ...] [var=value ...]"
@echo ""
@echo " * See Make.config for editable configuration options."
@echo " * Installing to PREFIX=$(PREFIX)."
ifeq ($(DEBUG),1)
@echo " * Making *DEBUG* flavor."
else
@echo " * Making *OPTIMIZED* flavor. Say \`make <target> DEBUG=1\` for debug."
endif
ifeq ($(TRACE),1)
@echo " * Computation tracing for 'cxx' is enabled."
else
@echo " * Computation tracing for 'cxx' is disabled. Say \`make <target> TRACE=1\` to enable."
endif
@echo ""
@echo "Targets for testing:"
@echo "--------------------"
@echo " stage : build a local copy for testing"
@echo " test : run unit tests (must stage first)"
@echo ""
@echo "Targets for building:"
@echo "---------------------"
@echo " all : build objects and libraries"
@echo " clean : remove generated files"
@echo " objs : compile object files"
@echo " libs : compile and link static libraries"
@echo " shlibs : compile and link shared libraries"
@echo ""
@echo "Targets for installing:"
@echo "-----------------------"
@echo " install PREFIX=<dirname> : install files under <dirname>"
@echo " uninstall PREFIX=<dirname> : uninstall files under <dirname>"
@echo ""
@echo "Targets to overlay PAKCS files (improves test speed):"
@echo "-----------------------------------------------------"
@echo " overlay : overlay PAKCS files"
@echo " overlay-archive : build a new archive of overlayable files"
@echo ""
@echo "Targets for debugging the build:"
@echo "--------------------------------"
@echo " print-<varname> : print the value of a make variable; E.g., say"
@echo " \`make print-CC\` to see the selected compiler."
@echo ""
@echo "For information on testing, refer to tests/README."
@echo ""
# @echo "To build documentation, add WITHDOC=1 to the commandline or invoke"
# @echo "make from the docs/ subdirectory."
# The overlay archive captures build products for a particular version of
# PAKCS. Installing these dramatically improves the test performance.
OVERLAY_ARCHIVE := overlay-$(PAKCS_SUBDIR).tgz
OVERLAY_LIST_FILE := OVERLAY_FILES.txt
.PHONY: overlay overlay-archive $(OVERLAY_ARCHIVE) $(OVERLAY_LIST_FILE)
$(OVERLAY_LIST_FILE):
find tests -type f -wholename '*/.curry/*$(PAKCS_SUBDIR)*' > $(OVERLAY_LIST_FILE)
find curry/$(PAKCS_SUBDIR) -type f >> $(OVERLAY_LIST_FILE)
$(OVERLAY_ARCHIVE): $(OVERLAY_LIST_FILE)
tar cvT $(OVERLAY_LIST_FILE) | gzip -n > $@
rm $(OVERLAY_LIST_FILE)
overlay-archive: $(OVERLAY_ARCHIVE)
ifeq ($(shell [ -e $(OVERLAY_ARCHIVE) ]; echo $$?),1)
overlay:
else
overlay:
tar xvzf $(OVERLAY_ARCHIVE)
endif
.PHONY: clean
clean:
rm -r $(OBJECT_ROOT)
.PHONY: test
test:
make -C tests
.PHONY: stage
stage:
make install SYMLINK_INTERFACES=1
.PHONY: unstage
unstage:
rm -r $(STAGE_DIR)
.PHONY: docs
docs:
make -C docs html latexpdf
.PHONY: default-goal
default-goal:
git submodule init
git submodule update
make overlay
make stage