Commit Graph

71 Commits

Author SHA1 Message Date
Julien Fischer
dbaa88605a Minor cleanups and fixes for standalone C sample.
samples/c_interface/standalone_c/Makefile:
    Fix grammar in a couple of spots.

    Use ':=' in place of '=' in some assignments.

samples/c_interface/standalone_c/c_main.c:
    Fix grammar in a couple of spots.

    Do not say that access to Mercury mutables from C is currently
    not thread safe; it will never be thread without the programmer
    putting in their own synchronization.
2026-02-07 16:16:48 +11:00
Peter Wang
35e76e41e2 Put .mh files into Mercury/mhs subdirectory.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.

compiler/file_names.m:
    Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
    ext_cur_ngs_max_cur. The new category is similar to that for .mih
    files, except that .mh files are never placed in grade-specific
    subdirectories.

compiler/handle_options.m:
    Add Mercury/mhs subdirs to list of C include directories
    when --use-subdirs or --use-grade-subdirs is in effect.

compiler/write_deps_file.m:
    Add $(mhs_subdir) prefix before %.mh patterns.

    Create a Mercury/mhs -> .. symlink when installing.
    This is required by mmc --make and mmake --use-subdirs.

    Conform to the changes above.

compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
    Conform to the changes above.

scripts/Mmake.vars.in:
    Define the variable mhs_subdir.

scripts/Mmake.rules:
    Add -I option to find .mh files when --use-subdirs is used.

browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
    Add -I options to find .mh files when the workspace is built
    with mmake --use-subdirs.

samples/c_interface/standalone_c/Makefile:
    Add option to let the C compiler find the .mh file.

NEWS.md:
    Announce change.

    Delete trailing whitespace.
2024-07-23 17:44:17 +10:00
Julien Fischer
5f6981c7de Delete ancient workaround for g++ 2.7.
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
     As above.
2023-03-11 14:21:10 +11:00
Julien Fischer
0cd62edc7c Clean-ups and fixes for the C interface examples.
samples/c_interface/*:
    Replace left over references to the old c_header_code pragma.

    Replace some uses of '__' as a module qualifier.

    Replace tabs with spaces.

    Add some missing words.
2023-02-25 12:53:26 +11:00
Julien Fischer
51745bee09 Remove execute bit from a Makefile.
samples/c_interface/standalone_c/Makefile:
     As above.
2022-12-14 01:36:29 +11:00
Julien Fischer
dd0a15409d Update the Mercury-Fortran interface example.
samples/c_interface/mercury_calls_fortran/Mmakefile:
    g77 was replaced by gfortran in GCC 4.0, use the latter in
    this example.

samples/c_interface/mercury_calls_fortran/fortran_main_int.m:
     Replace a ':- pragma import' with an equivalent foreign_proc.

     Describe the current gfortran name mangling scheme and delete
     references to g77 command line options not supported by gfortran.

samples/c_interface/mercury_calls_fortran/mercury_main.m:
     Replace tabs with spaces.
2022-03-28 15:24:16 +11:00
Julien Fischer
90ceef4065 Add missing interface declarations.
samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
    As above.
2022-03-25 12:24:00 +11:00
Julien Fischer
01061532ab Add short example of Java interface.
samples/java_interface/short_example.m:
    A Java version of the short example.

samples/java_interface/README.md:
    Add an entry for the new example.

samples/c_interface/README.md:
samples/csharp_interface/README.md:
    Fix wording.
2022-01-20 03:42:56 +11:00
Julien Fischer
e40a502004 Fix casing of a heading.
samples/c_interface/README.md:
    Not sure why I made the heading all uppercase.
2022-01-15 23:35:49 +11:00
Julien Fischer
aa2380ff3f Convert another README to Markdown.
samples/c_interface/README:
    Rename to README.md and convert the contents to Markdown.
2022-01-15 23:32:42 +11:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.

I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
2017-04-04 12:05:56 +10:00
Julien Fischer
9c96387183 Fix formatting of sample programs.
samples/Mmakefile:
    Add the beer program to list of targets.

samples/*.m:
    Convert (C->T;E) to (if C then T else E).

    Delete trailing whitespace.

    Use predmode syntax instead of separate pred and mode
    declarations.

samples/interpreter.m:
    Fix up one predicate that had some clauses that used
    DCGs and others that used state variables.

    Don't use the name 'IO' for something that isn't the I/O state.

samples/diff/*.m:
samples/c_interface/c_calls_mercury/mercury_main.m:
samples/c_interface/short_example.m:
    Delete trailing whitespace.
2015-12-14 16:06:13 +11:00
Matthias Güdemann
1b1ae35efb fix C macro name in C++ FFI example
This fixes the macro usage for `MR_list_is_empty(list)' in file
`samples/c_interface/simpler_cplusplus_calls_mercury/main.cc`.
2015-03-04 11:05:24 +01:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Julien Fischer
669f9a08bd Fix documentation errors in stand-alone interface example.
samples/c_interface/standalone_c/Makefile:
samples/c_interface/standalone_c/c_main.c:
	As above.

samples/c_interface/README:
	s/C interface/foreign language interface/
2015-01-05 17:24:57 +11:00
Sebastian Godelet
59ce15323f Fix samples/rot13_concise + libxml compilation error
boehm_gc/.gitignore:
    Ignore .obj files

extras/xml/xml.dtd.m:
extras/xml/xml.parse.m:
    Change the name of functor ('1') in the multiplicity/0 type
    to one. The former name does not (yet) work with the C# grade.

samples/.gitignore:
    Ignore library output and sample executables.

samples/c_interface/standalone_c/.gitignore:
    Ignore mercury_lib_int output files.

samples/c_interface/standalone_c/Makefile:
    chmod 0644.

samples/c_interface/.gitignore:
    Ignore object files and executables.

samples/java_interface/.gitignore:
    Ignore Java class files and executables.

samples/lazy_list/.gitignore:
samples/muz/.gitignore:
samples/rot13/.gitignore:
    Ignore executables.

samples/rot13/rot13_concise.m:
    Update call to index_det to use string.det_index.
    Added comments to clarify type inference.

samples/solutions/.gitignore:
    Ignore executables.

samples/solutions/all_solutions.m:
samples/solutions/n_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
    chmod 0644.

samples/solver_types/.gitignore:
    Ignore executables.

samples/solver_types/sudoku.m:
    Output the solution in a 3x3 grid.
2014-03-11 11:30:00 +11:00
Julien Fischer
a0833441e1 Add two new options to the compiler for querying what flags are passed to the
Branches: main

Add two new options to the compiler for querying what flags are passed to the
C compiler at a finer level of detail than that provided by --output-cflags.
The first new option, --output-grade-defines, prints the flags passed to the C
compiler to define the macros that specify the current compilation grade.
The second new option, --output-c-include-dir-flags, prints the flags passed
to C compiler that tell it where to search for C header files.

The rationale for the addition of the new options is that when compiling C++ or
Objective-C programs that call exported Mercury procedures via a standalone
interface we need both the flags for the grade defines and the include search
directories but other flags that we usually pass the C compiler may not be
appropriate for either a C++ or Objective-C compiler.

compiler/options.m:
	Recognise the new options.

compiler/mercury_compile.m:
	Handle the new options.

compiler/compile_target_code.m:
	Separate out the code that generates the grade macro define
	flags into a separate predicate.

	Do likewise with the code that generates the flags for specifying
	C compiler include search directories.

doc/use_guide.texi:
	Document the new options.

samples/c_interface/standalone_c/Makefile:
	Illustrate how to use the new options when compiling a program that
	uses a standalone interface.  Explain why it may not be appropriate
	to use the output of --output-cflags when compiling code that calls
	exported Mercury procedures.
2012-01-18 03:16:19 +00:00
Julien Fischer
a7fdf2d4ca Delete comments regarding the mgnuc and ml scripts.
Branches: main

samples/c_interface/standalone_c/Makefile:
	Delete comments regarding the mgnuc and ml scripts.
	The example was changed so that it doesn't rely on those
	some time ago.
2011-06-03 05:42:39 +00:00
Julien Fischer
190b69d4f1 Add a new command line option that causes the compiler to print out the
set of flags that it passes to the linker in order to link against a
selected set of Mercury libraries (the standard libraries plus any others
specified via the --ml option) in the current grade.
This removes the need for using the ml script with standalone interfaces.
(Which is useful on those systems that don't have a proper shell and can't
use that script!)

compiler/compiler_target_code.m:
	Add a predicate that prints out the above information.

	Refactor code in order to to avoid duplication between the new
	functionality and the existing code for invoking the linker.

compiler/mercury_compile.m:
compiler/options.m:
	Add the new option.

doc/user_guide.texi:
	Add an entry for the new option.

samples/c_interface/standalone_c/Makefile:
	Query the compiler directly about what flags to pass to the linker
	rather than using the ml script.

	Query the compiler about what flags to pass to the C compiler as
	well.  (This was implemented a while ago, but this example was
	never updated.)

	Extend this example to optionally work with shared libraries.
2009-01-20 06:24:05 +00:00
Julien Fischer
8ec6d0ff9c Make it easier to build the stand-alone interface example in different grades.
Estimated hours taken: 0.2
Branches: main

Make it easier to build the stand-alone interface example in different grades.

samples/c_interface/standalone_c/Makefile:
	Add a variable to set the option for setting the grade to build
	the example in.
2007-06-18 05:25:48 +00:00
Julien Fischer
690b5c0594 New file. Do not check the Makefile in this directory for
samples/c_interface/standalone_c/.nocopyright:
	New file.  Do not check the Makefile in this directory for
	a copyright message.
2007-06-18 05:25:44 +00:00
Julien Fischer
4684360b8a Delete bogus copyright message.
samples/c_interface/standalone_c/mercury_lib.m:
	Delete bogus copyright message.
2007-02-22 06:52:33 +00:00
Julien Fischer
008e7795f2 Add an example of how to use a stand-alone interface to the samples.
Estimated hours taken: 8
Branches: main

Add an example of how to use a stand-alone interface to the samples.

samples/c_interface/standalone_c/Makefile:
samples/c_interface/standalone_c/c_main.c:
samples/c_interface/standalone_c/c_main.exp:
samples/c_interface/standalone_c/mercury_lib.m:
	New files.  An annotated example of how to use a stand-alone interface.

samples/c_interface/README:
	Mention the new example.
2007-02-22 06:52:32 +00:00
Julien Fischer
553fb3f7d9 Use pragma foreign_export' in preference to pragma export' throughout
Estimated hours taken: 1
Branches: main

Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.

Convert more of the extras distribution to four-space indentation and
other minor cleanups.

browser/*.m:
library/*.m:
samples/*:
extras/*:
	As above.
2006-08-31 11:09:54 +00:00
Julien Fischer
57bfff193a Conform to recent changes in the standard library.
Estimated hours taken: 0
Branches: main

samples/c_interface/cplusplus_calls_mercury/mercury_lib.m:
	Conform to recent changes in the standard library.
2006-06-28 09:03:23 +00:00
Julien Fischer
b7a39efe29 Conform to recent changes in the standard library.
Estimated hours taken: 0
Branches: main

samples/c_interface/c_calls_mercury/mercury_lib.m:
	Conform to recent changes in the standard library.
2006-06-28 09:02:29 +00:00
Julien Fischer
daf357952d Update these files to conform to the current version of the
Estimated hours taken: 0
Branches: main

samples/c_interface/simpler_c_calls_mercury/mercury_lib.m:
samples/c_interface/simpler_cplusplus_calls_mercury/mercury_lib.m:
	Update these files to conform to the current version of the
	standard library.
2006-06-26 06:04:27 +00:00
Julien Fischer
fa555e1b36 Use '.' as the module qualifier instead of '__'.
Estimatd hours taken: 0.5
Branches: main

samples/*.m:
	Use '.' as the module qualifier instead of '__'.

	Use the new foreign language interface.

	Fix minor formatting issues.

	Use state variables for passing the I/O state.
2006-03-21 00:51:03 +00:00
Julien Fischer
f1a4faead7 Update this example to use the new foreign language interface.
Estimated hours taken: 0.1
Branches: main, release

samples/c_interface/short_example.m:
	Update this example to use the new foreign language interface.
2005-02-23 13:29:00 +00:00
Fergus Henderson
b13d2b7573 Get the simpler "C++ calls Mercury" sample working again.
Estimated hours taken: 0.1
Branches: main

Get the simpler "C++ calls Mercury" sample working again.

samples/c_interface/simpler_cplusplus_calls_mercury/main.cc:
	s/mercury_lib.h/mercury_lib.mh/

samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
	Link in -lstdc++, since recent versions of GNU C++ require this.
	Delete most of the mentions of mercury_lib.h, since they
	are now handled automatically by Mmake.
	s/mercury_lib.h/mercury_lib.mh/
2004-02-16 21:58:22 +00:00
Fergus Henderson
1ca4a57926 Get the simpler "C calls Mercury" sample working again.
Estimated hours taken: 0.1
Branches: main

Get the simpler "C calls Mercury" sample working again.

samples/c_interface/simpler_c_calls_mercury/main.c:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	s/mercury_lib.h/mercury_lib.mh/

samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Delete most of the mentions of mercury_lib.h, since they
	are now handled automatically by Mmake.
2004-02-16 21:54:37 +00:00
Fergus Henderson
3ff51ae3b3 Get the "C calls Mercury" sample working again.
Estimated hours taken: 0.1
Branches: main

Get the "C calls Mercury" sample working again.

samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/c_calls_mercury/Mmakefile:
	s/mercury_lib.h/mercury_lib.mh/

samples/c_interface/c_calls_mercury/Mmakefile:
	Delete most of the mentions of mercury_lib.h, since they
	are now handled automatically by Mmake.
2004-02-16 21:47:01 +00:00
Fergus Henderson
7f1b287d54 Get the "C++ calls Mercury" sample working again.
Estimated hours taken: 0.5
Branches: main

Get the "C++ calls Mercury" sample working again.

samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
	s/mercury_lib.h/mercury_lib.mh/

samples/c_interface/cplusplus_calls_mercury/Mmakefile:
	Link in -lstdc++, since recent versions of GNU C++ require this.
	Delete most of the mentions of mercury_lib.h, since they
	are now handled automatically by Mmake.
	s/mercury_lib.h/mercury_lib.mh/
2004-02-16 21:42:31 +00:00
Fergus Henderson
2bda4471e2 Fix a bug where the Mercury calls C++ sample was not linking with the
Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library.  This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.

samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Use the C++ standard library's stream I/O, rather than printf().

samples/c_interface/mercury_calls_cplusplus/Mmakefile:
	Make sure that we link with the C++ standard library.
	Also, comment out the old hack that worked around a g++ 2.7 bug
	which is fixed in g++ 2.95.
2003-10-09 03:09:53 +00:00
Fergus Henderson
c880e31dbe Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was actually using C, not C++.

samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
	code rather than as C code.  Add a dummy class declaration to its
	source, to check that it is really C++ code.
2003-10-08 12:15:44 +00:00
Fergus Henderson
088a269a3d Add missing `MR_' prefixes.
Estimated hours taken: 0.25
Branches: main

samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/main.cc:
	Add missing `MR_' prefixes.
2002-02-06 09:01:38 +00:00
Simon Taylor
66bf99c9d6 Simplify the simpler_c_calls_mercury and
Estimated hours taken: 0.25
Branches: main

Simplify the simpler_c_calls_mercury and
simpler_cplusplus_calls_mercury samples to
avoid explicit construction of the `ml' command line.

samples/c_interface/simpler_c_calls_mercury/c_main.c:
	Renamed as main.c.

samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
	Renamed as main.cc.

samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
	Empty main modules, used to set the name executable
	produced by mmake.

samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Handle file renamings.

	Remove explicit rules to build executables.

	Remove unnecessary header file dependencies.
2001-12-21 06:37:46 +00:00
Simon Taylor
cdf3ef12be Simplify the c_calls_mercury and cplusplus_calls_mercury samples.
Estimated hours taken: 0.5
Branches: main

Simplify the c_calls_mercury and cplusplus_calls_mercury samples.

c_calls_mercury/mercury_main.m:
cplusplus_calls_mercury/mercury_main.m:
c_calls_mercury/Mmakefile:
cplusplus_calls_mercury/Mmakefile:
	Import mercury_lib.m from mercury_main.m to avoid
	requiring explicit dependencies on mercury_lib.o.

	Remove unnecessary header file dependencies.
2001-12-21 06:23:01 +00:00
Simon Taylor
da2e0433c6 Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
Estimated hours taken: 0.25
Branches: main

bytecode/Mmakefile:
compiler/Mmakefile:
extras/aditi/Mmakefile:
extras/curses/sample/Mmakefile:
extras/graphics/samples/calc/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
tests/benchmarks/Mmakefile:
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/hard_coded/Mmakefile:
	Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
2001-12-19 15:08:30 +00:00
Simon Taylor
4167874245 Use MLOBJS, not MLLIBS, to hold the names of the
Estimated hours taken: 0.1
Branches: main, release

samples/c_interface/cpluscplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_c/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
	Use MLOBJS, not MLLIBS, to hold the names of the
	non-Mercury object files.
2001-12-16 05:22:20 +00:00
Simon Taylor
319df48866 Remove the RM_C mmake variable, which controlled whether the intermediate
Estimated hours taken: 0.5
Branches: main

Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).

The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.

Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
	Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.

compiler/modules.m:
	The `.o' and `.pic_o' file now depends only on the `.c' file,
	not on everthing the `.c' file depends on. The extra dependencies
	were only needed because the intermediate `.c' file could
	be removed by RM_C. This change is needed to avoid recompiling
	unchanged `.c' files with smart recompilation.
2001-05-18 14:23:59 +00:00
Fergus Henderson
3f41481523 Fix some failing test cases in samples/c_interface.
Estimated hours taken: 2.5

Fix some failing test cases in samples/c_interface.
This fixes SourceForge bug report #131053.

samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
	Fix several bugs:
	- use $(MGNUC) rather than hard-coding mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) to mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) to ml
	- s/*_REGS_H/MR_MACHDEPS_*_REGS_H/, to match
	  the renaming that was done a fair while back
	  in the runtime/machdeps/*.h.

samples/tests/c_interface/c_calls_mercury/Mmakefile:
	Add an explicit dependency to ensure that runtests makes
	the dependencies for the extra Mercury library used in
	this test case.
2001-02-05 09:35:56 +00:00
Fergus Henderson
d4dff852b0 Fix some bugs in samples/c_interface/*/Mmakefile.
Estimated hours taken: 1

Fix some bugs in samples/c_interface/*/Mmakefile.

samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Use $(mercury_lib.os) rather than hard-coding mercury_lib.o,
	so that it works if we compile mercury_lib to more than one
	object file, as we do for the `--target asm' case.

samples/c_interface/c_calls_mercury/Mmakefile:
	Pass $(ALL_GRADEFLAGS) to $(ML).
	Also use $(ALL_MLFLAGS) rather than $(MLFLAGS).
2001-01-24 13:48:12 +00:00
Tyson Dowd
71a07917dc Update the samples to use MR_ types and MR_ macros for
Estimated hours taken: 0.5

samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/c_main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
	Update the samples to use MR_ types and MR_ macros for
	creating lists.
2000-08-08 06:02:55 +00:00
Tyson Dowd
d64781a3d7 Add a testing architecture for the samples directory.
Estimated hours taken: 15

Add a testing architecture for the samples directory.
The tests are in the "tests" subdirectory of the samples
directory.  This keeps them close to the samples, but not close
enough to clutter up the samples.
It also means you don't have to worry about the issue of exactly where
the developer has checked out the CVS tests module.

samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Update this example to generate a .a file
	instead of directly using $(mercury_lib.os)

samples/tests/*:
	Test cases for all the samples.
2000-02-14 05:28:45 +00:00
Tyson Dowd
e9ece03315 Fix some problems in the samples.
Estimated hours taken: 1

Fix some problems in the samples.

samples/calculator.m:
	Strip spaces from the input before using it.
	I keep forgetting that spaces aren't allowed in the input
	of this example, and I can only assume that new users get
	confused over this.

samples/c_interface/c_calls_mercury/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Add a missing dependency.
	Remove an unnecessary dependency that MLOBJS takes care of.

samples/c_interface/mercury_calls_fortran/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Use -lg2c instead of the old -lf2c for the fortran library.
	(libf2c no longer exists)
2000-02-03 05:13:11 +00:00
Fergus Henderson
36c651a26d Add a missing import of module `list'. Previous versions
Estimated hours taken: 0.5

samples/c_interface/cplusplus_calls_mercury/mercury_lib.m:
	Add a missing import of module `list'.  Previous versions
	of the Mercury compiler didn't detect this error.
1999-12-13 12:54:20 +00:00
Fergus Henderson
98b0afa001 Use clean_local' instead of clean' and `realclean_local' instead
Estimated hours taken: 0.75

Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
	Use `clean_local' instead of `clean' and `realclean_local' instead
	of `realclean' where appropriate.  This is necessary now that
	`realclean' does not depend on `clean'.
1999-09-16 04:46:31 +00:00
Simon Taylor
d348b24af5 Fix an old-style `:- pragma c_code' declaration.
Estimated hours taken: 0.1

samples/c_calls_mercury/c_main_int.m:
	Fix an old-style `:- pragma c_code' declaration.

samples/c_calls_mercury/mercury_lib.m:
	Add a missing import.
1999-03-24 03:20:29 +00:00
Tyson Dowd
90ec6ff89d Add rot13 examples to the samples directory.
Estimated hours taken: 8

Add rot13 examples to the samples directory.

Note: Estimated time is time for contributors, mainly.

samples/README:
samples/c_interface/README:
	Fix the README files, they were a little inaccurate in
	describing some files and directories.
1998-11-19 06:18:23 +00:00