-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (117 loc) · 4.1 KB
/
Makefile
File metadata and controls
147 lines (117 loc) · 4.1 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
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
147
######################################################################
# #
# Moca #
# #
# Pierre Weis, INRIA Rocquencourt #
# Frédéric Blanqui, projet Protheo, INRIA Lorraine #
# #
# Copyright 2005-2012, #
# Institut National de Recherche en Informatique et en Automatique. #
# All rights reserved. #
# #
# This file is distributed under the terms of the Q Public License. #
# #
######################################################################
# $Id: Makefile,v 1.64 2012-06-04 12:50:58 weis Exp $
# The general toplevel Makefile for moca
# (0) We include some configuration Makefiles.
# The basic configuration Makefile for this software (moca):
# config/Makefile.config defines PREFIX, SOFTWARE, and PACKAGE (here SOFTWARE
# is "moca" and PACKAGE is "mocac", the command installed by $(SOFTWARE).
# It also defines MAKEFILES_DIR as the absolute path of the directory where
# are the various Makefile templates. The definition is equivalent to
# MAKEFILES_DIR=./Mk
include config/Makefile.config
# The generic setup for Caml applications.
# This Make file defines useful variables for make,
# including macros for basic unix commands (for instance $(RM) is "rm -rf")
# and configuration for the Caml compiler.
# The caml compilers are defined as variables CAMLBYT (the byte-code
# compiler) and CAMLBIN (the optimizing copmiler).
include $(MAKEFILES_DIR)/Config.mk
# (1) We define some useful variables specific to the application.
# Versionning of $(PACKAGE) and $(SOFTWARE)
MAINVERSION=0
SUBVERSION=7
PATCHLEVEL=0
VERSION=$(MAINVERSION).$(SUBVERSION).$(PATCHLEVEL)
# Files that should be edited to change the version
COMPILERVERSIONFILES=compiler/driver/configuration.ml
DOCVERSIONFILES=doc_src/Includes/env
PACKAGEVERSIONFILES=$(COMPILERVERSIONFILES) $(DOCVERSIONFILES)
# Handling the automatic construction of $(PACKAGE)
SUBDIRS=compiler test
# (2) We define the default behaviour we want for make.
.PHONY: default all world compiler byt bin \
clean-test test examples tags clean version depend \
install installapp installdoc \
uninstall uninstallapp uninstalldoc
# (3) We define the targets specific to this Makefile.
default: compiler
all:: $(SUBDIRS)
world: $(SUBDIRS)
compiler: $(MAKEFILES_DIR)/Config.mk byt bin
$(MAKEFILES_DIR)/Config.mk: $(MAKEFILES_DIR)/Config.mk.in
cd $(MAKEFILES_DIR)/; ./configure
for i in $(SUBDIRS); do \
(cd $$i; $(MAKE) configure; cd ..) || exit $$?; \
done
byt:
cd compiler; $(MAKE) byt
$(LN) compiler/mocac.byt $(SOFTWARE)
bin:
cd compiler; $(MAKE) bin
$(LN) compiler/mocac.bin $(SOFTWARE)
tags:
otags -sr '.mli' -r compiler
examples:
if test -d examples; then \
(cd examples; $(MAKE) all); \
fi
clean-test:
if test -d test; then \
(cd test; $(MAKE) clean); \
fi
clean :: clean-test
test:
if test -d test; then \
(cd test; $(MAKE) depend; $(MAKE) byt); \
fi
alltest:
if test -d test; then \
(cd test; $(MAKE) depend; $(MAKE) all); \
fi
# Clean up
clean::
for i in $(SUBDIRS); do \
(if test -d $$i; then \
(echo $$i; cd $$i; $(MAKE) clean); \
fi) || exit $$?; \
done
find . -name '*~' | xargs $(RM)
$(RM) mocac
# Installation
install: installapp installdoc
installapp:
cd compiler; $(MAKE) install
installdoc:
if test -d doc; then \
(cd doc; $(MAKE) install); \
fi
# De-Installation
uninstall: uninstallapp uninstalldoc
uninstallapp:
cd compiler; $(MAKE) uninstall
uninstalldoc:
if test -d doc; then \
(cd doc; $(MAKE) uninstall); \
fi
# Dependencies
depend:
cd compiler; $(MAKE) depend
if test -d test; then \
(cd test; $(MAKE) depend); \
fi
if test -d examples; then \
(cd examples; $(MAKE) depend); \
fi