Codebase list bsdowl / 51c932e
Merge tag 'v3.0.0-20140213' into debian v3.0.0-20140213 Alaaf! Michael Grünewald 9 years ago
55 changed file(s) with 557 addition(s) and 634 deletion(s). Raw diff Collapse all Expand all
3131 SHARE+= bps.subdir.mk
3232 SHARE+= bps.files.mk
3333 SHARE+= bps.autoconf.mk
34 SHARE+= bps.replace.mk
3435 SHARE+= bps.project.mk
3536 SHARE+= bps.m4.mk
3637 SHARE+= bps.noweb.mk
8181 .if ${_BPS_SWITCH_CREDENTIALS_STRATEGY} == su
8282 @(cd ${.CURDIR} && ${SU} root -c '${MAKE} ${target}')
8383 .elif ${_BPS_SWITCH_CREDENTIALS_STRATEGY} == sudo
84 @(cd ${.CURDIR} && ${SUDO} ${MAKE} UID=0 ${target}>)
84 @(cd ${.CURDIR} && ${SUDO} ${MAKE} UID=0 ${target})
8585 .else
8686 @(cd ${.CURDIR} && ${MAKE} UID=0 ${target})
8787 .endif
181181 # Macro for copying entire directory tree with correct permissions
182182 .if ${UID} == 0
183183 COPYTREE_${group}=\
184 ${SH} -c '(${FIND} $$1 -depth $$3 | ${CPIO} -dumpl $$2 >/dev/null 2>&1) &&\
184 ${SH} -c '(${FIND} $$1 -depth $$3 | ${CPIO} -dump $$2 >/dev/null 2>&1) &&\
185185 ${CHOWN} -Rh ${${group}OWN}:${${group}GRP} $$2 &&\
186186 ${FIND} $$1 -depth $$3 -type d -exec ${CHMOD} 755 $$2/{} \; &&\
187187 ${FIND} $$1 -depth $$3 -type f -exec ${CHMOD} ${${group}MODE} $$2/{} \;'\
188188 COPYTREE_${group}
189189 .else
190190 COPYTREE_${group}=\
191 ${SH} -c '(${FIND} $$1 -depth $$3 | ${CPIO} -dumpl $$2 >/dev/null 2>&1) &&\
191 ${SH} -c '(${FIND} $$1 -depth $$3 | ${CPIO} -dump $$2 >/dev/null 2>&1) &&\
192192 ${FIND} $$1 -depth $$3 -type d -exec ${CHMOD} 755 $$2/{} \; &&\
193193 ${FIND} $$1 -depth $$3 -type f -exec ${CHMOD} ${${group}MODE} $$2/{} \;'\
194194 COPYTREE_${group}
190190 # .CURDIR.
191191 #
192192 #
193 # _MAKE_USERTARGET [configure obj depend build doc all
193 # _MAKE_USERTARGET [obj configure depend build doc all
194194 # install test clean distclean realclean benchmark]
195195 # The list of targets that are defined by every module.
196196 #
197197 #
198 # _MAKE_ALLSUBTARGET [configure depend build doc]
198 # _MAKE_ALLSUBTARGET [configure depend build doc test]
199199 # The list of subtargets of the all target.
200200
201201
336336 # Set _MAKE_USERTARGET and _MAKE_ALLSUBTARGET
337337 #
338338
339 _MAKE_USERTARGET?= configure obj depend build doc all install\
339 _MAKE_USERTARGET?= obj configure depend build doc all install\
340340 test clean distclean realclean benchmark
341341
342342 .if defined(MAKEOBJDIR)||defined(MAKEOBJDIRPREFIX)
343 _MAKE_ALLSUBTARGET?= configure obj depend build doc
343 _MAKE_ALLSUBTARGET?= obj configure depend build doc test
344344 .else
345 _MAKE_ALLSUBTARGET?= configure depend build doc
345 _MAKE_ALLSUBTARGET?= configure depend build doc test
346346 .endif
347347
348348 #
359359 .include "bps.own.mk"
360360 .include "bps.objdir.mk"
361361 .include "bps.autoconf.mk"
362 .include "bps.replace.mk"
362363 .include "bps.credentials.mk"
363364 .include "bps.noweb.mk"
364365 .include "bps.test-expected.mk"
343343 ${_NOTANGLE_TOOL.${file:T}} -R${.TARGET} ${.ALLSRC} | cpif ${.TARGET}
344344 .endfor
345345
346 .if defined(NOTANGLE) && !empty(NOTANGLE)
346347 do-clean-notangle:
347348 ${RM} -f ${NOTANGLE}
349 .else
350 do-clean-notangle:
351 ${NOP}
352 .endif
348353
349354 do-${NOWEB_CLEAN}: do-clean-notangle
350355
493498 .endfor
494499 .endfor
495500
501 .if defined(_NOWEAVE_OBJS) && !empty(_NOWEAVE_OBJS)
496502 do-clean-noweave:
497503 ${RM} -f ${_NOWEAVE_OBJS}
504 .else
505 do-clean-noweave:
506 ${NOP}
507 .endif
498508
499509 do-${NOWEB_CLEAN}: do-clean-noweave
500510
357357 SUBSHELLDIR?= ${.CURDIR}
358358 subshell: .PHONY
359359 ${INFO} "Entering developper's subshell"
360 @(cd ${SUBSHELLDIR} && ${ENVTOOL} ${PROJECTENV} ${SHELL})
360 @(cd ${.CURDIR} && cd ${SUBSHELLDIR} && ${ENVTOOL} ${PROJECTENV} ${SHELL})
361361 ${INFO} "Exiting developper's subshell"
362362
363363 # Remove the global product file before generating dependencies
0 ### bps.replace.mk -- Replace configuration variables
1
2 # Author: Michael Grünewald
3 # Date: Sat Jan 3 13:08:29 CET 2015
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2015 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16
17 ### SYNOPSIS
18
19 # REPLACESUBST= ${STDSUBST}
20 # REPLACESUBST+= VARIABLE1
21 # REPLACESUBST+= VARIABLE2
22 #
23 # REPLACEFILE+= configuration_values.in
24
25
26 ### DESCRIPTION
27
28 # Substitute placeholders of the form @variable@ with the expansion of
29 # variable. This mechanism can be used to replace configuration
30 # variables, typically listed in the Makefile.config file of the
31 # project.
32
33 # Variables:
34 #
35 # REPLACESUBST [not set]
36 # The list of variable to replace
37 #
38 #
39 # STDREPLACESUBST [a long list of typical autoconf variables]
40 # A pre-made list that can be added to REPLACESUBST
41 #
42 #
43 # REPLACEFILTER [set by initialisation strategy]
44 # A filter performing the replacement
45 #
46 # If REPLACESUBST is not set or empty, then REPLACEFILTER remains
47 # undefined.
48 #
49 #
50 # REPLACEFILE [not set]
51 # The list of file where substitutions are to be performed
52 #
53 # Each file in the list is subject to replacement. These files must
54 # have a name ending in .in, which is removed in the replaced file.
55
56
57 .if !target(__<bps.init.mk>__)
58 .error bps.replace.mk cannot be included directly.
59 .endif
60
61 .if !target(__<bps.replace.mk>__)
62 __<bps.replace.mk>__:
63
64 STDREPLACESUBST= PACKAGE
65 STDREPLACESUBST+= VERSION
66 STDREPLACESUBST+= prefix
67 STDREPLACESUBST+= exec_prefix
68 STDREPLACESUBST+= bindir
69 STDREPLACESUBST+= sbindir
70 STDREPLACESUBST+= libexecdir
71 STDREPLACESUBST+= datarootdir
72 STDREPLACESUBST+= datadir
73 STDREPLACESUBST+= sysconfdir
74 STDREPLACESUBST+= sharedstatedir
75 STDREPLACESUBST+= localstatedir
76 STDREPLACESUBST+= runstatedir
77 STDREPLACESUBST+= includedir
78 STDREPLACESUBST+= docdir
79 STDREPLACESUBST+= infodir
80 STDREPLACESUBST+= libdir
81 STDREPLACESUBST+= localedir
82 STDREPLACESUBST+= mandir
83
84 .if defined(REPLACESUBST)&&!empty(REPLACESUBST)
85 .for var in ${REPLACESUBST}
86 _REPLACE_SED_SCRIPT+= -e 's|@${var}@|${${var:S/|/\|/g}}|g'
87 .endfor
88 REPLACEFILTER?= ${SED} ${_REPLACE_SED_SCRIPT}
89 .endif
90
91 .if defined(REPLACEFILE)&&!empty(REPLACEFILE)
92 .if !empty(REPLACEFILE:N*.in)
93 .error Cannot process files ${REPLACEFILE:N*.in} in REPLACEFILE.
94 .endif
95 .for file in ${REPLACEFILE}
96 ${file:.in=}: ${file}
97 ${REPLACEFILTER} < ${.ALLSRC} > ${.TARGET}
98 DISTCLEANFILES+= ${file:.in=}
99 .endfor
100 .endif
101
102 .endif # !target(__<bps.replace.mk>__)
103
104 ### End of file `bps.replace.mk'
7777 .if !target(__<bps.subdir.mk>__)
7878 __<bps.subdir.mk>__:
7979
80 _SUBDIR_TARGET+= ${_MAKE_USERTARGET}
80 _SUBDIR_TARGET?= ${_MAKE_USERTARGET:Nall:Nconfigure}
8181 SUBDIR_PREFIX?=
8282
8383 .if defined(SUBDIR) && !empty(SUBDIR)
9595 _SUBDIR: .USE
9696 .for item in ${_SUBDIR_LIST}
9797 ${INFO} "${SUBDIR_PREFIX}${item} (${.TARGET:S/^do-//:S/-subdir$//})"
98 @cd ${.CURDIR}/${item}\
99 &&${MAKE} SUBDIR_PREFIX=${SUBDIR_PREFIX}${item}/ ${.TARGET:S/^do-//:S/-subdir$//}
98 @(cd ${.CURDIR}/${item}\
99 &&${MAKE} SUBDIR_PREFIX=${SUBDIR_PREFIX}${item}/\
100 ${.TARGET:S/^do-//:S/-subdir$//} )
100101 .endfor
101102
102103 ${_SUBDIR_LIST}::
103104 ${INFO} "${.TARGET} (all)"
104 @cd ${.CURDIR}/${.TARGET}; ${MAKE} all
105 @(cd ${.CURDIR}/${.TARGET}; ${MAKE} all)
105106
106107 .if defined(_SUBDIR_TARGET)&&!empty(_SUBDIR_TARGET)
107108 .for target in ${_SUBDIR_TARGET}
6262
6363 do-all-${target}: .USE
6464 @echo ${MAKE} ${target}
65 @cd ${.CURDIR} && ${MAKE} ${target}
65 @(cd ${.CURDIR} && ${MAKE} ${target})
6666 .endfor
6767
6868
00 dnl Process this file with autoconf to produce a configure script.
11 AC_INIT(bps/Makefile)
2 AC_SUBST([version], [3.0.0-20141228])
2 AC_SUBST([version], [3.0.0-20150213])
33 AC_CONFIG_AUX_DIR([Library/Autoconf])
44 AC_CANONICAL_HOST
55 AC_NEED_BSDMAKE()
0 bsdowl (3.0.0-20141228-1) UNRELEASED; urgency=medium
0 bsdowl (3.0.0-20140213-1) UNRELEASED; urgency=medium
11
22 * Update package to 3.0.0-20141203.
33 * Update package to 3.0.0-20141228.
4 * Update package to 3.0.0-20140228, which should have been
5 3.0.0-20150228.
46
5 -- Michael Grünewald <michipili@gmail.com> Fri, 20 Mar 2015 15:56:09 +0100
7 -- Michael Grünewald <michipili@gmail.com> Fri, 20 Mar 2015 16:03:23 +0100
68
79 bsdowl (2.2.2-1) unstable; urgency=medium
810
117117
118118 ### IMPLEMENTATION
119119
120
121 .if defined(MODULE)&&!empty(MODULE)
122 .if "${MODULE:O}" != "${MODULE:O:u}"
123 .error The MODULE variable lists redundant entries, this is an error.\
124 Please verify that the first module is assigned to the list\
125 with MODULE= and not MODULE+=.
126 .endif
127 .endif
128
129
120130 .if defined(MODULE)
121131 _SUBDIR_LIST+= ${MODULE:C@.*\:@@}
122132 .endif
1313 # are also available at
1414 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
1515
16 _MAKE_ALLSUBTARGET?=
17
1618 .include "bps.init.mk"
1719 .include "bps.credentials.mk"
1820 .include "bps.subdir.mk"
1921 .include "bps.clean.mk"
2022
23 _SUBDIR_TARGET?= ${_MAKE_USERTARGET}
24
2125 obj: do-obj-subdir
2226
27 .unexport SRCDIR
28 .unexport WRKDIR
29 .unexport PACKAGE
30 .unexport PACKAGEDIR
31 .unexport VERSION
32 .unexport OFFICER
33 .unexport MODULE
34 .unexport EXTERNAL
35
2336 ### End of file `generic.subdir.mk'
245245 .undef clib
246246 .endif
247247 .if (empty(_OCAML_CMO)||empty(_OCAML_CMO:M${obj}))\
248 &&(empty(_OCAML_CMX)||empty(_OCAML_CMX:M${obj}))\
249 &&(empty(_OCAML_CMXS)||empty(_OCAML_CMXS:M${obj}))
248 &&(empty(_OCAML_CMX)||empty(_OCAML_CMX:M${obj}))
250249 # We are not building a CMO nor a CMX file
251250 ${obj}:
252251 ${_OCAML_BUILD.${obj:T}} ${.ALLSRC:N*.cmi}
253252 .else
254253 # We are building a CMO or a CMX file
255 if:=${obj:C/.cm[xo]/.cmi/:C/.cmxs/.cmi/}
254 if:=${obj:C/.cm[xo]/.cmi/}
256255 .if !(empty(_OCAML_CMI)||empty(_OCAML_CMI:M${if}))
257256 ${obj}: ${if}
258257 ${obj}:
3030 .endfor
3131
3232 .for external_arg in ${_EXTERNAL_ocaml.lib_ARGS}
33 .if defined(_EXTERNAL_ocaml.lib_${external_arg}_DIR)
34 DIRS+= ${_EXTERNAL_ocaml.lib_${external_arg}_DIR}
35 .endif
36 .if !defined(_EXTERNAL_ocaml.lib_${external_arg}_BYTE)\
37 &&!defined(_EXTERNAL_ocaml.lib_${external_arg}_NATIVE)
3338 _EXTERNAL_LIBS+= ${external_arg}
34 .if defined(_EXTERNAL_ocaml.lib_${external_arg}_DIRS)
35 DIRS+= ${_EXTERNAL_ocaml.lib_${external_arg}_DIRS}
39 .endif
40 .if defined(_EXTERNAL_ocaml.lib_${external_arg}_BYTE)
41 OCAMLLBADD+= ${_EXTERNAL_ocaml.lib_${external_arg}_BYTE}
42 OCAMLABADD+= ${_EXTERNAL_ocaml.lib_${external_arg}_BYTE}
43 .endif
44 .if defined(_EXTERNAL_ocaml.lib_${external_arg}_NATIVE)
45 OCAMLLNADD+= ${_EXTERNAL_ocaml.lib_${external_arg}_NATIVE}
46 OCAMLANADD+= ${_EXTERNAL_ocaml.lib_${external_arg}_NATIVE}
47 OCAMLCSADD+= ${_EXTERNAL_ocaml.lib_${external_arg}_NATIVE}
3648 .endif
3749 .endfor
3850
9898 _OCAML_A+= ${lib:T}.a
9999 _OCAML_SRCS.${lib:T}.cmxa+=\
100100 ${SRCS.${lib}.cmxa:C@\.ml[ly]@.ml@:M*.ml:.ml=.cmx}
101 LIB+= ${lib}.cmxa ${lib}.a
101 LIB+= ${lib:T}.cmxa ${lib:T}.a
102102 .endif
103103 .if defined(_OCAML_COMPILE_NATIVE)&&defined(_OCAML_COMPILE_PLUGIN)
104 _OCAML_CMXS+= ${SRCS.${lib}.cmxa:C@\.ml[ly]@.ml@:M*.ml:.ml=.cmxs}
104 _OCAML_CMXS+= ${lib:T}.cmxs
105 LIB+= ${lib:T}.cmxs
106 CLEANFILES+= ${lib:T}.cmxs
107 _OCAML_SRCS.${lib:T}.cmxs+=\
108 ${_OCAML_SRCS.${lib:T}.cmxa}
105109 .endif
106110 .if defined(_OCAML_COMPILE_BYTE)
107111 SRCS.${lib:T}.cma?= ${SRCS.${lib:T}}
108 _OCAML_SRCS+= SRCS.${lib}.cma
112 _OCAML_SRCS+= SRCS.${lib:T}.cma
109113 _OCAML_CMA+= ${lib:T}.cma
110114 _OCAML_SRCS.${lib:T}.cma+=\
111115 ${SRCS.${lib:T}.cma:C@\.ml[ly]@.ml@:M*.ml:.ml=.cmo}
116120 .endif
117121 .endfor
118122
119 .if !empty(_OCAML_CMXS)
120 LIB+= ${_OCAML_CMXS}
121 CLEANFILES+= ${_OCAML_CMXS}
122 .endif
123
124123 .include "ocaml.main.mk"
125
126 .if !empty(_OCAML_CMXS)
127 .for plugin in ${_OCAML_CMXS}
128 ${plugin}: ${plugin:.cmxs=.ml}
129 .endfor
130 .endif
131
132124
133125 .for lib in ${_OCAML_LIB}
134126 .if defined(_OCAML_COMPILE_NATIVE)
135 ${lib}.cmxa: ${_OCAML_SRCS.${lib}.cmxa}
127 ${lib:T}.cmxa: ${_OCAML_SRCS.${lib:T}.cmxa}
136128 .endif
137129 .if defined(_OCAML_COMPILE_BYTE)
138 ${lib}.cma: ${_OCAML_SRCS.${lib:T}.cma}
130 ${lib:T}.cma: ${_OCAML_SRCS.${lib:T}.cma}
131 .endif
132 .if defined(_OCAML_COMPILE_NATIVE)&&defined(_OCAML_COMPILE_PLUGIN)
133 ${lib:T}.cmxs: ${_OCAML_SRCS.${lib:T}.cmxs}
139134 .endif
140135 .endfor
141136
148143 .include "bps.files.mk"
149144 .include "bps.usertarget.mk"
150145
146 .if !target(display-ocaml-lib)
147 display-ocaml-lib:
148 ${INFO} 'Display ocaml.lib information'
149 .for displayvar in LIBRARY
150 ${MESG} "${displayvar}=${${displayvar}}"
151 .endfor
152 .for lib in ${LIBRARY}
153 .for suffix in cma cmxa cmxs
154 .for displayvar in _OCAML_SRCS.${lib:T}.${suffix}
155 ${MESG} "${displayvar}=${${displayvar}}"
156 .endfor
157 .endfor
158 .endfor
159 .endif
160
151161 ### End of file `ocaml.lib.mk'
1818
1919 # TOPLEVEL= toplevel
2020 # SRCS= initialize_toplevel.ml
21 # LIBS= unix
22 # LIBS+= str
2321 #
2422 # .include "ocaml.toplevel.mk"
2523
7472 # Pass the given library names to the C linker
7573 #
7674 # This forces TOPLEVEL_CUSTOM to yes.
75 #
76 #
77 # TOPLEVEL_FLAGS
78 # Flags passed to ocamlmktop
7779
7880
7981 ### IMPLEMENTATION
8991 .error The ocaml.toplevel.mk module expects you to set the TOPLEVEL variable to a sensible value.
9092 .endif
9193
92 TOPLEVEL_CUSTOM?= no
93 TOPLEVEL_COPT?=
94 TOPLEVEL_CLIB?=
94 .if defined(TOPLEVEL_COPT)||defined(TOPLEVEL_CLIB)
95 TOPLEVEL_CUSTOM?= yes
96 .elif defined(SRCS)&&!empty(SRCS:M*.c)
97 TOPLEVEL_CUSTOM?= yes
98 .else
99 TOPLEVEL_CUSTOM?= no
100 .endif
95101
96 OCAMLMKTOP?=ocamlmktop
102 OCAMLMKTOP?= ocamlmktop
97103
98 _TOPLEVEL_FLAGS=-custom -linkall
99104
100105 #
101106 # Determining toplevel flags
102107 #
103108
104 .if defined(TOPLEVEL_COPT)&&!empty(TOPLEVEL_COPT)
105 TOPLEVEL_CUSTOM=yes
109 .if ${TOPLEVEL_CUSTOM} == yes
110 .if !defined(TOPLEVEL_FLAGS)||empty(TOPLEVEL_FLAGS:M-custom)
111 TOPLEVEL_FLAGS+= -custom
106112 .endif
107
108 .if defined(TOPLEVEL_CLIB)&&!empty(TOPLEVEL_CLIB)
109 TOPLEVEL_CUSTOM=yes
110 .endif
111
112 .if ${TOPLEVEL_CUSTOM} == yes
113 _TOPLEVEL_FLAGS+=-custom
114113 .endif
115114
116115 .if defined(TOPLEVEL_COPT)&&!empty(TOPLEVEL_COPT)
117116 .for item in ${TOPLEVEL_COPT}
118 _TOPLEVEL_FLAGS+=-ccopt ${item}
117 TOPLEVEL_FLAGS+= -ccopt ${item}
119118 .endfor
120119 .endif
121120
122121 .if defined(TOPLEVEL_CLIB)&&!empty(TOPLEVEL_CLIB)
123122 .for item in ${TOPLEVEL_CLIB}
124 _TOPLEVEL_FLAGS+=-cclib -l${item}
123 TOPLEVEL_FLAGS+= -cclib -l${item}
125124 .endfor
126125 .endif
127126
128127 .if defined(DIRS)&&!empty(DIRS)
129128 .for item in ${DIRS}
130 _TOPLEVEL_FLAGS+=-I ${item}
129 TOPLEVEL_FLAGS+= -I ${item}
131130 .endfor
132131 .endif
133132
134133
135134 .if !defined(_OCAML_COMPILE_NATIVE_ONLY)
136135
137 .for file in ${SRCS}
138 _OCAML_CMO+= ${file:.ml=.cmo}
136 .for file in ${SRCS:M*.ml}
137 _OCAML_CMO+= ${file:.ml=.cmo}
139138 ${TOPLEVEL}: ${file:.ml=.cmo}
140139 .endfor
140
141 .for file in ${SRCS:M*.c}
142 ${TOPLEVEL}: ${file:.c=.o}
143 CLEANFILES+= ${file:.c=.o}
144 .endfor
145
146 .if defined(SRCS)&&!empty(SRCS:M*.c)
147 CFLAGS+= -I ${OCAMLROOTDIR}
148 .endif
141149
142150 .for file in ${LIBS}
143151 ${TOPLEVEL}: ${file:=.cma}
144152 .endfor
145153
146154 ${TOPLEVEL}:
147 ${OCAMLMKTOP} ${_TOPLEVEL_FLAGS} ${.ALLSRC} -o ${.TARGET}
155 ${OCAMLMKTOP} ${TOPLEVEL_FLAGS} -o ${.TARGET} ${.ALLSRC}
148156
149157 CLEANFILES+= ${TOPLEVEL}
150158 BIN+= ${TOPLEVEL}
151159
152160 .else
153 ${TOPLEVEL}:
161 ${TOPLEVEL}: .PHONY
154162 ${INFO} Not building toplevel ${.TARGET} in native-only mode
155163 .endif
164
165 display-developer-dirs: .PHONY
166 .for dir in ${DIRS}
167 @printf '#directory "%s";;\n' "${dir}"
168 .endfor
156169
157170 .include "ocaml.main.mk"
158171 .include "bps.clean.mk"
159172 .include "bps.files.mk"
160173 .include "bps.usertarget.mk"
161174
162 ### End of file `ocaml.odoc.mk'
175 ### End of file `ocaml.toplevel.mk'
4949
5050 PRODUCT= ${PROGRAM:C@\.py$@@}
5151 _PACKAGE_CANDIDATE= ${PRODUCT}
52 REPLACE+= PYTHON
53 REPLACE+= ${STDREPLACE}
54 REPLACE+= ${BINDIR}
52 REPLACESUBST+= PYTHON
53 REPLACESUBST+= ${STDREPLACESUBST}
54 REPLACESUBST+= BINDIR
5555
5656 .for product in ${PRODUCT}
5757 _MAN_AUTO+= ${product}.1
0 ### script.shell.mk -- Development of shell scripts
0 ### script.main.mk -- Development of shell scripts
11
22 # Author: Michael Grünewald
33 # Date: Fri Feb 10 10:40:49 GMT 2006
1616
1717 ### SYNOPSIS
1818
19 # SCRIPT= mp2eps.sh
20 # SCRIPT+= mp2pdf.sh
21 # SCRIPT+= mp2png.sh
19 # PROGRAM= mp2eps.sh
20 # PROGRAM+= mp2pdf.sh
21 # PROGRAM+= mp2png.sh
2222 #
23 # SCRIPTLIB+= mp2pnglib.sh
23 # SUBR+= mp2pnglib.sh
2424 #
2525 #
26 # TMPDIR= /var/run/tmp
26 # tmpdir= /var/run/tmp
2727 #
28 # REPLACE= PREFIX TMPDIR
28 # REPLACESUBST= ${STDREPLACESUBST}
2929 #
30 # .include "script.shell.mk"
30 # .include "script.main.mk"
3131
3232
3333 ### DESCRIPTION
6666 # List of script subroutine libraries to install
6767 #
6868 #
69 # SUBRDIR [${SHAREDIR}${PACKAGEDIR}]
69 # SUBRDIR [${datadir}${PACKAGEDIR}]
7070 # List of script libraries to install
7171 #
7272 # The variables SUBRDIR, SUBRMODE, SUBROWN and
7373 # SUBRGRP parametrise the installation.
7474 #
7575 # The SUBRDIR variable defaults to
76 # `${SHAREDIR}${PACKAGEDIR}` but other sensible locations could
77 # be `${LIBDIR}/perl5/5.12.4${PACKAGEDIR}`.
76 # `${datadir}${PACKAGEDIR}` but other sensible locations could
77 # follow another pattern, like for instance
78 # `${libdir}/perl5/5.12.4${PACKAGEDIR}`.
7879 #
7980 #
80 # REPLACE [not set]
81 # REPLACESUBST [not set]
8182 # List of variables to be replaced in the preparation step
8283 #
8384 # The pipe character `|` must not appear in replacement text of the
8485 # variables enumerated by REPLACE.
8586 #
86 # STDREPLACE [see description]
87 #
88 # STDREPLACESUBST [see description]
8789 # The standard replacement list
8890
8991
9395 .error shell.main.mk cannot be included directly.
9496 .endif
9597
96 .if !target(__<script.shell.mk>__)
97 __<script.shell.mk>__:
98 .if !target(__<script.main.mk>__)
99 __<script.main.mk>__:
98100
99101 .include "bps.init.mk"
100
101
102 #
103 # Replacement of variables
104 #
105
106 STDREPLACE= PACKAGE
107 STDREPLACE+= VERSION
108 STDREPLACE+= prefix
109 STDREPLACE+= exec_prefix
110 STDREPLACE+= bindir
111 STDREPLACE+= sbindir
112 STDREPLACE+= libexecdir
113 STDREPLACE+= datarootdir
114 STDREPLACE+= datadir
115 STDREPLACE+= sysconfdir
116 STDREPLACE+= sharedstatedir
117 STDREPLACE+= localstatedir
118 STDREPLACE+= runstatedir
119 STDREPLACE+= includedir
120 STDREPLACE+= docdir
121 STDREPLACE+= infodir
122 STDREPLACE+= libdir
123 STDREPLACE+= localedir
124 STDREPLACE+= mandir
125
126 .if defined(REPLACE)&&!empty(REPLACE)
127 .for var in ${REPLACE}
128 _SCRIPT_SED+= -e 's|@${var}@|${${var:S/|/\|/g}}|g'
129 .endfor
130 .endif
131102
132103
133104 #
144115 .for script in ${PROGRAM:M*.${ext}}
145116 CLEANFILES+= ${script:T:.${ext}=}
146117 buildfiles: ${script:T:.${ext}=}
147 .if defined(_SCRIPT_SED)
118 .if defined(REPLACEFILTER)
148119 ${script:T:.${ext}=}: ${script}
149 ${SED} ${_SCRIPT_SED} < ${.ALLSRC} > ${.TARGET}.output
150 ${MV} ${.TARGET}.output ${.TARGET}
120 ${REPLACEFILTER} < ${.ALLSRC} > ${.TARGET}
151121 .else
152122 ${script:T:.${ext}=}: ${script}
153123 ${CP} ${.ALLSRC} ${.TARGET}
188158 .include "bps.clean.mk"
189159 .include "bps.usertarget.mk"
190160
191 .endif #!target(__<script.shell.mk>__)
161 .endif #!target(__<script.main.mk>__)
192162
193 ### End of file `script.shell.mk'
163 ### End of file `script.main.mk'
3939
4040 PRODUCT= ${LIBRARY:C@\.(sh|bash|ksh|csh|awk|sed|subr)$@@}
4141 _PACKAGE_CANDIDATE= ${PRODUCT}
42 REPLACE+= ${STDREPLACE}
43 REPLACE+= SUBRDIR
42 REPLACESUBST+= ${STDREPLACESUBST}
43 REPLACESUBST+= SUBRDIR
4444
4545 .for product in ${PRODUCT}
4646 _MAN_AUTO+= ${product}.3
2828 # is a single word or from the last component of SRCDIR otherwise.
2929 #
3030 #
31 # SUBR
32 # List of script subroutine libraries to install
33 #
34 #
35 # SUBRDIR [${datadir}${PACKAGEDIR}]
36 # List of script libraries to install
37 #
38 # The variables SUBRDIR, SUBRMODE, SUBROWN and
39 # SUBRGRP parametrise the installation.
40 #
41 # The SUBRDIR variable defaults to
42 # `${datadir}${PACKAGEDIR}` but other sensible locations could
43 # follow another pattern, like for instance
44 # `${libdir}/perl5/5.12.4${PACKAGEDIR}`.
45 #
46 #
3147 # BINOWN, BINGRP, BINMODE, BINDIR, BINNAME
3248 # Parameters of the program installation
3349 #
4561
4662 PRODUCT= ${PROGRAM:C@\.(sh|bash|ksh|csh|awk|sed)$@@}
4763 _PACKAGE_CANDIDATE= ${PRODUCT}
48 REPLACE+= ${STDREPLACE}
49 REPLACE+= ${BINDIR}
64 REPLACESUBST+= ${STDREPLACESUBST}
65 REPLACESUBST+= BINDIR
5066
5167 .for product in ${PRODUCT}
5268 _MAN_AUTO+= ${product}.1
+0
-38
testsuite/Attic/ocaml/.gitignore less more
0 *.o
1 *.a
2 *.byte
3 *.native
4 *.cmo
5 *.cmx
6 basic/basic_lexer.ml
7 basic/basic_parser.ml
8 basic/basic_parser.mli
9 basic/minibasic
10 newton-doc/newtontk.odoc
11 newton-doc/newtontk_html/
12 ocamlfind/wordcount
13 toplevel/toplevel
14 wordcount-1/wordcount
15 wordcount-2/wordcount
16 basic-1/basic_lexer.ml
17 basic-1/basic_parser.ml
18 basic-1/basic_parser.mli
19 basic-1/minibasic
20 basic-2/basic_lexer.ml
21 basic-2/basic_parser.ml
22 basic-2/basic_parser.mli
23 basic-2/minibasic
24 golden-ratio/golden-ratio
25 basic-3/basic_lexer.ml
26 basic-3/basic_parser.ml
27 basic-3/basic_parser.mli
28 basic-4/basic_lexer.ml
29 basic-4/basic_parser.ml
30 basic-4/basic_parser.mli
31 golden_ratio/golden_ratio
32 miniproj-1/golden_ratio/golden_ratio
33 miniproj-2/golden_ratio/golden_ratio
34 miniproj-2/manual/golden_ratio_html/
35 miniproj-3/golden_ratio/golden_ratio
36 miniproj-3/manual/golden_ratio_html/
37 objdir/
+0
-82
testsuite/Attic/ocaml/Makefile less more
0 ### Makefile -- Test OCaml support
1
2 # Author: Michael Grünewald
3 # Date: Fri Oct 4 20:54:55 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 SUBDIR= wordcount-1
17 SUBDIR+= wordcount-2
18 SUBDIR+= fibonacci
19 SUBDIR+= newton
20 SUBDIR+= newton-doc
21 SUBDIR+= toplevel
22 SUBDIR+= basic-1
23 SUBDIR+= basic-2
24 SUBDIR+= basic-3
25 SUBDIR+= basic-4
26 SUBDIR+= ocamlfind
27 SUBDIR+= golden_ratio
28 SUBDIR+= miniproj-1
29 SUBDIR+= miniproj-2
30 SUBDIR+= miniproj-3
31
32 #
33 # Test setup
34 #
35
36 COMPILE?= byte_code
37
38 TESTENV= ${ENVTOOL} -i "PATH=${PATH}" "COMPILE=${COMPILE}"
39 TESTENV+= "MAKEFLAGS=${MAKEFLAGS:NPACKAGE*:NPROJECT*}"
40
41 test-clean:
42 ${TESTENV} ${MAKE} realclean
43
44 test-base:
45 ${TESTENV} ${MAKE} all
46 ${TESTENV} ${MAKE} realclean
47
48 test-doc:
49 ${TESTENV} ${MAKE} doc
50 ${TESTENV} ${MAKE} realclean
51
52 test-parallel:
53 ${TESTENV} ${MAKE} depend
54 ${TESTENV} ${MAKE} -j4 build
55 ${TESTENV} ${MAKE} realclean
56
57 test-objdir:
58 ${INSTALL_DIR} ${.CURDIR}/objdir
59 ${TESTENV} MAKEOBJDIRPREFIX=${.CURDIR}/objdir ${MAKE}
60 test -r ${.CURDIR}/objdir/${.CURDIR}/basic-1/.depend
61 test -r ${.CURDIR}/objdir/${.CURDIR}/basic-1/basic_lexer.ml
62 test -r ${.CURDIR}/objdir/${.CURDIR}/basic-1/basic_parser.ml
63 test -r ${.CURDIR}/objdir/${.CURDIR}/basic-1/basic_parser.mli
64 test -x ${.CURDIR}/objdir/${.CURDIR}/golden_ratio/golden_ratio
65
66 test-compile:
67 ${TESTENV} COMPILE="byte_code" ${MAKE} test
68 ${TESTENV} COMPILE="native_code" ${MAKE} test
69 ${TESTENV} COMPILE="both" ${MAKE} test
70
71 CLEANDIRS+= ${.CURDIR}/objdir
72
73 test: test-clean
74 test: test-base
75 test: test-doc
76 test: test-parallel
77 test: test-objdir
78
79 .include "bps.subdir.mk"
80
81 ### End of file `Makefile'
+0
-36
testsuite/Attic/ocaml/golden_ratio/Makefile less more
0 ### Makefile -- Computing the golden ratio
1
2 # Author: Michael Grünewald
3 # Date: Sat Oct 5 20:47:48 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 PROGRAM= golden_ratio
17
18 SRCS= main.ml
19
20 LIBS+= nums
21 LIBS+= newton
22 LIBS+= fibonacci
23
24 DIRS= ${.OBJDIR}/../newton
25 DIRS+= ${.OBJDIR}/../fibonacci
26
27 newton.cma:
28 @cd ${.CURDIR}/../newton && ${MAKE} ${.TARGET}
29
30 fibonacci.cma:
31 @cd ${.CURDIR}/../fibonacci && ${MAKE} ${.TARGET}
32
33 .include "ocaml.prog.mk"
34
35 ### End of file `Makefile'
+0
-9
testsuite/Attic/ocaml/golden_ratio/main.ml less more
0 open Printf
1
2 let rec loop iter n x =
3 printf "%02d %12.8f %s\n" n x (Fibonacci.phi_string n);
4 if n < iter then
5 loop iter (succ n) (Newton.phi_iter x)
6
7 let () =
8 loop 20 0 1.0
+0
-3
testsuite/Attic/ocaml/miniproj-3/Library/Ancillary/codemetrics less more
0 #!/bin/sh
1 : ${PROJECTBASE:?}
2 find ${PROJECTBASE} -name '*.ml' | xargs wc
+0
-2
testsuite/Attic/ocaml/miniproj-3/Library/Mk/Makefile.debug less more
0 WITH_DEBUG=yes
1 PROJECTEXPORT+= WITH_DEBUG
+0
-2
testsuite/Attic/ocaml/miniproj-3/Library/Mk/Makefile.profile less more
0 WITH_PROFILE=yes
1 PROJECTEXPORT+= WITH_PROFILE
+0
-0
testsuite/Attic/ocaml/miniproj-3/Library/Mk/Makefile.release less more
(Empty file)
+0
-35
testsuite/Attic/ocaml/miniproj-3/Makefile less more
0 ### Makefile -- Mini project
1
2 # Author: Michael Grünewald
3 # Date: Sun Oct 13 10:50:45 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 PROJECT= golden_ratio
17 VERSION= 1.0
18 AUTHOR= Michael Grünewald
19
20 SUBDIR+= fibonacci
21 SUBDIR+= newton
22 SUBDIR+= golden_ratio
23 SUBDIR+= manual
24
25 PROJECTSETUP= debug profile release
26
27 universe:
28 .for setup in ${PROJECTSETUP}
29 ${ENVTOOL} MAKEINITRC=Makefile.${setup} MAKEOBJDIR=${.CURDIR}/obj/${setup} ${MAKE} all
30 .endfor
31
32 .include "bps.project.mk"
33
34 ### End of file `Makefile'
+0
-27
testsuite/Attic/ocaml/miniproj-3/fibonacci/Makefile less more
0 ### Makefile -- Newton's method
1
2 # Author: Michael Grünewald
3 # Date: Sat Oct 5 20:40:24 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 LIBRARY= fibonacci
17 SRCS+= fibonacci.ml
18
19 LIBS= nums
20
21 USE_ODOC= yes
22 ODOC_FORMAT= odoc
23
24 .include "ocaml.lib.mk"
25
26 ### End of file `Makefile'
+0
-30
testsuite/Attic/ocaml/miniproj-3/fibonacci/fibonacci.ml less more
0 (* Fibonacci -- Compute Fibonacci numbers
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12 open Num
13
14 let rec fibo_num n =
15 match n with
16 | 0 -> Int 1
17 | 1 -> Int 1
18 | n -> add_num (fibo_num (n-1)) (fibo_num(n-2))
19
20 let calc n =
21 if n < 0 then
22 invalid_arg "Fibonacci.calc"
23 else
24 fibo_num n
25
26 let phi_string n =
27 let p, q = calc (n+1), calc n in
28 let phi = div_num p q in
29 approx_num_fix 8 phi
+0
-20
testsuite/Attic/ocaml/miniproj-3/fibonacci/fibonacci.mli less more
0 (* Fibonacci -- Compute Fibonacci numbers
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12
13 (** Compute Fibonacci numbers.
14
15 The 0-th and 1-st Fibonacci numbers [F_0] and [F_1] are 1, and then [F_n+2
16 = F_n + F_n+1]. *)
17 val calc : int -> Num.num
18
19 val phi_string : int -> string
+0
-31
testsuite/Attic/ocaml/miniproj-3/golden_ratio/Makefile less more
0 ### Makefile -- Computing the golden ratio
1
2 # Author: Michael Grünewald
3 # Date: Sat Oct 5 20:47:48 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 PROGRAM= golden_ratio
17
18 SRCS= main.ml
19
20 LIBS+= nums
21 LIBS+= newton
22 LIBS+= fibonacci
23
24 DIRS= ${.OBJDIR}/../newton
25 DIRS+= ${.OBJDIR}/../fibonacci
26
27
28 .include "ocaml.prog.mk"
29
30 ### End of file `Makefile'
+0
-9
testsuite/Attic/ocaml/miniproj-3/golden_ratio/main.ml less more
0 open Printf
1
2 let rec loop iter n x =
3 printf "%02d %12.8f %s\n" n x (Fibonacci.phi_string n);
4 if n < iter then
5 loop iter (succ n) (Newton.phi_iter x)
6
7 let () =
8 loop 20 0 1.0
+0
-22
testsuite/Attic/ocaml/miniproj-3/manual/Makefile less more
0 ### Makefile -- Preparation of the golden_ratio manual
1
2 # Author: Michael Grünewald
3 # Date: Tue Oct 15 21:37:11 CEST 2013
4
5 # Copyright (c) 2013 Michael Grünewald
6 # All rights reserved.
7 #
8 # This file is part of Waermondt.
9
10
11 ODOC_TITLE= Golden Ratio
12
13 DIRS+= ../newton
14 MANUAL+= newton.odoc
15
16 DIRS+= ../fibonacci
17 MANUAL+= fibonacci.odoc
18
19 .include "ocaml.manual.mk"
20
21 ### End of file `Makefile'
+0
-25
testsuite/Attic/ocaml/miniproj-3/newton/Makefile less more
0 ### Makefile -- Newton's method
1
2 # Author: Michael Grünewald
3 # Date: Thu Oct 3 23:39:20 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 LIBRARY= newton
17 SRCS+= newton.ml
18
19 USE_ODOC= yes
20 ODOC_FORMAT= odoc
21
22 .include "ocaml.lib.mk"
23
24 ### End of file `Makefile'
+0
-20
testsuite/Attic/ocaml/miniproj-3/newton/newton.ml less more
0 (* Newton -- Newton's method
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12
13 let iter dx f x0 =
14 let y = f x0 in
15 let dy= (f(x0 +. dx) -. y) in
16 x0 -. dx *. y /. dy
17
18 let phi_iter x0 =
19 (x0 *. x0 +. 1.0) /. (2.0 *. x0 -. 1.0)
+0
-24
testsuite/Attic/ocaml/miniproj-3/newton/newton.mli less more
0 (* Newton -- Newton's method
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12
13 (** Newton's method. *)
14
15 val iter : float -> (float -> float) -> float -> float
16 (** [iter dx f x0] is the Newton iterate obtained by applying one time
17 Newton's method to [f] and [x0], using the infinitesimal [dx].
18
19 It assumes the function [f] is defined for every real number. *)
20
21 val phi_iter : float -> float
22 (** [phi_iter x0] is the Newton iterate following [x0] and converging
23 the golden ratio [phi]. *)
+0
-25
testsuite/Attic/ocaml/toplevel/Makefile less more
0 ### Makefile -- Custom toplevel
1
2 # Author: Michael Grünewald
3 # Date: Fri Oct 4 08:23:21 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 TOPLEVEL= toplevel
17 SRCS+= initialise_toplevel.ml
18
19 LIBS+= unix
20 LIBS+= str
21
22 .include "ocaml.toplevel.mk"
23
24 ### End of file `Makefile'
+0
-1
testsuite/Attic/ocaml/toplevel/initialise_toplevel.ml less more
0 (* nop *)
+0
-24
testsuite/Attic/ocaml/wordcount-2/Makefile less more
0 ### Makefile -- Counting characters and lines in a file
1
2 # Author: Michael Grünewald
3 # Date: Fri Oct 4 06:52:41 CEST 2013
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2014 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 PROGRAM= wordcount
17
18 SRCS+= ancillary.ml
19 SRCS+= application.ml
20
21 .include "ocaml.prog.mk"
22
23 ### End of file `Makefile'
+0
-30
testsuite/Attic/ocaml/wordcount-2/ancillary.ml less more
0 (* Ancillary -- Count characters and words on stdin
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12
13 let is_word c =
14 (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
15
16 let rec wc chan wordflag nc nw nl =
17 let next =
18 try Some(input_char chan)
19 with End_of_file -> None
20 in
21 match next with
22 | Some '\n' -> wc chan false (succ nc) nw (succ nl)
23 | Some c -> ( match is_word c, wordflag with
24 | true, true
25 | false, false -> wc chan wordflag (succ nc) nw nl
26 | true, false -> wc chan true (succ nc) (succ nw) nl
27 | false, true -> wc chan false (succ nc) nw nl
28 )
29 | None -> (nc, nw, nl)
+0
-18
testsuite/Attic/ocaml/wordcount-2/application.ml less more
0 (* Application -- Count characters and words on stdin
1
2 BSD Owl Scripts (https://github.com/michipili/bsdowl)
3 This file is part of BSD Owl Scripts
4
5 Copyright © 2005–2014 Michael Grünewald
6
7 This file must be used under the terms of the CeCILL-B.
8 This source file is licensed as described in the file COPYING, which
9 you should have received as part of this distribution. The terms
10 are also available at
11 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
12
13 let main () =
14 let (nc, nw, nl) = Ancillary.wc stdin false 0 0 1 in
15 Printf.printf "%d %d %d\n" nc nw nl
16
17 let () = main ()
1717 SUBDIR= test_program
1818 SUBDIR+= test_library
1919 SUBDIR+= test_complex
20 SUBDIR+= test_toplevel
2021
2122 .include "generic.subdir.mk"
2223
1919 TEST+= TestProgramProfile
2020 TEST+= TestProgramMultiple
2121 TEST+= TestProgramLexerParser
22 TEST+= TestProgramExternalOCaml
2223
2324 .if "${WITH_TESTSUITE_FINDLIB}" == "yes"
2425 TEST+= TestProgramExternalFindlib
0 ### TestProgramExternalOCaml.mk -- How does it feel?
1
2 # Author: Michael Grünewald
3 # Date: Fri Jan 9 09:06:51 CET 2015
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2015 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 PROGRAM= rolling_stone
17 EXTERNAL= ocaml.lib:unix
18
19 _EXTERNAL_ocaml.lib_unix_DIR= ${ocamllibdir}/ocaml
20 _EXTERNAL_ocaml.lib_unix_BYTE= unix.cma
21 _EXTERNAL_ocaml.lib_unix_NATIVE=unix.cmxa
22
23 test:
24 test -x ${DESTDIR}${BINDIR}/rolling_stone
25
26 .include "ocaml.prog.mk"
27
28 ### End of file `TestProgramExternalOCaml.mk'
0 ### Makefile -- Test features of module ocaml.toplevel
1
2 # Author: Michael Grünewald
3 # Date: Sun Dec 28 18:14:15 CET 2014
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2015 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 TEST= TestToplevel
17 TEST+= TestToplevelCustom
18
19 .include "bsdowl.test.mk"
20
21 ### End of file `Makefile'
0 ### TestToplevel.mk -- Prepare an OCaml toplevel
1
2 # Author: Michael Grünewald
3 # Date: Sun Dec 28 18:15:21 CET 2014
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2015 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 TOPLEVEL= custom_toplevel
17
18 EXTERNAL+= ocaml.findlib:compiler-libs
19
20 SRCS= custom_configuration.ml
21 SRCS+= custom_library.ml
22 SRCS+= custom_bootstrap.ml
23
24 REPLACESUBST= ${STDREPLACESUBST}
25 REPLACEFILE= custom_configuration.ml.in
26
27 test:
28 test -x ${DESTDIR}${BINDIR}/custom_toplevel
29
30 .include "ocaml.toplevel.mk"
31
32 ### End of file `TestToplevel.mk'
0 ### TestToplevelCustom.mk -- Prepare an OCaml custom toplevel
1
2 # Author: Michael Grünewald
3 # Date: Sat Jan 3 16:18:30 CET 2015
4
5 # BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 # This file is part of BSD Owl Scripts
7 #
8 # Copyright © 2005–2015 Michael Grünewald
9 #
10 # This file must be used under the terms of the CeCILL-B.
11 # This source file is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
15
16 TOPLEVEL= custom_toplevel
17
18 SRCS= greeting.ml
19 SRCS+= greeting_stub.c
20
21 EXTERNAL+= ocaml.findlib:compiler-libs
22
23 # We provide a quick and dirty way to produce the C object, but in
24 # real projects, it is reasonable to write a small library as a
25 # separate project module to provide all the required stubs.
26
27 test:
28 test -x ${DESTDIR}${BINDIR}/custom_toplevel
29
30 .include "ocaml.toplevel.mk"
31
32 ### End of file `TestToplevel.mk'
0 (* Custom_bootstrap -- Bootstrap our custom toplevel
1
2 Author: Michael Grünewald
3 Date: Mon Dec 29 11:33:55 CET 2014
4
5 BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 This file is part of BSD Owl Scripts
7
8 Copyright © 2005–2015 Michael Grünewald
9
10 This file must be used under the terms of the CeCILL-B.
11 This source file is licensed as described in the file COPYING, which
12 you should have received as part of this distribution. The terms
13 are also available at
14 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
15 let directory_list = [
16 "+compiler-libs";
17 ]
18
19 let install_printer_list = [
20 [ "Custom_library"; "Thing" ];
21 ]
22
23 let install_printer path =
24 let rec loop p =
25 match p with
26 | [] -> invalid_arg "Custom_bootstrap.install_printer"
27 | h :: [] -> Longident.Lident h
28 | h :: t -> Longident.Ldot (loop t, h)
29 in
30 let longident = loop ("format" :: List.rev path) in
31 let phrase = Parsetree.Ptop_dir(
32 "install_printer", Parsetree.Pdir_ident longident
33 )
34 in
35 ignore(Toploop.execute_phrase false Format.std_formatter phrase)
36
37 let bootstrap () =
38 begin
39 List.iter Topdirs.dir_directory directory_list;
40 List.iter install_printer install_printer_list;
41 end
42
43 let _ =
44 Toploop.toplevel_startup_hook := bootstrap
0 (* Custom_configuration -- Configuration for our custom toplevel
1
2 Author: Michael Grünewald
3 Date: Mon Dec 29 11:22:17 CET 2014
4
5 BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 This file is part of BSD Owl Scripts
7
8 Copyright © 2005–2015 Michael Grünewald
9
10 This file must be used under the terms of the CeCILL-B.
11 This source file is licensed as described in the file COPYING, which
12 you should have received as part of this distribution. The terms
13 are also available at
14 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
15
16 let project = "bsdowl"
17 let officer = "michipili@gmail.com"
18 let version = "@version@"
19 let prefix = "@prefix@"
20 let exec_prefix = "@exec_prefix@"
21 let bindir = "@bindir@"
22 let sbindir = "@sbindir@"
23 let libexecdir = "@libexecdir@"
24 let datarootdir = "@datarootdir@"
25 let datadir = "@datadir@"
26 let sysconfdir = "@sysconfdir@"
27 let sharedstatedir = "@sharedstatedir@"
28 let localstatedir = "@localstatedir@"
29 let runstatedir = "@runstatedir@"
30 let includedir = "@includedir@"
31 let docdir = "@docdir@"
32 let infodir = "@infodir@"
33 let libdir = "@libdir@"
34 let localedir = "@localedir@"
35 let mandir = "@mandir@"
0 (* Custom_library -- Our custom library
1
2 Author: Michael Grünewald
3 Date: Sat Jan 3 15:00:00 CET 2015
4
5 BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 This file is part of BSD Owl Scripts
7
8 Copyright © 2005–2015 Michael Grünewald
9
10 This file must be used under the terms of the CeCILL-B.
11 This source file is licensed as described in the file COPYING, which
12 you should have received as part of this distribution. The terms
13 are also available at
14 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
15 module Thing : sig
16 type t
17 val make : unit -> t
18 val format : Format.formatter -> t -> unit
19 end = struct
20 type t = unit
21 let make () = ()
22 let format ppt () =
23 Format.pp_print_string ppt "Something strange"
24 end
0 (* Greeting -- Say hello
1
2 Author: Michael Grünewald
3 Date: Sat Jan 3 16:31:02 CET 2015
4
5 BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 This file is part of BSD Owl Scripts
7
8 Copyright © 2005–2015 Michael Grünewald
9
10 This file must be used under the terms of the CeCILL-B.
11 This source file is licensed as described in the file COPYING, which
12 you should have received as part of this distribution. The terms
13 are also available at
14 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt *)
15
16 external hello_world : unit -> unit = "hello_world"
17
18 let () = hello_world ()
0 /* greeting_stub.c -- OCaml stubs to greet people
1
2 Author: Michael Grünewald
3 Date: Sat Jan 3 16:25:15 CET 2015
4
5 BSD Owl Scripts (https://github.com/michipili/bsdowl)
6 This file is part of BSD Owl Scripts
7
8 Copyright © 2005–2015 Michael Grünewald
9
10 This file must be used under the terms of the CeCILL-B.
11 This source file is licensed as described in the file COPYING, which
12 you should have received as part of this distribution. The terms
13 are also available at
14 http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt */
15
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <caml/mlvalues.h>
19 #include <caml/memory.h>
20 #include <caml/alloc.h>
21 #include <caml/custom.h>
22
23 value hello_world(value unit)
24 {
25 CAMLparam1 (unit);
26 printf("Hello, world!\n");
27 CAMLreturn (Val_unit);
28 }