-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.example
146 lines (114 loc) · 4.42 KB
/
Makefile.example
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -*- makefile-gmake -*-
# ----------------------------------------------------------------------
#
# Example Makefile for OPAM package contruction.
#
# Copyright (C) 2015 Nicolas Berthier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ----------------------------------------------------------------------
#
# Package maintainers can use the `opam-dist' utility [1] for OPAM
# package creation and distribution.
#
# [1] https://github.com/nberth/opam-dist
#
# ----------------------------------------------------------------------
# Customizable part.
# OPAM package name.
PKGNAME = example-pkgname
# Lists below can be left empty when needed.
# OCaml executable to be compiled.
EXECS = exec1 exec2
# OCaml libraries to be compiled, accompanied with their interfaces.
AVAILABLE_LIBs = lib1 lib2 acronym
AVAILABLE_LIB_ITFs = lib1 lib2 aCRONYM
# Files to be installed in the binary directory, that do not need to
# be compiled yet.
EXTRA_EXECS =
# Ibid in the case of libraries.
EXTRA_LIBs =
# Further flags.
INSTALL_LIBS = yes
INSTALL_DOCS = yes
ENABLE_BYTE = yes
ENABLE_NATIVE = no
ENABLE_DEBUG = no
ENABLE_PROFILING = no
# Executables built and run by `check' target:
TEST_EXECS = test1 test2
# This file should define PREFIX and DOCDIR variables, using a
# configure script for instance; they could also be setup directly.
-include config.mk
# ---
MENHIRFLAGS = --fixed-exception
OCAMLBUILDFLAGS = -use-menhir -menhir "menhir $(MENHIRFLAGS)" -j 8
# Use it in case documentation comments contrain UTF-8 characters:
OCAMLDOCFLAGS = -charset iso-10646-1
# Customization of error message when PREFIX is needed but undefined:
NO_PREFIX_ERROR_MSG = Missing prefix: execute configure script first
NO_DOCDIR_ERROR_MSG = Missing documentation directory: execute \
configure script first
# Uncomment the following line to disable automatic creation of
# version.ml.in:
# BUILD_VERSION_ML_IN = no
# ---
# Custom rules for building & installing documentation
# Example second target forces creation of a link in root directory:
# DOC_TARGETS = doc.otarget src/<lib name>.docdir/index.html
# Uncomment the following line to disable automatic installation of
# html documentation directories for each library $(l) into
# $(DOCDIR)/$(PKGNAME)/$(l):
# USE_PER_LIB_INSTALL_DOC = no
# Additional commands for html doc installation can be specified under
# rule `install-doc' at the bottom;
# install-doc:
# ...
# ---
# The git submodule directory containing `generic.mk':
OPAM_PKGDEV_DIR = opam-pkgdev
# OPAM package descriptors, and files to include in the source
# distribution archive:
OPAM_DIR = opam
OPAM_FILES = descr opam
DIST_FILES = configure LICENSE Makefile myocamlbuild.ml README src \
_tags version.ml.in TODO META
# ---
# If deduced from git, the name of the current branch is appended
# (after a `+' sign) version string, unless it is $(MAIN_BRANCH):
# MAIN_BRANCH = master
# Only consider tags with the following prefix as version strings.
# Take care: allowed characters should be restricted to alphanumeric,
# and the prefix should end with some kind of punctuation like a dash
# as below.
# VERSTAGS_PREFIX = someprefix-
# Uncomment to keep the prefix above in version strings.
# VERSTAGS_KEEP = yes
# ----------------------------------------------------------------------
# Leave this part as is:
-include generic.mk
GENERIC_MK = $(OPAM_PKGDEV_DIR)/generic.mk
generic.mk:
@if test -f $(GENERIC_MK); then ln -s $(GENERIC_MK) $@; \
elif test \! -f generic.mk; then echo \
"To build from this development tree, you first need to retrieve the" \
"$(OPAM_PKGDEV_DIR) submodule using \`git submodule update'." \
1>&2; exit 1; fi;
# -----------------------------------------------------------------------
# Insert further rules here:
# To be used in combination with a configure script, for instance.
.PHONY: distclean
distclean: force clean clean-version
$(QUIET)rm -f config.mk